- 1. 概要
- 2. vpopmail
- 3. courier-authlib-vchkpw
- 4. courier-imap
- 5. 設定
1. 概要
以前は、バックアップとしてとっておくことも考えて、断然「pop3」派だったのですが。
最近は、複数の個所の別のマシンで同じメールアドレスを使うのに、それぞれのマシンでどこまで受信していたかわからなくなって、「imap」へ乗り換えています。
以下、「IMAP」関連のモジュールをインストールするところから始めます。
2. vpopmail
cd /usr/ports/mail/vpopmail
make config
下記が、デフォルトのオプションになります。



デフォルトのオプションの他、以下にチェックをいれます。
・PASSWD
・QMAIL_EXT
・SPAMASSASSIN
今んとこ、「MD5」形式に対応していないので、以下のチェックを外します。
・MD5_PASSWORDS
cd /usr/ports/mail/vpopmail
make NO_DIALOG=yes
make install
インストール時のメッセージを残しておきます。
===> Installing for vpopmail-5.4.33_4
===> Checking if vpopmail is already installed
===> Registering installation for vpopmail-5.4.33_4
Installing vpopmail-5.4.33_4...
===> Creating groups
Creating group 'vchkpw' with gid '89'
===> Creating users
Creating user 'vpopmail' with uid '89'
===> Creating homedir(s)
***********************************************************************
Now you should add the following options to your spamd.sh startup file:
-v -u vpopmail
***********************************************************************
===> NOTICE:
The vpopmail port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:
https://bugs.freebsd.org/bugzilla
More information about port maintainership is available at:
https://docs.freebsd.org/en/articles/contributing/#ports-contributing
3. courier-authlib-vchkpw
cd /usr/ports/mail/courier-authlib-vchkpw
make NO_DIALOG=yes
make install
オプションはありません。
インストール時のメッセージを残しておきます。
===> Installing for courier-authlib-vchkpw-0.72.3
===> Checking if courier-authlib-vchkpw is already installed
===> Registering installation for courier-authlib-vchkpw-0.72.3
Installing courier-authlib-vchkpw-0.72.3...
前項の「vpopmail」インストール時にあやまりがあると、本項の「make」で失敗しますので、ご注意ください。
こもし失敗した場合は、「vpopmail」をインストールし直す必要があります。
「make deinstall clean」後に、いったん、「/etc/group」から
vchkpw:*:89:
の行を削除して(「vi」で編集)
「/etc/passwd」から
vpopmail:*:89:89::0:0:VPop Mail User:/usr/local/vpopmail:/nonexistent
の行を削除して(「vipw」で編集)、「vpopmail」を「make」からインストールし直すことで、問題は解消します。
4. courier-imap
cd /usr/ports/mail/courier-imap
make config
下記が、デフォルトのオプションになります。

デフォルトのオプションの他、以下にチェックをいれます。
・AUTH_VCHKPW
・GNUTLS
「GNUTLS」にチェックをいれておかないと
Jul 30 15:36:57 ns imapd-ssl: ip=[::ffff:192.168.10.36], couriertls: read: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
てなエラーになって接続できません。
cd /usr/ports/mail/courier-imap
make NO_DIALOG=yes
make install
インストール時のメッセージを掲載しておきます。
===> Installing for courier-imap-5.2.10,2
===> Checking if courier-imap is already installed
===> Registering installation for courier-imap-5.2.10,2
Installing courier-imap-5.2.10,2...
imapd-ssl:
SSLPORT: new
SSLADDRESS: new
SSLPIDFILE: new
SSLLOGGEROPTS: new
IMAPDSSLSTART: new
IMAPDSTARTTLS: new
IMAP_TLS_REQUIRED: new
COURIERTLS: new
TLS_PRIORITY: new
TLS_PROTOCOL: new
TLS_CIPHER_LIST: new
TLS_STARTTLS_PROTOCOL: new
TLS_MIN_DH_BITS: new
TLS_TIMEOUT: new
TLS_CERTFILE: new
TLS_PRIVATE_KEYFILE: new
TLS_DHPARAMS: new
TLS_TRUSTCERTS: new
TLS_VERIFYPEER: new
TLS_EXTERNAL: new
TLS_CACHE: new
TLS_ALPN: new
MAILDIRPATH: new
imapd:
ADDRESS: new
PORT: new
AUTHSERVICE: new
MAXDAEMONS: new
MAXPERIP: new
PIDFILE: new
TCPDOPTS: new
ACCESSFILE: new
LOGGEROPTS: new
DEFDOMAIN: new
IMAP_CAPABILITY: new
KEYWORDS_CAPABILITY: new
ACL_CAPABILITY: new
SMAP1_CAPABILITY: new
IMAP_CAPABILITY_ORIG: new
IMAP_PROXY: new
PROXY_HOSTNAME: new
IMAP_PROXY_FOREIGN: new
IMAP_IDLE_TIMEOUT: new
IMAP_MAILBOX_SANITY_CHECK: new
IMAP_CAPABILITY_TLS: new
IMAP_TLS_ORIG: new
IMAP_DISABLETHREADSORT: new
IMAP_CHECK_ALL_FOLDERS: new
IMAP_OBSOLETE_CLIENT: new
IMAP_UMASK: new
IMAP_ULIMITD: new
IMAP_USELOCKS: new
IMAP_SHAREDINDEXFILE: new
IMAP_TRASHFOLDERNAME: new
IMAP_EMPTYTRASH: new
IMAP_MOVE_EXPUNGE_TO_TRASH: new
IMAP_LOG_DELETIONS: new
AUTH_MKHOMEDIR_SKEL: new
IMAPDEBUGFILE: new
OUTBOX: new
SENDMAIL: new
HEADERFROM: new
ID_FIELDS: new
OUTBOX_MULTIPLE_SEND: new
IMAPDSTART: new
MAILDIRPATH: new
pop3d-ssl:
SSLPORT: new
SSLADDRESS: new
SSLPIDFILE: new
SSLLOGGEROPTS: new
POP3DSSLSTART: new
POP3_STARTTLS: new
POP3_TLS_REQUIRED: new
COURIERTLS: new
TLS_PRIORITY: new
TLS_PROTOCOL: new
TLS_STARTTLS_PROTOCOL: new
TLS_CIPHER_LIST: new
TLS_MIN_DH_BITS: new
TLS_TIMEOUT: new
TLS_CERTFILE: new
TLS_PRIVATE_KEYFILE: new
TLS_DHPARAMS: new
TLS_TRUSTCERTS: new
TLS_VERIFYPEER: new
TLS_EXTERNAL: new
TLS_CACHE: new
TLS_ALPN: new
MAILDIRPATH: new
pop3d:
PIDFILE: new
MAXDAEMONS: new
MAXPERIP: new
POP3AUTH: new
POP3AUTH_ORIG: new
POP3AUTH_TLS: new
POP3AUTH_TLS_ORIG: new
POP3_PROXY: new
PROXY_HOSTNAME: new
PORT: new
ADDRESS: new
AUTHSERVICE: new
TCPDOPTS: new
LOGGEROPTS: new
DEFDOMAIN: new
POP3DSTART: new
POP3_LOG_DELETIONS: new
AUTH_MKHOMEDIR_SKEL: new
MAILDIRPATH: new
MIME_UNICODE_MESSAGE_TYPE: new
In case you use authpam, you should put the following lines
in your /etc/pam.d/imap:
auth required pam_unix.so try_first_pass
account required pam_unix.so try_first_pass
session required pam_permit.so
You will have to run /usr/local/share/courier-imap/mkimapdcert to create
a self-signed certificate if you want to use imapd-ssl.
And you will have to copy and edit the *.dist files to *
in /usr/local/etc/courier-imap.
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/courier-imap/couriertcpd
/usr/local/bin/couriertls
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
https://www.courier-mta.org/imap/
5. 設定
vi /usr/local/etc/authlib/authdaemonrc
authmodulelist="authuserdb authvchkpw authpam authldap authmysql authpgsql"
##NAME: authmodulelistorig:4
#
# This setting is used by Courier's webadmin module, and should be left
# alone
authmodulelistorig="authuserdb authvchkpw authpam authldap authmysql authpgsql"
下記へ変更します。
authmodulelist="authvchkpw authpam"
##NAME: authmodulelistorig:4
#
# This setting is used by Courier's webadmin module, and should be left
# alone
authmodulelistorig="authvchkpw authpam"
|