Contents
- 1 Dovecotについて
- 2 サーバー構築
- 3 Dovecotの構築
- 4 Dovecot設定
- 4.1 設定ファイルパス
- 4.2 記法
- 4.3 標準設定一覧
- 4.4 パラメータ
- 4.4.1 基本設定
- 4.4.2 認証
- 4.4.2.1 auth_anonymous_username
- 4.4.2.2 auth_cache_negative_ttl
- 4.4.2.3 auth_cache_size
- 4.4.2.4 auth_cache_ttl
- 4.4.2.5 auth_debug
- 4.4.2.6 auth_debug_passwords
- 4.4.2.7 auth_default_realm
- 4.4.2.8 auth_failure_delay
- 4.4.2.9 auth_gssapi_hostname
- 4.4.2.10 auth_krb5_keytab
- 4.4.2.11 auth_master_user_separator
- 4.4.2.12 auth_mechanisms
- 4.4.2.13 auth_policy_hash_mech
- 4.4.2.14 auth_policy_hash_nonce
- 4.4.2.15 auth_policy_hash_truncate
- 4.4.2.16 auth_policy_reject_on_fail
- 4.4.2.17 auth_policy_request_attributes
- 4.4.2.18 auth_policy_server_api_header
- 4.4.2.19 auth_policy_server_timeout_msecs
- 4.4.2.20 auth_policy_server_url
- 4.4.2.21 auth_proxy_self
- 4.4.2.22 auth_realms
- 4.4.2.23 auth_socket_path
- 4.4.2.24 auth_ssl_require_client_cert
- 4.4.2.25 auth_ssl_username_from_cert
- 4.4.2.26 auth_stats
- 4.4.2.27 auth_use_winbind
- 4.4.2.28 auth_username_chars
- 4.4.2.29 auth_username_format
- 4.4.2.30 auth_username_translation
- 4.4.2.31 auth_verbose
- 4.4.2.32 auth_verbose_passwords
- 4.4.2.33 auth_winbind_helper_path
- 4.4.2.34 auth_worker_max_count
- 4.4.2.35 passdbセクション
- 4.4.2.36 userdbセクション
- 4.4.3 Director
- 4.4.4 doveadmサーバ
- 4.4.5 dsync
- 4.4.6 HAProxy
- 4.4.7 IMAP
- 4.4.7.1 imap_capability
- 4.4.7.2 imap_client_workarounds
- 4.4.7.3 imap_fetch_failure
- 4.4.7.4 imap_hibernate_timeout
- 4.4.7.5 imap_id_log
- 4.4.7.6 imap_id_retain
- 4.4.7.7 imap_id_send
- 4.4.7.8 imap_idle_notify_interval
- 4.4.7.9 imap_logout_format
- 4.4.7.10 imap_max_line_length
- 4.4.7.11 imap_metadata
- 4.4.7.12 imap_urlauth_host
- 4.4.7.13 imap_urlauth_logout_format
- 4.4.7.14 imap_urlauth_port
- 4.4.7.15 imapc_cmd_timeout
- 4.4.7.16 imapc_connection_retry_count
- 4.4.7.17 imapc_connection_retry_interval
- 4.4.7.18 imapc_features
- 4.4.7.19 imapc_host
- 4.4.7.20 imapc_list_prefix
- 4.4.7.21 imapc_master_user
- 4.4.7.22 imapc_max_idle_time
- 4.4.7.23 imapc_max_line_length
- 4.4.7.24 imapc_password
- 4.4.7.25 imapc_port
- 4.4.7.26 imapc_rawlog_dir
- 4.4.7.27 imapc_sasl_mechanisms
- 4.4.7.28 imapc_ssl
- 4.4.7.29 imapc_ssl_verify
- 4.4.7.30 imapc_user
- 4.4.8 LDA(Local Delivery Agent)
- 4.4.9 LMTP
- 4.4.10 ログイン時動作
- 4.4.11 ストレージ・ファイル
- 4.4.11.1 dotlock_use_excl
- 4.4.11.2 lock_method
- 4.4.11.3 mmap_disable
- 4.4.11.4 mail_access_groups
- 4.4.11.5 mail_always_cache_fields
- 4.4.11.6 mail_attachment_dir
- 4.4.11.7 mail_attachment_fs
- 4.4.11.8 mail_attachment_hash
- 4.4.11.9 mail_attachment_min_size
- 4.4.11.10 mail_attribute_dict
- 4.4.11.11 mail_cache_fields
- 4.4.11.12 mail_cache_min_mail_count
- 4.4.11.13 mail_chroot
- 4.4.11.14 mail_debug
- 4.4.11.15 mail_fsync
- 4.4.11.16 mail_full_filesystem_access
- 4.4.11.17 mail_gid
- 4.4.11.18 mail_home
- 4.4.11.19 mail_location
- 4.4.11.20 mail_log_prefix
- 4.4.11.21 mail_max_keyword_length
- 4.4.11.22 mail_max_lock_timeout
- 4.4.11.23 mail_max_userip_connections
- 4.4.11.24 mail_never_cache_fields
- 4.4.11.25 mail_nfs_index
- 4.4.11.26 mail_nfs_storage
- 4.4.11.27 mail_plugin_dir
- 4.4.11.28 mail_plugins
- 4.4.11.29 mail_prefetch_count
- 4.4.11.30 mail_privileged_group
- 4.4.11.31 mail_save_crlf
- 4.4.11.32 mail_server_admin
- 4.4.11.33 mail_server_comment
- 4.4.11.34 mail_shared_explicit_inbox
- 4.4.11.35 mail_sort_max_read_count
- 4.4.11.36 mail_temp_dir
- 4.4.11.37 mail_temp_scan_interval
- 4.4.11.38 mail_uid
- 4.4.11.39 mail_vsize_bg_after_count
- 4.4.11.40 mailbox_idle_check_interval
- 4.4.11.41 mailbox_list_index
- 4.4.11.42 mailbox_list_index_include_inbox
- 4.4.11.43 mailbox_list_index_very_dirty_syncs
- 4.4.11.44 maildir_broken_filename_sizes
- 4.4.11.45 maildir_copy_with_hardlinks
- 4.4.11.46 maildir_empty_new
- 4.4.11.47 maildir_stat_dirs
- 4.4.11.48 maildir_very_dirty_syncs
- 4.4.11.49 mbox_dirty_syncs
- 4.4.11.50 mbox_dotlock_change_timeout
- 4.4.11.51 mbox_lazy_writes
- 4.4.11.52 mbox_lock_timeout
- 4.4.11.53 mbox_md5
- 4.4.11.54 mbox_min_index_size
- 4.4.11.55 mbox_read_locks
- 4.4.11.56 mbox_very_dirty_syncs
- 4.4.11.57 mbox_write_locks
- 4.4.11.58 mdbox_preallocate_space
- 4.4.11.59 mdbox_purge_preserve_alt
- 4.4.11.60 mdbox_rotate_interval
- 4.4.11.61 mdbox_rotate_size
- 4.4.12 POP3
- 4.4.12.1 pop3_client_workarounds
- 4.4.12.2 pop3_delete_type
- 4.4.12.3 pop3_deleted_flag
- 4.4.12.4 pop3_enable_last
- 4.4.12.5 pop3_fast_size_lookups
- 4.4.12.6 pop3_lock_session
- 4.4.12.7 pop3_logout_format
- 4.4.12.8 pop3_no_flag_updates
- 4.4.12.9 pop3_reuse_xuidl
- 4.4.12.10 pop3_save_uidl
- 4.4.12.11 pop3_uidl_duplicates
- 4.4.12.12 pop3_uidl_format
- 4.4.12.13 pop3c_features
- 4.4.12.14 pop3c_host
- 4.4.12.15 pop3c_master_user
- 4.4.12.16 pop3c_password
- 4.4.12.17 pop3c_port
- 4.4.12.18 pop3c_quick_received_date
- 4.4.12.19 pop3c_rawlog_dir
- 4.4.12.20 pop3c_ssl
- 4.4.12.21 pop3c_ssl_verify
- 4.4.12.22 pop3c_user
- 4.4.13 レプリケーション
- 4.4.14 serviceセクション
- 4.4.14.1 デフォルトサービス
- 4.4.14.2 chroot
- 4.4.14.3 client_limit
- 4.4.14.4 drop_priv_before_exec
- 4.4.14.5 executable
- 4.4.14.6 extra_groups
- 4.4.14.7 group
- 4.4.14.8 idle_kill
- 4.4.14.9 privileged_group
- 4.4.14.10 process_limit
- 4.4.14.11 process_min_avail
- 4.4.14.12 protocol
- 4.4.14.13 service_count
- 4.4.14.14 type
- 4.4.14.15 unix_listener dict-asyncセクション
- 4.4.14.16 user
- 4.4.14.17 vsz_limit
- 4.4.14.18 デフォルトパラメータ
- 4.4.14.19 各デフォルト値
- 4.4.14.19.1 service aggregatorセクション
- 4.4.14.19.2 service anvilセクション
- 4.4.14.19.3 service auth-workerセクション
- 4.4.14.19.4 service authセクション
- 4.4.14.19.5 service configセクション
- 4.4.14.19.6 service dict-asyncセクション
- 4.4.14.19.7 service dictセクション
- 4.4.14.19.8 service directorセクション
- 4.4.14.19.9 service dns_clientセクション
- 4.4.14.19.10 service doveadmセクション
- 4.4.14.19.11 service imap-hibernateセクション
- 4.4.14.19.12 service imap-loginセクション
- 4.4.14.19.13 service imap-urlauth-loginセクション
- 4.4.14.19.14 service imap-urlauth-workerセクション
- 4.4.14.19.15 service imap-urlauthセクション
- 4.4.14.19.16 service imapセクション
- 4.4.14.19.17 service indexer-workerセクション
- 4.4.14.19.18 service indexerセクション
- 4.4.14.19.19 service ipcセクション
- 4.4.14.19.20 service lmtpセクション
- 4.4.14.19.21 service logセクション
- 4.4.14.19.22 service pop3-loginセクション
- 4.4.14.19.23 service pop3セクション
- 4.4.14.19.24 service replicatorセクション
- 4.4.14.19.25 service ssl-paramsセクション
- 4.4.14.19.26 service statsセクション
- 4.4.15 SSL
- 4.4.15.1 ssl
- 4.4.15.2 ファイル
- 4.4.15.3 クライアント認証
- 4.4.15.4 その他
- 4.4.15.4.1 ssl_cert_username_field
- 4.4.15.4.2 ssl_cipher_list
- 4.4.15.4.3 ssl_crypto_device
- 4.4.15.4.4 ssl_dh_parameters_length
- 4.4.15.4.5 ssl_options
- 4.4.15.4.6 ssl_parameters_regenerate
- 4.4.15.4.7 ssl_prefer_server_ciphers
- 4.4.15.4.8 ssl_protocols
- 4.4.15.4.9 ssl_require_crl
- 4.4.15.4.10 ssl_verify_client_cert
- 4.4.15.4.11 verbose_ssl
- 4.4.16 統計情報
- 4.4.17 MDA(LDA : Local Delivery Agent)
- 4.4.18 dictセクション
- 5 ツール
- 6 トラブルシューティング
- 7 Tips
Dovecotについて
公式ページ:https://www.dovecot.org/
用語
MRA(Mail Retrieval Agent)
受信したメールを読みだすためのサーバプログラムのこと。
機能
プロキシ
Directorサーバと呼び、DovecotによるMRAサーバへのプロキシを行うサーバを立てることができる。
このプロキシサーバでは複数のMRAへ接続を振り分けることが可能である。
サーバー構築
構築環境
- Dovecot
2.2.33
※パッケージ版は2.2.10
- OS
CentOS 7.3
OS設定
ネットワーク
固定IPアドレス割り当て
次のファイルを編集する
# ifcfg-loはループバックインタフェースであるため、触らない vi /etc/sysconfig/network-scripts/ifcfg-<インタフェース名>
以下では例として192.168.0.51/24を割り当てた
BOOTPROTO=static ONBOOT=yes IPADDR=192.168.0.51 NETMASK=255.255.255.0 NETWORK=192.168.0.0 GATEWAY=192.168.0.1
ネットワークを再起動する
systemctl restart network
ip addressコマンドにより、インタフェースが有効になっていることを確認する
これによりホストマシンなどからSSHでログイン可能となる
firewalld
IMAP4
IMAP4(TCP/143)を開ける場合、下記を行う。
※CentOS7.2以前のCentOS7場合はfirewalldのバージョン場古く、下記を実行できない。アップデートすること。
yum update firewalld -y
- ルールが定義されていることを確認
firewall-cmd --permanent --info-service=imap
- 現在ルールが適用されていないことを確認する
firewall-cmd --list-services --zone=public --permanent | sed -e "s/ /\n/g" | grep imap
- ルールを適用する
firewall-cmd --add-service=imap --zone=public --permanent
- ルールが適用されていることを確認する
firewall-cmd --list-services --zone=public --permanent | sed -e "s/ /\n/g" | grep imap
- 設定を再読み込みして反映させる
firewall-cmd --reload
POP3
POP3(TCP/110)を開ける場合、下記を行う。
※CentOS7.2以前のCentOS7場合はfirewalldのバージョン場古く、下記を実行できない。アップデートすること。
yum update firewalld -y
- ルールが定義されていることを確認
firewall-cmd --permanent --info-service=pop3
- 現在ルールが適用されていないことを確認する
firewall-cmd --list-services --zone=public --permanent | sed -e "s/ /\n/g" | grep pop3
- ルールを適用する
firewall-cmd --add-service=pop3 --zone=public --permanent
- ルールが適用されていることを確認する
firewall-cmd --list-services --zone=public --permanent | sed -e "s/ /\n/g" | grep pop3
- 設定を再読み込みして反映させる
firewall-cmd --reload
IMAP4S
IMAP4(TCP/993)を開ける場合、下記を行う。
※CentOS7.2以前のCentOS7場合はfirewalldのバージョン場古く、下記を実行できない。アップデートすること。
yum update firewalld -y
- ルールが定義されていることを確認
firewall-cmd --permanent --info-service=imaps
- 現在ルールが適用されていないことを確認する
firewall-cmd --list-services --zone=public --permanent | sed -e "s/ /\n/g" | grep imaps
- ルールを適用する
firewall-cmd --add-service=imaps --zone=public --permanent
- ルールが適用されていることを確認する
firewall-cmd --list-services --zone=public --permanent | sed -e "s/ /\n/g" | grep imaps
- 設定を再読み込みして反映させる
firewall-cmd --reload
POP3S
POP3(TCP/995)を開ける場合、下記を行う。
※CentOS7.2以前のCentOS7場合はfirewalldのバージョン場古く、下記を実行できない。アップデートすること。
yum update firewalld -y
- ルールが定義されていることを確認
firewall-cmd --permanent --info-service=pop3s
- 現在ルールが適用されていないことを確認する
firewall-cmd --list-services --zone=public --permanent | sed -e "s/ /\n/g" | grep pop3s
- ルールを適用する
firewall-cmd --add-service=pop3s --zone=public --permanent
- ルールが適用されていることを確認する
firewall-cmd --list-services --zone=public --permanent | sed -e "s/ /\n/g" | grep pop3s
- 設定を再読み込みして反映させる
firewall-cmd --reload
ホスト名
ホスト名としてmailを設定する
hostname mail.corp # 再起動しても有効にする echo mail.corp > /etc/hostname再ログインすることで有効になる。
ユーザ作成
dovecot用のユーザを作成する
デーモン用ユーザ
useradd --user-group --no-create-home --shell /sbin/nologin dovecot
デフォルトアクセスユーザ
アクセスしたユーザが未承認状態の場合のデフォルトユーザを作成する
useradd --no-create-home --shell /sbin/nologin dovenull usermod -G dovecot dovenull
Dovecotの構築
Dovecotのインストール
パッケージからインストール
- 参考:
yum install dovecot
[root@localhost ~]# yum install dovecot Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp Resolving Dependencies --> Running transaction check ---> Package dovecot.x86_64 1:2.2.10-8.el7 will be installed --> Processing Dependency: libclucene-shared.so.1()(64bit) for package: 1:dovecot-2.2.10-8.el7.x86_64 --> Processing Dependency: libclucene-core.so.1()(64bit) for package: 1:dovecot-2.2.10-8.el7.x86_64 --> Running transaction check ---> Package clucene-core.x86_64 0:2.3.3.4-11.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: dovecot x86_64 1:2.2.10-8.el7 base 3.2 M Installing for dependencies: clucene-core x86_64 2.3.3.4-11.el7 base 528 k Transaction Summary ================================================================================ Install 1 Package (+1 Dependent package) Total download size: 3.7 M Installed size: 12 M Is this ok [y/d/N]: y Downloading packages: (1/2): clucene-core-2.3.3.4-11.el7.x86_64.rpm | 528 kB 00:00 (2/2): dovecot-2.2.10-8.el7.x86_64.rpm | 3.2 MB 00:01 -------------------------------------------------------------------------------- Total 2.1 MB/s | 3.7 MB 00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : clucene-core-2.3.3.4-11.el7.x86_64 1/2 Installing : 1:dovecot-2.2.10-8.el7.x86_64 2/2 Verifying : clucene-core-2.3.3.4-11.el7.x86_64 1/2 Verifying : 1:dovecot-2.2.10-8.el7.x86_64 2/2 Installed: dovecot.x86_64 1:2.2.10-8.el7 Dependency Installed: clucene-core.x86_64 0:2.3.3.4-11.el7 Complete!
ソースコードからインストール
- rootになる
su -
- ソースコードを取得する
- ダウンロードサイト:https://www.dovecot.org/download.htmlからアーカイブのURLを取得する
※Stable releasesから取得する - ダウンロードする
curl -O -s https://www.dovecot.org/releases/2.2/dovecot-2.2.33.tar.gz
- アーカイブファイルを展開する
tar xzfv dovecot-*.tar.gz
- ソースコードディレクトリへ移動する
cd dovecot-*
- ダウンロードサイト:https://www.dovecot.org/download.htmlからアーカイブのURLを取得する
- コンパイル、インストールを行う
- コンパイル最適化設定を行う
export CFLAGS="-O3 -m64"
- Makefileを生成する
./configure --prefix=/usr/local/`pwd | sed "s/.*\///"` --sysconfdir=/usr/local/`pwd | sed "s/.*\///"`/conf 2>&1 | tee configure.log
- オプション一覧
[root@mail dovecot-2.2.33]# ./configure --help `configure' configures Dovecot 2.2.33 to adapt to many kinds of systems. Usage: ./configure [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/dovecot] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-devel-checks Enable some extra expensive checks for developers --enable-asserts Enable asserts (default) --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-rpath do not hardcode runtime library paths --disable-largefile omit support for large files Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-shared-libs Link binaries using shared Dovecot libraries (default) --with-mem-align=BYTES Set the memory alignment (default: 8) --with-ioloop=IOLOOP Specify the I/O loop method to use (epoll, kqueue, poll; best for the fastest available; default is best) --with-notify=NOTIFY Specify the file system notification method to use (inotify, kqueue, dnotify, none; default is detected in the above order) --with-nss Build with NSS module support (auto) --with-shadow Build with shadow password support (auto) --with-pam Build with PAM support (auto) --with-bsdauth Build with BSD authentication support (auto) --with-gssapi=yes|plugin Build with GSSAPI authentication support --with-sia Build with Tru64 SIA support --with-ldap=yes|plugin Build with LDAP support --with-vpopmail Build with vpopmail support (auto) --with-sql=yes|plugin Build with generic SQL support --with-pgsql Build with PostgreSQL driver support --with-mysql Build with MySQL driver support --with-sqlite Build with SQLite3 driver support --with-lucene Build with CLucene full text search support --with-stemmer Build with libstemmer support (for CLucene) --with-solr Build with Solr full text search support --with-zlib Build with zlib compression support --with-bzlib Build with bzlib compression support --with-libcap Build with libcap support (Dropping capabilities). --with-libwrap Build with libwrap, ie. TCP-wrappers --with-ssl=gnutls|openssl Build with GNUTLS or OpenSSL (default) --with-ssldir=DIR SSL base directory for certificates (/etc/ssl) --with-rundir=DIR Runtime data directory (LOCALSTATEDIR/run/dovecot) --with-statedir=DIR Permanent data directory (LOCALSTATEDIR/lib/dovecot) --with-systemdsystemunitdir=DIR Directory for systemd service files (auto=detect) --with-gc Use Boehm garbage collector --with-storages Build with specified mail storage formats (mdbox sdbox maildir mbox cydir imapc pop3c) --with-moduledir=DIR Base directory for dynamically loadable modules --with-docs Install documentation (default) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir Some influential environment variables: PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor SSL_CFLAGS C compiler flags for SSL, overriding pkg-config SSL_LIBS linker flags for SSL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to <dovecot@dovecot.org>.
- オプション
- –oldincludedir
現在は意味をなさない - –sbindir
dovecotのデーモンファイルのインストールパス - –sysconfdir
設定ファイルのインストールパス - –without-docs
ドキュメント、サンプル設定ファイル、自己署名証明書生成スクリプト、Apache Solr用のスキーマファイルなどをインストールしない。
インストールした場合、下記ディレクトリに配置される。
$DOVECOT_HOME/share/doc/
- –oldincludedir
- オプション一覧
- コンパイルする
make 2>&1 | tee make.log
- インストールを行う。
make install 2>&1 | tee make_install.log
- コンパイル最適化設定を行う
- リンク作成、環境変数設定などを行う
- インストールディレクトリへのシンボリックリンクを作成する。
これによって、複数のバージョンを同居させ、リンクを切り替えることで、バージョン変更が可能となる。
各バージョンの実行ファイルはデフォルトでは各バージョンの設定ファイルを読み込むこととなる。
rm -f /usr/local/dovecot ln -s /usr/local/`pwd | sed "s/.*\///"` /usr/local/dovecot
- 簡単にアクセスできるように環境変数を設定する
export DOVECOT_HOME=/usr/local/dovecot
- ツール類にパスを通す
export PATH=$DOVECOT_HOME/bin:$PATH
- 環境変数を再起動後も有効にする
echo "" >> /etc/bashrc echo "# DOVECOT ENVIRONMENT VARIABLE" >> /etc/bashrc echo "export DOVECOT_HOME=$DOVECOT_HOME" >> /etc/bashrc echo "export PATH=\$DOVECOT_HOME/bin:\$PATH" >> /etc/bashrc
- インストールディレクトリへのシンボリックリンクを作成する。
- 不要なソースコードを削除する
cd ../ rm -rf dovecot*
- インストールしたディレクトリに移動する
cd $DOVECOT_HOME
- 不要ファイルを削除する
rm -f conf/dovecot/README
- systemdの設定する
- サービスファイルを作成する
※1024番以下のポートを使用する場合はパラメータ”User”を使用してroot以外を指定することをしてはならない。
cat > /etc/systemd/system/dovecot.service << EOT [Unit] Description=Dovecot IMAP/POP3 email server After=local-fs.target network.target network-online.target [Service] Type=simple ExecStart=/usr/local/dovecot/sbin/dovecot -F ExecReload=/bin/kill -HUP $MAINPID PrivateTmp=true NonBlocking=yes [Install] WantedBy=multi-user.target EOT
- 必要であれば、ソケットファイルも作成する。
ソケットファイルはスーパーデーモンを利用する際に使用する。
メール受信を使用する頻度が低いなら設定しておくと良い。
cat > /etc/systemd/system/dovecot.socket << EOT [Unit] Description=Dovecot IMAP/POP3 email server activation socket [Socket] #dovecot expects separate IPv4 and IPv6 sockets BindIPv6Only=ipv6-only ListenStream=0.0.0.0:143 ListenStream=[::]:143 ListenStream=0.0.0.0:993 ListenStream=[::]:993 KeepAlive=true [Install] WantedBy=sockets.target EOT
- サービスを有効化する
systemctl enable dovecot
- サービスが有効化されていることを確認する
systemctl list-unit-files --type service --no-pager | grep dovecot
- サービスファイルを作成する
- 設定ファイルを作成する
- サンプルファイルを使用する場合、コピーする
cp -R share/doc/dovecot/example-config/* conf/dovecot/
※元の内容は以下
## Dovecot configuration file # If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration # "doveconf -n" command gives a clean output of the changed settings. Use it # instead of copy&pasting files when posting to the Dovecot mailing list. # '#' character and everything after it is treated as comments. Extra spaces # and tabs are ignored. If you want to use either of these explicitly, put the # value inside quotes, eg.: key = "# char and trailing whitespace " # Default values are shown for each setting, it's not required to uncomment # those. These are exceptions to this though: No sections (e.g. namespace {}) # or plugin settings are added by default, they're listed only as examples. # Paths are also just examples with the real defaults being based on configure # options. The paths listed here are for configure --prefix=/usr # --sysconfdir=/etc --localstatedir=/var # Protocols we want to be serving. #protocols = imap pop3 lmtp # A comma separated list of IPs or hosts where to listen in for connections. # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces. # If you want to specify non-default ports or anything more complex, # edit conf.d/master.conf. #listen = *, :: # Base directory where to store runtime data. #base_dir = /var/run/dovecot/ # Name of this instance. In multi-instance setup doveadm and other commands # can use -i <instance_name> to select which instance is used (an alternative # to -c <config_path>). The instance name is also added to Dovecot processes # in ps output. #instance_name = dovecot # Greeting message for clients. #login_greeting = Dovecot ready. # Space separated list of trusted network ranges. Connections from these # IPs are allowed to override their IP addresses and ports (for logging and # for authentication checks). disable_plaintext_auth is also ignored for # these networks. Typically you'd specify your IMAP proxy servers here. #login_trusted_networks = # Sepace separated list of login access check sockets (e.g. tcpwrap) #login_access_sockets = # With proxy_maybe=yes if proxy destination matches any of these IPs, don't do # proxying. This isn't necessary normally, but may be useful if the destination # IP is e.g. a load balancer's IP. #auth_proxy_self = # Show more verbose process titles (in ps). Currently shows user name and # IP address. Useful for seeing who are actually using the IMAP processes # (eg. shared mailboxes or if same uid is used for multiple accounts). #verbose_proctitle = no # Should all processes be killed when Dovecot master process shuts down. # Setting this to "no" means that Dovecot can be upgraded without # forcing existing client connections to close (although that could also be # a problem if the upgrade is e.g. because of a security fix). #shutdown_clients = yes # If non-zero, run mail commands via this many connections to doveadm server, # instead of running them directly in the same process. #doveadm_worker_count = 0 # UNIX socket or host:port used for connecting to doveadm server #doveadm_socket_path = doveadm-server # Space separated list of environment variables that are preserved on Dovecot # startup and passed down to all of its child processes. You can also give # key=value pairs to always set specific settings. #import_environment = TZ ## ## Dictionary server settings ## # Dictionary can be used to store key=value lists. This is used by several # plugins. The dictionary can be accessed either directly or though a # dictionary server. The following dict block maps dictionary names to URIs # when the server is used. These can then be referenced using URIs in format # "proxy::<name>". dict { #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext } # Most of the actual configuration gets included below. The filenames are # first sorted by their ASCII value and parsed in that order. The 00-prefixes # in filenames are intended to make it easier to understand the ordering. !include conf.d/*.conf # A config file can also tried to be included without giving an error if # it's not found: !include_try local.conf
- 自作する場合
cat > $DOVECOT_HOME/conf/dovecot/dovecot.conf << EOT protocols = imap default_login_user = mda log_path = /usr/local/dovecot/log/log mail_location = maildir:/usr/local/data/mail/%u EOT
ログをsyslogではなくファイルに直接出力する設定を行ったので、出力先のディレクトリを作成する。
mkdir log
- 設定ファイルに誤りがないか確認する
問題があれば、”Error”が出力される
doveconf
- 設定ファイルに誤りがないか確認する
- サンプルファイルを使用する場合、コピーする
- ファイル所有者を変更する
chown -R dovecot:dovecot /usr/local/dovecot*
- Dovecotを起動する
systemctl start dovecot
- 稼働確認
doveadm process status
Dovecot設定
設定変更後、以下のコマンドで設定ファイルの妥当性確認を行うことができる。
doveconf設定の反映は次のコマンドで行う
doveadm reloador
$DOVECOT_HOME/sbin/dovecot reloador
systemctl reload dovecot
設定ファイルパス
$DOVECOT_HOME/conf/dovecot/dovecot.conf
記法
設定値
以下のように記述する。
<設定項目> = <値>=以降に更に=が含まれる場合があるが、これは全て<値>の文字列である。
設定値の欄において括弧の意味は以下。
- []
任意の値を選択するが、省略はできない - {}
任意の値を選択し、省略もできる - …
直前の変数値を複数個列挙して記述可能
セクション
特定の設定群では設定値が重複するため、その設定群をセクションとして切り出し、名前空間化することで設定を排他的にしている。
コメント
先頭に#を付けることでコメントアウト可能
# xxx = yyy
標準設定一覧
次のコマンドで確認可能
doveconf -d
# 2.2.33 (68b0a183e): /usr/local/dovecot-2.2.33/conf/dovecot/dovecot.conf # OS: Linux 3.10.0-514.el7.x86_64 x86_64 CentOS Linux release 7.3.1611 (Core) # NOTE: Send doveconf -n output instead when asking for help. auth_anonymous_username = anonymous auth_cache_negative_ttl = 1 hours auth_cache_size = 0 auth_cache_ttl = 1 hours auth_debug = no auth_debug_passwords = no auth_default_realm = auth_failure_delay = 2 secs auth_gssapi_hostname = auth_krb5_keytab = auth_master_user_separator = auth_mechanisms = plain auth_policy_hash_mech = sha256 auth_policy_hash_nonce = auth_policy_hash_truncate = 12 auth_policy_reject_on_fail = no auth_policy_request_attributes = login=%{orig_username} pwhash=%{hashed_password} remote=%{real_rip} device_id=%{client_id} protocol=%s auth_policy_server_api_header = auth_policy_server_timeout_msecs = 2000 auth_policy_server_url = auth_proxy_self = auth_realms = auth_socket_path = auth-userdb auth_ssl_require_client_cert = no auth_ssl_username_from_cert = no auth_stats = no auth_use_winbind = no auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@ auth_username_format = %Lu auth_username_translation = auth_verbose = no auth_verbose_passwords = no auth_winbind_helper_path = /usr/bin/ntlm_auth auth_worker_max_count = 30 base_dir = /usr/local/dovecot-2.2.33/var/run/dovecot config_cache_size = 1 M debug_log_path = default_client_limit = 1000 default_idle_kill = 1 mins default_internal_user = dovecot default_login_user = dovenull default_process_limit = 100 default_vsz_limit = 256 M deliver_log_format = msgid=%m: %$ dict_db_config = director_consistent_hashing = no director_doveadm_port = 0 director_flush_socket = director_mail_servers = director_servers = director_user_expire = 15 mins director_user_kick_delay = 2 secs director_username_hash = %Lu disable_plaintext_auth = yes dotlock_use_excl = yes doveadm_allowed_commands = doveadm_api_key = doveadm_http_rawlog_dir = doveadm_password = doveadm_port = 0 doveadm_socket_path = doveadm-server doveadm_username = doveadm doveadm_worker_count = 0 dsync_alt_char = _ dsync_commit_msgs_interval = 100 dsync_features = dsync_hashed_headers = Date Message-ID dsync_remote_cmd = ssh -l%{login} %{host} doveadm dsync-server -u%u -U first_valid_gid = 1 first_valid_uid = 500 haproxy_timeout = 3 secs haproxy_trusted_networks = hostname = imap_capability = imap_client_workarounds = imap_fetch_failure = disconnect-immediately imap_hibernate_timeout = 0 imap_id_log = imap_id_retain = no imap_id_send = name * imap_idle_notify_interval = 2 mins imap_logout_format = in=%i out=%o imap_max_line_length = 64 k imap_metadata = no imap_urlauth_host = imap_urlauth_logout_format = in=%i out=%o imap_urlauth_port = 143 imapc_cmd_timeout = 5 mins imapc_connection_retry_count = 1 imapc_connection_retry_interval = 1 secs imapc_features = imapc_host = imapc_list_prefix = imapc_master_user = imapc_max_idle_time = 29 mins imapc_max_line_length = 0 imapc_password = imapc_port = 143 imapc_rawlog_dir = imapc_sasl_mechanisms = imapc_ssl = no imapc_ssl_verify = yes imapc_user = import_environment = TZ CORE_OUTOFMEM CORE_ERROR info_log_path = instance_name = dovecot last_valid_gid = 0 last_valid_uid = 0 lda_mailbox_autocreate = no lda_mailbox_autosubscribe = no lda_original_recipient_header = libexec_dir = /usr/local/dovecot-2.2.33/libexec/dovecot listen = *, :: lmtp_address_translate = lmtp_hdr_delivery_address = final lmtp_proxy = no lmtp_rcpt_check_quota = no lmtp_save_to_detail_mailbox = no lmtp_user_concurrency_limit = 0 lock_method = fcntl log_path = syslog log_timestamp = "%b %d %H:%M:%S " login_access_sockets = login_greeting = Dovecot ready. login_log_format = %$: %s login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c session=<%{session}> login_plugin_dir = /usr/local/dovecot-2.2.33/lib/dovecot/login login_plugins = login_proxy_max_disconnect_delay = 0 login_source_ips = login_trusted_networks = mail_access_groups = mail_always_cache_fields = mail_attachment_dir = mail_attachment_fs = sis posix mail_attachment_hash = %{sha1} mail_attachment_min_size = 128 k mail_attribute_dict = mail_cache_fields = flags mail_cache_min_mail_count = 0 mail_chroot = mail_debug = no mail_fsync = optimized mail_full_filesystem_access = no mail_gid = mail_home = mail_location = mail_log_prefix = "%s(%u): " mail_max_keyword_length = 50 mail_max_lock_timeout = 0 mail_max_userip_connections = 10 mail_never_cache_fields = imap.envelope mail_nfs_index = no mail_nfs_storage = no mail_plugin_dir = /usr/local/dovecot-2.2.33/lib/dovecot mail_plugins = mail_prefetch_count = 0 mail_privileged_group = mail_save_crlf = no mail_server_admin = mail_server_comment = mail_shared_explicit_inbox = no mail_sort_max_read_count = 0 mail_temp_dir = /tmp mail_temp_scan_interval = 1 weeks mail_uid = mail_vsize_bg_after_count = 0 mailbox_idle_check_interval = 30 secs mailbox_list_index = no mailbox_list_index_include_inbox = no mailbox_list_index_very_dirty_syncs = no maildir_broken_filename_sizes = no maildir_copy_with_hardlinks = yes maildir_empty_new = no maildir_stat_dirs = no maildir_very_dirty_syncs = no master_user_separator = mbox_dirty_syncs = yes mbox_dotlock_change_timeout = 2 mins mbox_lazy_writes = yes mbox_lock_timeout = 5 mins mbox_md5 = apop3d mbox_min_index_size = 0 mbox_read_locks = fcntl mbox_very_dirty_syncs = no mbox_write_locks = dotlock fcntl mdbox_preallocate_space = no mdbox_purge_preserve_alt = no mdbox_rotate_interval = 0 mdbox_rotate_size = 2 M mmap_disable = no pop3_client_workarounds = pop3_delete_type = default pop3_deleted_flag = pop3_enable_last = no pop3_fast_size_lookups = no pop3_lock_session = no pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s pop3_no_flag_updates = no pop3_reuse_xuidl = no pop3_save_uidl = no pop3_uidl_duplicates = allow pop3_uidl_format = %08Xu%08Xv pop3c_features = pop3c_host = pop3c_master_user = pop3c_password = pop3c_port = 110 pop3c_quick_received_date = no pop3c_rawlog_dir = pop3c_ssl = no pop3c_ssl_verify = yes pop3c_user = %u postmaster_address = postmaster@%d protocols = imap pop3 lmtp quota_full_tempfail = no rawlog_dir = recipient_delimiter = + rejection_reason = Your message to <%t> was automatically rejected:%n%r rejection_subject = Rejected: %s replication_dsync_parameters = -d -N -l 30 -U replication_full_sync_interval = 1 days replication_max_conns = 10 replicator_host = replicator replicator_port = 0 sendmail_path = /usr/sbin/sendmail service aggregator { chroot = . client_limit = 0 drop_priv_before_exec = no executable = aggregator extra_groups = fifo_listener replication-notify-fifo { group = mode = 0600 user = } group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = unix_listener replication-notify { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service anvil { chroot = empty client_limit = 0 drop_priv_before_exec = no executable = anvil extra_groups = group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 1 protocol = service_count = 0 type = anvil unix_listener anvil-auth-penalty { group = mode = 0600 user = } unix_listener anvil { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service auth-worker { chroot = client_limit = 1 drop_priv_before_exec = no executable = auth -w extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 1 type = unix_listener auth-worker { group = mode = 0600 user = $default_internal_user } user = vsz_limit = 18446744073709551615 B } service auth { chroot = client_limit = 0 drop_priv_before_exec = no executable = auth extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener auth-client { group = mode = 0600 user = $default_internal_user } unix_listener auth-login { group = mode = 0600 user = $default_internal_user } unix_listener auth-master { group = mode = 0600 user = } unix_listener auth-userdb { group = mode = 0666 user = $default_internal_user } unix_listener login/login { group = mode = 0666 user = } unix_listener token-login/tokenlogin { group = mode = 0666 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service config { chroot = client_limit = 0 drop_priv_before_exec = no executable = config extra_groups = group = idle_kill = 4294967295 secs privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = config unix_listener config { group = mode = 0600 user = } user = vsz_limit = 18446744073709551615 B } service dict-async { chroot = client_limit = 0 drop_priv_before_exec = no executable = dict extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = unix_listener dict-async { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service dict { chroot = client_limit = 1 drop_priv_before_exec = no executable = dict extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = unix_listener dict { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service director { chroot = . client_limit = 0 drop_priv_before_exec = no executable = director extra_groups = fifo_listener login/proxy-notify { group = mode = 00 user = } group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener director-admin { group = mode = 0600 user = } unix_listener login/director { group = mode = 00 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service dns_client { chroot = client_limit = 1 drop_priv_before_exec = no executable = dns-client extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = unix_listener dns-client { group = mode = 0666 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service doveadm { chroot = client_limit = 1 drop_priv_before_exec = no executable = doveadm-server extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 1 type = unix_listener doveadm-server { group = mode = 0600 user = } user = vsz_limit = 18446744073709551615 B } service imap-hibernate { chroot = client_limit = 0 drop_priv_before_exec = no executable = imap-hibernate extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = imap service_count = 0 type = unix_listener imap-hibernate { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service imap-login { chroot = login client_limit = 0 drop_priv_before_exec = no executable = imap-login extra_groups = group = idle_kill = 0 inet_listener imap { address = haproxy = no port = 143 reuse_port = no ssl = no } inet_listener imaps { address = haproxy = no port = 993 reuse_port = no ssl = yes } privileged_group = process_limit = 0 process_min_avail = 0 protocol = imap service_count = 1 type = login user = $default_login_user vsz_limit = 18446744073709551615 B } service imap-urlauth-login { chroot = token-login client_limit = 0 drop_priv_before_exec = no executable = imap-urlauth-login extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = imap service_count = 1 type = login unix_listener imap-urlauth { group = mode = 0666 user = } user = $default_login_user vsz_limit = 18446744073709551615 B } service imap-urlauth-worker { chroot = client_limit = 1 drop_priv_before_exec = no executable = imap-urlauth-worker extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1024 process_min_avail = 0 protocol = imap service_count = 1 type = unix_listener imap-urlauth-worker { group = mode = 0600 user = $default_internal_user } user = vsz_limit = 18446744073709551615 B } service imap-urlauth { chroot = client_limit = 1 drop_priv_before_exec = no executable = imap-urlauth extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1024 process_min_avail = 0 protocol = imap service_count = 1 type = unix_listener token-login/imap-urlauth { group = mode = 0666 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service imap { chroot = client_limit = 1 drop_priv_before_exec = no executable = imap extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1024 process_min_avail = 0 protocol = imap service_count = 1 type = unix_listener imap-master { group = mode = 0600 user = } unix_listener login/imap { group = mode = 0666 user = } user = vsz_limit = 18446744073709551615 B } service indexer-worker { chroot = client_limit = 1 drop_priv_before_exec = no executable = indexer-worker extra_groups = group = idle_kill = 0 privileged_group = process_limit = 10 process_min_avail = 0 protocol = service_count = 0 type = unix_listener indexer-worker { group = mode = 0600 user = $default_internal_user } user = vsz_limit = 18446744073709551615 B } service indexer { chroot = client_limit = 0 drop_priv_before_exec = no executable = indexer extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener indexer { group = mode = 0666 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } service ipc { chroot = empty client_limit = 0 drop_priv_before_exec = no executable = ipc extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener ipc { group = mode = 0600 user = } unix_listener login/ipc-proxy { group = mode = 0600 user = $default_login_user } user = $default_internal_user vsz_limit = 18446744073709551615 B } service lmtp { chroot = client_limit = 1 drop_priv_before_exec = no executable = lmtp extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = lmtp service_count = 0 type = unix_listener lmtp { group = mode = 0666 user = } user = vsz_limit = 18446744073709551615 B } service log { chroot = client_limit = 0 drop_priv_before_exec = no executable = log extra_groups = group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = log unix_listener log-errors { group = mode = 0600 user = } user = vsz_limit = 18446744073709551615 B } service pop3-login { chroot = login client_limit = 0 drop_priv_before_exec = no executable = pop3-login extra_groups = group = idle_kill = 0 inet_listener pop3 { address = haproxy = no port = 110 reuse_port = no ssl = no } inet_listener pop3s { address = haproxy = no port = 995 reuse_port = no ssl = yes } privileged_group = process_limit = 0 process_min_avail = 0 protocol = pop3 service_count = 1 type = login user = $default_login_user vsz_limit = 18446744073709551615 B } service pop3 { chroot = client_limit = 1 drop_priv_before_exec = no executable = pop3 extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1024 process_min_avail = 0 protocol = pop3 service_count = 1 type = unix_listener login/pop3 { group = mode = 0666 user = } user = vsz_limit = 18446744073709551615 B } service replicator { chroot = client_limit = 0 drop_priv_before_exec = no executable = replicator extra_groups = group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener replicator-doveadm { group = mode = 00 user = $default_internal_user } unix_listener replicator { group = mode = 0600 user = $default_internal_user } user = vsz_limit = 18446744073709551615 B } service ssl-params { chroot = client_limit = 0 drop_priv_before_exec = no executable = ssl-params extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = startup unix_listener login/ssl-params { group = mode = 0666 user = } unix_listener ssl-params { group = mode = 0666 user = } user = vsz_limit = 18446744073709551615 B } service stats { chroot = empty client_limit = 0 drop_priv_before_exec = no executable = stats extra_groups = fifo_listener stats-mail { group = mode = 0600 user = } fifo_listener stats-user { group = mode = 0600 user = } group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener stats { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B } shutdown_clients = yes ssl = yes ssl_alt_cert = ssl_alt_key = ssl_ca = ssl_cert = ssl_cert_username_field = commonName ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL ssl_client_ca_dir = ssl_client_ca_file = ssl_client_cert = ssl_client_key = ssl_crypto_device = ssl_dh_parameters_length = 1024 ssl_key = ssl_key_password = ssl_options = ssl_parameters_regenerate = 0 ssl_prefer_server_ciphers = no ssl_protocols = !SSLv3 ssl_require_crl = yes ssl_verify_client_cert = no state_dir = /usr/local/dovecot-2.2.33/var/lib/dovecot stats_carbon_interval = 30 secs stats_carbon_name = stats_carbon_server = stats_command_min_time = 1 mins stats_domain_min_time = 12 hours stats_ip_min_time = 12 hours stats_memory_limit = 16 M stats_session_min_time = 15 mins stats_user_min_time = 1 hours submission_host = syslog_facility = mail valid_chroot_dirs = verbose_proctitle = no verbose_ssl = no version_ignore = no
パラメータ
基本設定
パス
base_dir
実行時データの格納場所
- 設定値
base_dir = <パス>
- デフォルト
base_dir = <インストールパス>/var/run/dovecot
libexec_dir
内部で使用される実行可能ファイル群のパス
- 設定値
libexec_dir = <パス>
- デフォルト
libexec_dir = <パラメータ"base_dir">/libexec/dovecot
valid_chroot_dirs
chroot可能なパスのリスト
- 設定値
valid_chroot_dirs = {<パス>}{:<パス>}
- デフォルト
valid_chroot_dirs =
ネットワーク
listen
受け入れ可能なインタフェースのIPアドレス
- 設定値
listen = [ <IPアドレス> | * | :: ] {, ...}
- *
IPv4アドレスすべて - ::
IPv6アドレスすべて
- *
- デフォルト
listen = *, ::
protocols
サーバで受付可能なプロトコル
- 設定値
protocols = [ none | imap | imaps | pop3 | pop3s | lmtp | sieve ]
- デフォルト
protocols = imap pop3 lmtp
disable_plaintext_auth
平文で認証情報をやり取りすることを禁止するかどうか。
SSL/TLSを使用するか、ローカル通信のみしか行わないのでない限り許可すべきではない。
- 設定値
disable_plaintext_auth = [ yes | no ]
- デフォルト
disable_plaintext_auth = yes
ユーザ
first_valid_gid
Dovecotで使用可能なユーザのグループIDの有効範囲の最小値を指定する。
- 設定値
first_valid_gid = <GID>
- デフォルト
first_valid_gid = 1
first_valid_uid
Dovecotで使用可能なユーザIDの有効範囲の最小値を指定する。
- 設定値
first_valid_uid = <UID>
- デフォルト
first_valid_uid = 500
last_valid_gid
Dovecotで使用可能なユーザのグループIDの有効範囲の最大値を指定する。
- 設定値
last_valid_gid = <GID>
- デフォルト
last_valid_gid = 0
last_valid_uid
Dovecotで使用可能なユーザIDの有効範囲の最大値を指定する。
- 設定値
last_valid_uid = <UID>
- デフォルト
last_valid_uid = 0
ログ
Dovecotは次の4レベルのログを出力する。
- info: Informational and debug messages.
- warning: Warnings that don’t cause an actual error, but are useful to know about.
- err: Non-fatal errors.
- crit: Fatal errors that cause the process to die.
log_path
ログの出力先ファイルのパスを指定する。
指定するのはディレクトリでなく、ファイルのパスであることに注意する。
- 設定値
log_path = { syslog | <パス> }
syslogを指定した場合、syslogに出力されるが、<パス>を指定した場合、syslogには出力されない。
指定しない場合は、ログが出力されない。
<パス>を指定する場合は絶対パスでファイルを指定しなければならない。
相対パス、ディレクトリではエラーが発生する。
また、保存先のファイルが置かれるディレクトリは事前に作成されていなければならない。
- デフォルト
log_path = syslog
info_log_path
INFOレベルのみ、ログの出力先を指定する。
指定しない場合、他のログと同じパスに出力される。
- 設定値
info_log_path = { <パス> }
- デフォルト
info_log_path =
debug_log_path
DEBUGレベルのログの出力先を指定する。
- 設定値
debug_log_path = { <パス> }
- デフォルト
debug_log_path =
log_timestamp
- 設定値
log_timestamp = "%b %d %H:%M:%S "
- デフォルト
log_timestamp = "%b %d %H:%M:%S "
deliver_log_format
- 設定値
deliver_log_format = msgid=%m: %$
- デフォルト
deliver_log_format = msgid=%m: %$
rawlog_dir
Dovecotが行った通信のパケットキャプチャを取得して保存するパス。
- 設定値
rawlog_dir = <パス>
- デフォルト
rawlog_dir =
syslog_facility
syslogのファシリティを指定する。
- 設定値
syslog_facility = <syslogファシリティ>
- デフォルト
syslog_facility = mail
その他
shutdown_clients
Dovecotのマスタープロセスを終了させた際に通信中の子プロセスも強制的に終了させるかどうか。
- 設定値
shutdown_clients = [ yes | no ]
- デフォルト
shutdown_clients = yes
verbose_proctitle
psコマンドでプロセスを表示する際に詳細表示を行うかどうか。
詳細表示を行う場合、ユーザ名とIPアドレスを表示する。
- 設定値
verbose_proctitle = [ yes | no ]
- デフォルト
verbose_proctitle = no
import_environment
Dovecotに渡される環境変数のリスト。
- 設定値
import_environment = { <環境変数> } { ...}
- デフォルト
import_environment = TZ CORE_OUTOFMEM CORE_ERROR
instance_name
インスタンス名を指定する。
マルチインスタンスで使用する場合にインスタンス名を使用する。
- 設定値
instance_name = <インスタンス名>
- デフォルト
instance_name = dovecot
version_ignore
Dovecotのメインプログラムとその他のサププログラムのバージョンが不一致の際に無視してエラーとしないかどうか。
- 設定値
version_ignore = [ yes | no ]
- デフォルト
version_ignore = no
!include
指定したパスに設定ファイルを読み込む。
存在しない場合はエラーになる。
- 設定値
!include <パス>
アスタリスク”*”はワイルドカードとして扱われる。
相対パスを指定した場合、Dovecotの設定ファイル(dovecot.conf)のあるパスからの相対パスとなる。
- デフォルト
なし
!include_try
指定したパスに設定ファイルが存在すれば読み込む。
存在しなくてもエラーにならない。
- 設定値
!include_try <パス>
アスタリスク”*”はワイルドカードとして扱われる。
相対パスを指定した場合、Dovecotの設定ファイル(dovecot.conf)のあるパスからの相対パスとなる。
- デフォルト
なし
認証
auth_anonymous_username
- 設定値
auth_anonymous_username = anonymous
- デフォルト
auth_anonymous_username = anonymous
auth_cache_negative_ttl
- 設定値
auth_cache_negative_ttl = 1 hours
- デフォルト
auth_cache_negative_ttl = 1 hours
auth_cache_size
- 設定値
auth_cache_size = 0
- デフォルト
auth_cache_size = 0
auth_cache_ttl
- 設定値
auth_cache_ttl = 1 hours
- デフォルト
auth_cache_ttl = 1 hours
auth_debug
認証時のログを出力するかどうかを指定する。
- 設定値
auth_debug = [ yes | no ]
- デフォルト
auth_debug = no
auth_debug_passwords
ログに認証時に指定されたパスワードを書き出すかどうかを指定する。
- 設定値
auth_debug_passwords = [ yes | no ]
- デフォルト
auth_debug_passwords = no
auth_default_realm
ドメイン名が空の認証要求の際に使用するデフォルトのドメイン名
- 設定値
auth_default_realm = <ドメイン名>
- デフォルト
auth_default_realm =
auth_failure_delay
- 設定値
auth_failure_delay = 2 secs
- デフォルト
auth_failure_delay = 2 secs
auth_gssapi_hostname
- 設定値
auth_gssapi_hostname =
- デフォルト
auth_gssapi_hostname =
auth_krb5_keytab
- 設定値
auth_krb5_keytab =
- デフォルト
auth_krb5_keytab =
auth_master_user_separator
masterユーザとしてログイン可能にしたい場合、通常のユーザ名とmasterユーザ名を結合して記載できる。
その際の分割点となる文字を指定する。
この場合、<username><separator><master username>の並びとなる。
設定する場合、アスタリスク”*”が推奨されている。
- 設定値
auth_master_user_separator =
- デフォルト
auth_master_user_separator =
auth_mechanisms
認証方式。
- 設定値
auth_mechanisms = [ plain | login | cram-md5 | digest-md5 | scram-sha-1 | apop | ntlm | gss-spnego | gssapi | rpa | anonymous | otp | skey | external | oautbearer | xoauth2 ]{ ...}
- plain
暗号化されない平文でパスワードを送る - login
暗号化されない平文でパスワードを送る。
OutlookクライアントがSMTPサーバで認証する際に使用される方式。 - CRAM-MD5
Protects the password in transit against eavesdroppers. Somewhat good support in clients. - DIGEST-MD5
Somewhat stronger cryptographically than CRAM-MD5, but clients rarely support it. - SCRAM-SHA-1
Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms. Intended as DIGEST-MD5 replacement. - APOP
This is a POP3-specific authentication. Similar to CRAM-MD5, but requires storing password in plaintext. - NTLM
Mechanism created by Microsoft and supported by their clients.
Optionally supported using Samba’s winbind. - gss-spnego
A wrapper mechanism defined by RFC 4178. Can be accessed via either GSSAPI or Winbind.
デフォルトでは未対応。 - GSSAPI
Kerberos v5 support. - RPA
Compuserve RPA authentication mechanism. Similar to DIGEST-MD5, but client support is rare. - ANONYMOUS
Support for logging in anonymously. This may be useful if you’re intending to provide publicly accessible IMAP archive. - OTP
One time password mechanisms. - SKEY
One time password mechanisms.
パスワードデータベースを指定するとエラーになる。 - EXTERNAL
EXTERNAL SASL mechanism. - oautbearer
OAuth2 bearer authentication https://tools.ietf.org/html/rfc7628. See OAuth2 password database (v2.2.29+)
デフォルトでは未対応。 - XOAUTH2
Google flavor OAUTHBEARER (v2.2.29+)
- plain
- デフォルト
auth_mechanisms = plain
auth_policy_hash_mech
- 設定値
auth_policy_hash_mech = sha256
- デフォルト
auth_policy_hash_mech = sha256
auth_policy_hash_nonce
- 設定値
auth_policy_hash_nonce =
- デフォルト
auth_policy_hash_nonce =
auth_policy_hash_truncate
- 設定値
auth_policy_hash_truncate = 12
- デフォルト
auth_policy_hash_truncate = 12
auth_policy_reject_on_fail
- 設定値
auth_policy_reject_on_fail = [ yes | no ]
- デフォルト
auth_policy_reject_on_fail = no
auth_policy_request_attributes
- 設定値
auth_policy_request_attributes = login=%{orig_username} pwhash=%{hashed_password} remote=%{real_rip} device_id=%{client_id} protocol=%s
- デフォルト
auth_policy_request_attributes = login=%{orig_username} pwhash=%{hashed_password} remote=%{real_rip} device_id=%{client_id} protocol=%s
auth_policy_server_api_header
- 設定値
auth_policy_server_api_header =
- デフォルト
auth_policy_server_api_header =
auth_policy_server_timeout_msecs
- 設定値
auth_policy_server_timeout_msecs = 2000
- デフォルト
auth_policy_server_timeout_msecs = 2000
auth_policy_server_url
- 設定値
auth_policy_server_url =
- デフォルト
auth_policy_server_url =
auth_proxy_self
- 設定値
auth_proxy_self =
- デフォルト
auth_proxy_self =
auth_realms
パラメータ”auth_mechanisms”を”DIGEST-MD5″に設定して認証を行う場合に、許容するドメインのリスト。
- 設定値
auth_realms = {ドメイン名} {...}
空の場合、ドメイン制限を行わない。
- デフォルト
auth_realms =
auth_socket_path
DovecotでLDA(ローカルメール配信)を行う場合に使用する認証用のUNIXソケットのパス。
パラメータ”base_dir”からの相対パスで記述する。
- 設定値
auth_socket_path = <パス>
- デフォルト
auth_socket_path = auth-userdb
auth_ssl_require_client_cert
- 設定値
auth_ssl_require_client_cert = [ yes | no ]
- デフォルト
auth_ssl_require_client_cert = no
auth_ssl_username_from_cert
- 設定値
auth_ssl_username_from_cert = [ yes | no ]
- デフォルト
auth_ssl_username_from_cert = no
auth_stats
- 設定値
auth_stats = [ yes | no ]
- デフォルト
auth_stats = no
auth_use_winbind
- 設定値
auth_use_winbind = [ yes | no ]
- デフォルト
auth_use_winbind = no
auth_username_chars
- 設定値
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
- デフォルト
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
auth_username_format
- 設定値
auth_username_format = %Lu
- デフォルト
auth_username_format = %Lu
auth_username_translation
- 設定値
auth_username_translation =
- デフォルト
auth_username_translation =
auth_verbose
- 設定値
auth_verbose = [ yes | no ]
- デフォルト
auth_verbose = no
auth_verbose_passwords
- 設定値
auth_verbose_passwords = [ yes | no ]
- デフォルト
auth_verbose_passwords = no
auth_winbind_helper_path
- 設定値
auth_winbind_helper_path = /usr/bin/ntlm_auth
- デフォルト
auth_winbind_helper_path = /usr/bin/ntlm_auth
auth_worker_max_count
- 設定値
auth_worker_max_count = 30
- デフォルト
auth_worker_max_count = 30
passdbセクション
- 設定値
passdb { }
共通設定
driver
パスワードデータベースの方式。
- 設定値
driver = { pam | shadow | passwd-file | ldap | sql | dict | checkpassword | static }
- pam
OS上の実際のユーザ設定により認証を行う。
標準ではサポートしていない。
参考:https://wiki.dovecot.org/PasswordDatabase/PAM - shadow
OSのshadowファイルを参照して認証を行う。
pamに設定した場合と大抵の場合同じである。
参考:https://wiki.dovecot.org/PasswordDatabase/Shadow - passwd-file
/etc/passwd形式のテキストファイルをデータベースとして使用する。
参考:https://wiki2.dovecot.org/AuthDatabase/PasswdFile
パラメータ”args”に、ファイルパスを絶対パスで指定する。
また、パスワードの暗号方式のデフォルトを指定しても良い。指定しない場合、CRYPTが設定される。パスワードファイル中で各パスワードに個別で指定することもできる。
args = [scheme=<パスワード暗号スキーム> ]<パス>
具体的な形式としては下記のとおりである。
user:password:~
実際のpasswdファイルにはある、shell等の不要フィールドは無視されるので、passwdファイルをコピーし、パスワード部分のみ変更することで使用可能である。
ユーザ名、パスワード、uidは必要である。
また、/etc/shadowファイルをコピーすれば、パスワードもそのままで使用できるが、この場合は、pamと同じになる。
パスワード書式は次の通り。
{SCHEME}password
参考:https://wiki.dovecot.org/Authentication/PasswordSchemes
“password”部分にはパスワードとなる文字列を記載する。
SCHEMEには以下のハッシュアルゴリズムが指定可能である。
“{SCHEME}”部分は省略可能である。
- BLF-CRYPT
Blowfishを使用する。
パスワード文字列の先頭に”$2a$”を付ける。
Blowfishは最も安全であるが、大抵の環境では使用できない。 - SHA512-CRYPT
SHA512を使用する。
パスワード文字列の先頭に”$6$”を付ける。 - SHA256-CRYPT
SHA256を使用する。
パスワード文字列の先頭に”$5$”を付ける。 - MD5-CRYPT
MD5を使用する。
パスワード文字列の先頭に”$1$”を付ける。
最も脆弱なハッシュアルゴリズムである。 - PLAIN
平文で記載する。 - CRYPT
デフォルトのスキームである。
/etc/passwdで以前用いられていたDES暗号化方式を使用する。
- BLF-CRYPT
- ldap
Lightweight Directory Access Protocol.
参考:https://wiki.dovecot.org/AuthDatabase/LDAP - sql
SQL database (PostgreSQL, MySQL, SQLite).
参考:https://wiki.dovecot.org/AuthDatabase/SQL - dict
Dict key-value database (Redis, memcached, etc.)
参考:https://wiki.dovecot.org/AuthDatabase/Dict - checkpassword
External checkpassword program when used with Dovecot extensions.
参考:https://wiki.dovecot.org/AuthDatabase/CheckPassword - static
テスト用の設定で、設定ファイルに直接全ユーザ共通パスワードを記述する。
参考:https://wiki.dovecot.org/PasswordDatabase/Static
次のいずれかの値をパラメータ”args”にて定義する。
- password
設定した値は全てのユーザの共通したパスワードとなる。
args = password=<パスワード>
- nopassword
全てのユーザはパスワード無しでログインできる。
args = nopassword=y
- password
args
Arguments for the passdb backend. The format of this value depends on the passdb driver. Each one uses different args.
- 設定値
default_fields
Passdb fields (and extra fields) that are used, unless overwritten by the passdb backend. They are in format key=value key2=value2 …. The values can contain %variables.
- 設定値
override_fields
Same as default_fields, but instead of providing the default values, these values override what the passdb backend returned.
- 設定値
auth_verbose
If this is explicitly set to yes or no, it overrides the global auth_verbose setting. (However, auth_debug=yes overrides the auth_verbose setting.) (v2.2.24+)
- 設定値
result_success
What to do if the authentication succeeded (default: return-ok)
- 設定値
- return-ok
Return success, don’t continue to the next passdb. - return-fail
Return failure, don’t continue to the next passdb. - return
Return earlier passdb’s success or failure, don’t continue to the next passdb. If this was the first passdb, return failure. - continue-ok
Set the current authentication state to success, and continue to the next passdb. The following passdbs will skip password verification. - continue-fail
Set the current authentication state to failure, and continue to the next passdb. The following passdbs will still verify the password. - continue
Continue to the next passdb without changing the authentication state. The initial state is failure. If this was set in result_success, the following passdbs will skip password verification.
result_failure
What to do if authentication failed (default: continue)
- 設定値
result_internalfail
What to do if the passdb lookup had an internal failure (default: continue). If any of the passdbs had an internal failure and the final passdb also returns “continue”, the authentication will fail with “internal error”. WARNING: If multiple passdbs are required (results are merged), it’s important to set result_internalfail=return-fail to them, otherwise the authentication could still succeed but not all the intended extra fields are set.
- 設定値
DB固有設定
設定したパラメータ”driver”で使用する場合のみ設定をすることができる。
deny
If “yes”, used to provide “denied users database”. If the user is found from the passdb, the authentication will fail.
- 設定値
master
If “yes”, used to provide master users database. The users listed in the master passdb can log in as other users.
- 設定値
pass: This is an alias for result_success = continue as described below. This was commonly used together with master passdb to specify that even after a successful master user authentication, the authentication should continue to the actual non-master passdb to lookup the user.
skip
Do we sometimes want to skip over this passdb?
- 設定値
never
authenticated: Skip if an earlier passdb already authenticated the user successfully.
unauthenticated: Skip if user hasn’t yet been successfully authenticated by the previous passdbs.
mechanisms
Skip, if non-empty and the current auth mechanism is not listed here. Space or comma-separated list of auth mechanisms (e.g. “PLAIN LOGIN”). Also “none” can be used to match for a non-authenticating passdb lookup. (v2.2.30+)
- 設定値
username_filter
Skip, if non-empty and the username doesn’t match the filter. This is mainly used to assign specific passdbs to specific domains. Space or comma-separated list of username filters that can have “*” or “?” wildcards. If any of the filters matches, the filter succeeds. However, there can also be negative matches preceded by “!”. If any of the negative filters matches, the filter won’t succeed. For example if the filter is “*@example.com *@example2.com !user@example.com”, “any@example.com” or “user@example2.com” matches but “user@example.com” won’t match. (v2.2.30+)
- 設定値
userdbセクション
共通設定
driver
ユーザデータベースの方式。
- Passwd
/etc/passwdファイルを参照する。
- Passwd-file
/etc/passwdファイルと同じ形式の任意のファイルを参照する。
パラメータ”args”でファイルパスと任意でファイル中のユーザ名の記載形式を指定する。
具体的には次の書式になる。
args = {username_format=[%u|%n]} <パス>
- username_formatの値
- %u
ユーザ名部分の全ての文字がユーザ名として扱われる。
デフォルト。 - %n
メールアドレス形式(ユーザ名@ドメイン)で記載がある場合、ユーザ名(ローカルパート)部分をユーザ名として扱う。
- %u
- username_formatの値
- NSS
Name Service Switch
- LDAP
Lightweight Directory Access Protocol
- SQL
SQL database (PostgreSQL, MySQL, SQLite)
- Dict
Dict key-value database (Redis, memcached, etc.)
- Static
Userdb information generated from a given template
- VPopMail
External software used to handle virtual domains
- Prefetch
This assumes that the passdb already returned also all the required user database information
args
Arguments for the userdb backend. The format of this value depends on the userdb driver. Each one uses different args.
default_fields
Userdb fields (and extra fields) that are used, unless overwritten by the userdb backend. They are in format key=value key2=value2 …. The values can contain %variables.
override_fields
Same as default_fields, but instead of providing the default values, these values override what the userdb backend returned. For example useful with userdb passwd for overriding e.g. home directory or the uid/gid.
auth_verbose
If this is explicitly set to yes or no, it overrides the global auth_verbose setting. (However, auth_debug=yes overrides the auth_verbose setting.) (v2.2.24+)
Then we have the setting which specify when the userdb is used (v2.2.10+):
skip
既に別のuserdbセクションが設定されている場合、またはされていない場合に、このuserdbセクションを無効にするかどうかを設定する。
- 設定値
skip = [ never | found | notfound ]
- never
無効にしない - found
別のuserdbセクションがある場合、無効にする - notfound
別のuserdbセクションがない場合、無効にする
- never
And finally we can control what happens when we’re finished with this userdb (v2.2.10+):
result_success: What to do if the user was found from the userdb (default: return-ok) result_failure: What to do if the user wasn't found from the userdb (default: continue)
result_internalfail: What to do if the userdb lookup had an internal failure (default: continue). If any of the userdbs had an internal failure and the final userdb also returns "continue", the lookup will fail with "internal error". WARNING: If multiple userdbs are required (results are merged), it's important to set result_internalfail=return-fail to them, otherwise the userdb lookup could still succeed but not all the intended extra fields are set.
The result values that can be used:
return-ok: Return success, don't continue to the next userdb. return-fail: Return "user doesn't exist", don't continue to the next userdb. return: Return earlier userdb's success or failure, don't continue to the next userdb. If this was the first userdb, return "user doesn't exist". continue-ok: Set the current user existence state to "found", and continue to the next userdb. continue-fail: Set the current user existence state to "not found", and continue to the next userdb. continue: Continue to the next userdb without changing the user existence state. The initial state is "not found".
Director
DirectorとはIMAP、POP3、LMTPの各プロキシサーバで使用する機能で、IMAP、POP3等のMRAサーバが複数ある時、特定のユーザをいずれかのサーバに割り当てて接続転送ことができる。
director_consistent_hashing
- 設定値
director_consistent_hashing = [ yes | no ]
- デフォルト
director_consistent_hashing = no
director_doveadm_port
- 設定値
director_doveadm_port = 0
- デフォルト
director_doveadm_port = 0
director_flush_socket
- 設定値
director_flush_socket =
- デフォルト
director_flush_socket =
director_mail_servers
- 設定値
director_mail_servers =
- デフォルト
director_mail_servers =
director_servers
- 設定値
director_servers =
- デフォルト
director_servers =
director_user_expire
- 設定値
director_user_expire = 15 mins
- デフォルト
director_user_expire = 15 mins
director_user_kick_delay
- 設定値
director_user_kick_delay = 2 secs
- デフォルト
director_user_kick_delay = 2 secs
director_username_hash
- 設定値
director_username_hash = %Lu
- デフォルト
director_username_hash = %Lu
doveadmサーバ
DoveadmサーバとはDovecotによるMRAサーバとDirectorサーバの両方を起動させるモードのことである。
doveadm_allowed_commands
- 設定値
doveadm_allowed_commands =
- デフォルト
doveadm_allowed_commands =
doveadm_api_key
- 設定値
doveadm_api_key =
- デフォルト
doveadm_api_key =
doveadm_http_rawlog_dir
- 設定値
doveadm_http_rawlog_dir =
- デフォルト
doveadm_http_rawlog_dir =
doveadm_password
- 設定値
doveadm_password =
- デフォルト
doveadm_password =
doveadm_port
- 設定値
doveadm_port = 0
- デフォルト
doveadm_port = 0
doveadm_socket_path
doveadm serverのパス。UNIXソケットかホスト名(IPアドレス)を指定できる。
- 設定値
doveadm_socket_path = doveadm-server
- デフォルト
doveadm_socket_path = doveadm-server
doveadm_username
- 設定値
doveadm_username = doveadm
- デフォルト
doveadm_username = doveadm
doveadm_worker_count
doveadmサーバの1プロセス内でいくつの接続を扱うか(ワーカースレッド数)を指定する。
0を指定した場合、1プロセスで1アクセスを扱う。
- 設定値
doveadm_worker_count = 0
- デフォルト
doveadm_worker_count = 0
dsync
dsync_alt_char
- 設定値
dsync_alt_char = _
- デフォルト
dsync_alt_char = _
dsync_commit_msgs_interval
- 設定値
dsync_commit_msgs_interval = 100
- デフォルト
dsync_commit_msgs_interval = 100
dsync_features
- 設定値
dsync_features =
- デフォルト
dsync_features =
dsync_hashed_headers
- 設定値
dsync_hashed_headers = Date Message-ID
- デフォルト
dsync_hashed_headers = Date Message-ID
dsync_remote_cmd
- 設定値
dsync_remote_cmd = ssh -l%{login} %{host} doveadm dsync-server -u%u -U
- デフォルト
dsync_remote_cmd = ssh -l%{login} %{host} doveadm dsync-server -u%u -U
HAProxy
haproxy_timeout
- 設定値
haproxy_timeout = 3 secs
- デフォルト
haproxy_timeout = 3 secs
haproxy_trusted_networks
- 設定値
haproxy_trusted_networks =
- デフォルト
haproxy_trusted_networks =
IMAP
imap_capability
- 設定値
imap_capability =
- デフォルト
imap_capability =
imap_client_workarounds
- 設定値
imap_client_workarounds =
- デフォルト
imap_client_workarounds =
imap_fetch_failure
- 設定値
imap_fetch_failure = disconnect-immediately
- デフォルト
imap_fetch_failure = disconnect-immediately
imap_hibernate_timeout
- 設定値
imap_hibernate_timeout = 0
- デフォルト
imap_hibernate_timeout = 0
imap_id_log
- 設定値
imap_id_log =
- デフォルト
imap_id_log =
imap_id_retain
- 設定値
imap_id_retain = [ yes | no ]
- デフォルト
imap_id_retain = no
imap_id_send
- 設定値
imap_id_send = name *
- デフォルト
imap_id_send = name *
imap_idle_notify_interval
- 設定値
imap_idle_notify_interval = 2 mins
- デフォルト
imap_idle_notify_interval = 2 mins
imap_logout_format
- 設定値
imap_logout_format = in=%i out=%o
- デフォルト
imap_logout_format = in=%i out=%o
imap_max_line_length
- 設定値
imap_max_line_length = 64 k
- デフォルト
imap_max_line_length = 64 k
imap_metadata
- 設定値
imap_metadata = [ yes | no ]
- デフォルト
imap_metadata = no
imap_urlauth_host
- 設定値
imap_urlauth_host =
- デフォルト
imap_urlauth_host =
imap_urlauth_logout_format
- 設定値
imap_urlauth_logout_format = in=%i out=%o
- デフォルト
imap_urlauth_logout_format = in=%i out=%o
imap_urlauth_port
- 設定値
imap_urlauth_port = 143
- デフォルト
imap_urlauth_port = 143
imapc_cmd_timeout
- 設定値
imapc_cmd_timeout = 5 mins
- デフォルト
imapc_cmd_timeout = 5 mins
imapc_connection_retry_count
- 設定値
imapc_connection_retry_count = 1
- デフォルト
imapc_connection_retry_count = 1
imapc_connection_retry_interval
- 設定値
imapc_connection_retry_interval = 1 secs
- デフォルト
imapc_connection_retry_interval = 1 secs
imapc_features
- 設定値
imapc_features =
- デフォルト
imapc_features =
imapc_host
- 設定値
imapc_host =
- デフォルト
imapc_host =
imapc_list_prefix
- 設定値
imapc_list_prefix =
- デフォルト
imapc_list_prefix =
imapc_master_user
- 設定値
imapc_master_user =
- デフォルト
imapc_master_user =
imapc_max_idle_time
- 設定値
imapc_max_idle_time = 29 mins
- デフォルト
imapc_max_idle_time = 29 mins
imapc_max_line_length
- 設定値
imapc_max_line_length = 0
- デフォルト
imapc_max_line_length = 0
imapc_password
- 設定値
imapc_password =
- デフォルト
imapc_password =
imapc_port
- 設定値
imapc_port = 143
- デフォルト
imapc_port = 143
imapc_rawlog_dir
- 設定値
imapc_rawlog_dir =
- デフォルト
imapc_rawlog_dir =
imapc_sasl_mechanisms
- 設定値
imapc_sasl_mechanisms =
- デフォルト
imapc_sasl_mechanisms =
imapc_ssl
- 設定値
imapc_ssl = [ yes | no ]
- デフォルト
imapc_ssl = no
imapc_ssl_verify
- 設定値
imapc_ssl_verify = [ yes | no ]
- デフォルト
imapc_ssl_verify = yes
imapc_user
- 設定値
imapc_user =
- デフォルト
imapc_user =
LDA(Local Delivery Agent)
lda_mailbox_autocreate
- 設定値
lda_mailbox_autocreate = [ yes | no ]
- デフォルト
lda_mailbox_autocreate = no
lda_mailbox_autosubscribe
- 設定値
lda_mailbox_autosubscribe = [ yes | no ]
- デフォルト
lda_mailbox_autosubscribe = no
lda_original_recipient_header
- 設定値
lda_original_recipient_header =
- デフォルト
lda_original_recipient_header =
LMTP
lmtp_address_translate
- 設定値
lmtp_address_translate =
- デフォルト
lmtp_address_translate =
lmtp_hdr_delivery_address
- 設定値
lmtp_hdr_delivery_address = final
- デフォルト
lmtp_hdr_delivery_address = final
lmtp_proxy
- 設定値
lmtp_proxy = [ yes | no ]
- デフォルト
lmtp_proxy = no
lmtp_rcpt_check_quota
- 設定値
lmtp_rcpt_check_quota = [ yes | no ]
- デフォルト
lmtp_rcpt_check_quota = no
lmtp_save_to_detail_mailbox
- 設定値
lmtp_save_to_detail_mailbox = [ yes | no ]
- デフォルト
lmtp_save_to_detail_mailbox = no
lmtp_user_concurrency_limit
- 設定値
lmtp_user_concurrency_limit = 0
- デフォルト
lmtp_user_concurrency_limit = 0
ログイン時動作
login_access_sockets
ログイン時にアクセスのチェックを行う転送先ソケットを指定する。
標準のソースコードではtcpwrapperが使用可能であるが、with-libwrapオプションを有効にしてインストールしないと使用できない。
login_access_sockets =
- 設定値
login_access_sockets
- デフォルト
login_access_sockets
login_greeting
ログイン時に表示するグリーティングメッセージ
- 設定値
login_greeting = Dovecot ready.
- デフォルト
login_greeting = Dovecot ready.
login_log_format
- 設定値
login_log_format = %$: %s
- デフォルト
login_log_format = %$: %s
login_log_format_elements
- 設定値
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c session=<%{session}>
- デフォルト
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c session=<%{session}>
login_plugin_dir
- 設定値
login_plugin_dir = /usr/local/dovecot-2.2.33/lib/dovecot/login
- デフォルト
login_plugin_dir = /usr/local/dovecot-2.2.33/lib/dovecot/login
login_plugins
- 設定値
login_plugins =
- デフォルト
login_plugins =
login_proxy_max_disconnect_delay
- 設定値
login_proxy_max_disconnect_delay = 0
- デフォルト
login_proxy_max_disconnect_delay = 0
login_source_ips
- 設定値
login_source_ips =
- デフォルト
login_source_ips =
login_trusted_networks
サーバに接続可能なクライアントのIPアドレスとポート番号を指定する。
空白で区切って複数列挙可能。
- 設定値
login_trusted_networks =
- デフォルト
login_trusted_networks =
master_user_separator
masterユーザとしてログイン可能にしたい場合、通常のユーザ名とmasterユーザ名を結合して記載できる。
その際の分割点となる文字を指定する。
この場合、<username><separator><master username>の並びとなる。
- 設定値
master_user_separator = <分割文字>
- デフォルト
master_user_separator =
ストレージ・ファイル
config_cache_size
設定ファイルをキャッシュする最大サイズ。
- 設定値
config_cache_size = <サイズ> { K | M }
- デフォルト
config_cache_size = 1 M
dict_db_config
Berkeley DBの設定ファイルのパス。
Berkeley DBはExpire plugin(古いメールを自動削除する)で使用される。
- 設定値
dict_db_config = <パス>
- デフォルト
dict_db_config =
dotlock_use_excl
プログラム”dotlock”がディレクトリを作成するときに”O_EXCL”フラグを使用するかどうか。
使用しない場合は、ハードリンクファイルが作成される。
通常”O_EXCL”フラグを使用した方が動作が高速であるが、NFS上では動作しない。
dotlockとは他のメールソフトと共通で利用できる、ロック管理ソフトである。
メールをディスクに書き込む際に使用される。
- 設定値
dotlock_use_excl = [ yes | no ]
- デフォルト
dotlock_use_excl = yes
lock_method
メール保存ストレージにおいて使用するロック方法。
- 設定値
lock_method = [ fcntl | flock | dotlocks ]
- デフォルト
lock_method = fcntl
mmap_disable
mmapの使用を無効にする。
- 設定値
mmap_disable = [ yes | no ]
- デフォルト
mmap_disable = no
mail_access_groups
- 設定値
mail_access_groups =
- デフォルト
mail_access_groups =
mail_always_cache_fields
- 設定値
mail_always_cache_fields =
- デフォルト
mail_always_cache_fields =
mail_attachment_dir
- 設定値
mail_attachment_dir =
- デフォルト
mail_attachment_dir =
mail_attachment_fs
- 設定値
mail_attachment_fs = sis posix
- デフォルト
mail_attachment_fs = sis posix
mail_attachment_hash
- 設定値
mail_attachment_hash = %{sha1}
- デフォルト
mail_attachment_hash = %{sha1}
mail_attachment_min_size
- 設定値
mail_attachment_min_size = 128 k
- デフォルト
mail_attachment_min_size = 128 k
mail_attribute_dict
- 設定値
mail_attribute_dict =
- デフォルト
mail_attribute_dict =
mail_cache_fields
- 設定値
mail_cache_fields = flags
- デフォルト
mail_cache_fields = flags
mail_cache_min_mail_count
- 設定値
mail_cache_min_mail_count = 0
- デフォルト
mail_cache_min_mail_count = 0
mail_chroot
- 設定値
mail_chroot =
- デフォルト
mail_chroot =
mail_debug
- 設定値
mail_debug = [ yes | no ]
- デフォルト
mail_debug = no
mail_fsync
- 設定値
mail_fsync = optimized
- デフォルト
mail_fsync = optimized
mail_full_filesystem_access
- 設定値
mail_full_filesystem_access = [ yes | no ]
- デフォルト
mail_full_filesystem_access = no
mail_gid
- 設定値
mail_gid =
- デフォルト
mail_gid =
mail_home
ユーザ毎の情報を保存するディレクトリのパスを指定する。
パラメータ”mail_location”と同じではいけない。
- 設定値
mail_home = <パス>
絶対パスで記載する必要がある。
- デフォルト
mail_home =
mail_location
メールファイルの保存場所を指定する。
- 設定値
mail_location = <保存形態>:<パス>{:<key>=<value>}{:...}
- 変数
- %u
ログインしたユーザ名として扱われる。
- %u
- 保存形態
参考:https://wiki.dovecot.org/MailboxFormat
- mbox
従来のメール保存形式。
ファイルアクセスのタイミングによってはメッセージが破壊される。
複数のメッセージが1つのファイルに保存される。 - maildir
従来のメール保存形式。
1つのメッセージは1つのファイルに保存される。
mbox形式と違い、ファイルに安全にアクセスすることができる。 - sdbox
Dovecot独自のフォーマットで、高いパフォーマンスを発揮する。
1つのメッセージは1つのファイルに保存される。 - mdbox
multi-dbox, multiple messages per file
Dovecot独自のフォーマットで、高いパフォーマンスを発揮する。
複数のメッセージが1つのファイルに保存される。 - dbox
sdboxの別名である。 - cydir
Dovecot’s own simple and high performance Cyrus-like mailbox format. It should be mostly used for testing and benchmarking only. - imapc
Use remote IMAP server as mail storage. - pop3c
Use remote POP3 server as mail storage.
- mbox
- 空の場合の挙動
以下の設定がなされているものとして、上から順次ディレクトリを探索する。
発見した段階で探索は終了する。
- ~/mdbox/
- ~/sdbox/
- ~/Maildir/
- ~/mail/.imap/
- ~/mail/inbox
- ~/mail/mbox
- ~/Mail/.imap/
- ~/Mail/inbox
- ~/Mail/mbox
- 変数
- デフォルト
mail_location =
mail_log_prefix
- 設定値
mail_log_prefix = "%s(%u): "
- デフォルト
mail_log_prefix = "%s(%u): "
mail_max_keyword_length
- 設定値
mail_max_keyword_length = 50
- デフォルト
mail_max_keyword_length = 50
mail_max_lock_timeout
- 設定値
mail_max_lock_timeout = 0
- デフォルト
mail_max_lock_timeout = 0
mail_max_userip_connections
- 設定値
mail_max_userip_connections = 10
- デフォルト
mail_max_userip_connections = 10
mail_never_cache_fields
- 設定値
mail_never_cache_fields = imap.envelope
- デフォルト
mail_never_cache_fields = imap.envelope
mail_nfs_index
- 設定値
mail_nfs_index = [ yes | no ]
- デフォルト
mail_nfs_index = no
mail_nfs_storage
- 設定値
mail_nfs_storage = [ yes | no ]
- デフォルト
mail_nfs_storage = no
mail_plugin_dir
- 設定値
mail_plugin_dir = /usr/local/dovecot-2.2.33/lib/dovecot
- デフォルト
mail_plugin_dir = /usr/local/dovecot-2.2.33/lib/dovecot
mail_plugins
- 設定値
mail_plugins =
- デフォルト
mail_plugins =
mail_prefetch_count
- 設定値
mail_prefetch_count = 0
- デフォルト
mail_prefetch_count = 0
mail_privileged_group
- 設定値
mail_privileged_group =
- デフォルト
mail_privileged_group =
mail_save_crlf
- 設定値
mail_save_crlf = [ yes | no ]
- デフォルト
mail_save_crlf = no
mail_server_admin
- 設定値
mail_server_admin =
- デフォルト
mail_server_admin =
mail_server_comment
- 設定値
mail_server_comment =
- デフォルト
mail_server_comment =
- 設定値
mail_shared_explicit_inbox = [ yes | no ]
- デフォルト
mail_shared_explicit_inbox = no
mail_sort_max_read_count
- 設定値
mail_sort_max_read_count = 0
- デフォルト
mail_sort_max_read_count = 0
mail_temp_dir
- 設定値
mail_temp_dir = /tmp
- デフォルト
mail_temp_dir = /tmp
mail_temp_scan_interval
- 設定値
mail_temp_scan_interval = 1 weeks
- デフォルト
mail_temp_scan_interval = 1 weeks
mail_uid
- 設定値
mail_uid =
- デフォルト
mail_uid =
mail_vsize_bg_after_count
- 設定値
mail_vsize_bg_after_count = 0
- デフォルト
mail_vsize_bg_after_count = 0
mailbox_idle_check_interval
- 設定値
mailbox_idle_check_interval = 30 secs
- デフォルト
mailbox_idle_check_interval = 30 secs
mailbox_list_index
- 設定値
mailbox_list_index = [ yes | no ]
- デフォルト
mailbox_list_index = no
mailbox_list_index_include_inbox
- 設定値
mailbox_list_index_include_inbox = [ yes | no ]
- デフォルト
mailbox_list_index_include_inbox = no
mailbox_list_index_very_dirty_syncs
- 設定値
mailbox_list_index_very_dirty_syncs = [ yes | no ]
- デフォルト
mailbox_list_index_very_dirty_syncs = no
maildir_broken_filename_sizes
- 設定値
maildir_broken_filename_sizes = [ yes | no ]
- デフォルト
maildir_broken_filename_sizes = no
maildir_copy_with_hardlinks
- 設定値
maildir_copy_with_hardlinks = [ yes | no ]
- デフォルト
maildir_copy_with_hardlinks = yes
maildir_empty_new
- 設定値
maildir_empty_new = [ yes | no ]
- デフォルト
maildir_empty_new = no
maildir_stat_dirs
- 設定値
maildir_stat_dirs = [ yes | no ]
- デフォルト
maildir_stat_dirs = no
maildir_very_dirty_syncs
- 設定値
maildir_very_dirty_syncs = [ yes | no ]
- デフォルト
maildir_very_dirty_syncs = no
mbox_dirty_syncs
- 設定値
mbox_dirty_syncs = [ yes | no ]
- デフォルト
mbox_dirty_syncs = yes
mbox_dotlock_change_timeout
- 設定値
mbox_dotlock_change_timeout = 2 mins
- デフォルト
mbox_dotlock_change_timeout = 2 mins
mbox_lazy_writes
- 設定値
mbox_lazy_writes = [ yes | no ]
- デフォルト
mbox_lazy_writes = yes
mbox_lock_timeout
- 設定値
mbox_lock_timeout = 5 mins
- デフォルト
mbox_lock_timeout = 5 mins
mbox_md5
- 設定値
mbox_md5 = apop3d
- デフォルト
mbox_md5 = apop3d
mbox_min_index_size
- 設定値
mbox_min_index_size = 0
- デフォルト
mbox_min_index_size = 0
mbox_read_locks
- 設定値
mbox_read_locks = fcntl
- デフォルト
mbox_read_locks = fcntl
mbox_very_dirty_syncs
- 設定値
mbox_very_dirty_syncs = [ yes | no ]
- デフォルト
mbox_very_dirty_syncs = no
mbox_write_locks
- 設定値
mbox_write_locks = dotlock fcntl
- デフォルト
mbox_write_locks = dotlock fcntl
mdbox_preallocate_space
- 設定値
mdbox_preallocate_space = [ yes | no ]
- デフォルト
mdbox_preallocate_space = no
mdbox_purge_preserve_alt
- 設定値
mdbox_purge_preserve_alt = [ yes | no ]
- デフォルト
mdbox_purge_preserve_alt = no
mdbox_rotate_interval
- 設定値
mdbox_rotate_interval = 0
- デフォルト
mdbox_rotate_interval = 0
mdbox_rotate_size
- 設定値
mdbox_rotate_size = 2 M
- デフォルト
mdbox_rotate_size = 2 M
POP3
pop3_client_workarounds
- 設定値
pop3_client_workarounds =
- デフォルト
pop3_client_workarounds =
pop3_delete_type
- 設定値
pop3_delete_type = default
- デフォルト
pop3_delete_type = default
pop3_deleted_flag
- 設定値
pop3_deleted_flag =
- デフォルト
pop3_deleted_flag =
pop3_enable_last
- 設定値
pop3_enable_last = [ yes | no ]
- デフォルト
pop3_enable_last = no
pop3_fast_size_lookups
- 設定値
pop3_fast_size_lookups = [ yes | no ]
- デフォルト
pop3_fast_size_lookups = no
pop3_lock_session
- 設定値
pop3_lock_session = [ yes | no ]
- デフォルト
pop3_lock_session = no
pop3_logout_format
- 設定値
pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
- デフォルト
pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
pop3_no_flag_updates
- 設定値
pop3_no_flag_updates = [ yes | no ]
- デフォルト
pop3_no_flag_updates = no
pop3_reuse_xuidl
- 設定値
pop3_reuse_xuidl = [ yes | no ]
- デフォルト
pop3_reuse_xuidl = no
pop3_save_uidl
- 設定値
pop3_save_uidl = [ yes | no ]
- デフォルト
pop3_save_uidl = no
pop3_uidl_duplicates
- 設定値
pop3_uidl_duplicates = allow
- デフォルト
pop3_uidl_duplicates = allow
pop3_uidl_format
- 設定値
pop3_uidl_format = %08Xu%08Xv
- デフォルト
pop3_uidl_format = %08Xu%08Xv
pop3c_features
- 設定値
pop3c_features =
- デフォルト
pop3c_features =
pop3c_host
- 設定値
pop3c_host =
- デフォルト
pop3c_host =
pop3c_master_user
- 設定値
pop3c_master_user =
- デフォルト
pop3c_master_user =
pop3c_password
- 設定値
pop3c_password =
- デフォルト
pop3c_password =
pop3c_port
- 設定値
pop3c_port = 110
- デフォルト
pop3c_port = 110
pop3c_quick_received_date
- 設定値
pop3c_quick_received_date = [ yes | no ]
- デフォルト
pop3c_quick_received_date = no
pop3c_rawlog_dir
- 設定値
pop3c_rawlog_dir =
- デフォルト
pop3c_rawlog_dir =
pop3c_ssl
- 設定値
pop3c_ssl = [ yes | no ]
- デフォルト
pop3c_ssl = no
pop3c_ssl_verify
- 設定値
pop3c_ssl_verify = [ yes | no ]
- デフォルト
pop3c_ssl_verify = yes
pop3c_user
- 設定値
pop3c_user = %u
- デフォルト
pop3c_user = %u
レプリケーション
replication_dsync_parameters
- 設定値
replication_dsync_parameters = -d -N -l 30 -U
- デフォルト
replication_dsync_parameters = -d -N -l 30 -U
replication_full_sync_interval
- 設定値
replication_full_sync_interval = 1 days
- デフォルト
replication_full_sync_interval = 1 days
replication_max_conns
- 設定値
replication_max_conns = 10
- デフォルト
replication_max_conns = 10
replicator_host
- 設定値
replicator_host = replicator
- デフォルト
replicator_host = replicator
replicator_port
- 設定値
replicator_port = 0
- デフォルト
replicator_port = 0
serviceセクション
serviceとはDovecot内の実効モジュールで、libexec/dovecot/ディレクトリにそれぞれ1つの実行ファイルとして存在している。
- 設定値
service { }
デフォルトサービス
- anvil
- auth
- auth-worker
- config
- dict
- director
- dns_client
- doveadm
- imap, pop3, managesieve
- imap-login, pop3-login, managesieve-login
- indexer
- indexer-worker
- ipc
- lmtp
- log
- ssl-params
- stats
chroot
- 設定値
chroot =
client_limit
- 設定値
client_limit = 0
drop_priv_before_exec
- 設定値
drop_priv_before_exec = [ yes | no ]
executable
このサービスの実行ファイルのパスを指定する。
相対パスの場合、Dovecotインストールパスのlibexec/dovecot/を基点とする。
- 設定値
executable = <実行ファイルパス>
extra_groups
- 設定値
extra_groups =
group
- 設定値
group =
idle_kill
動作していないプロセスを強制終了するまでの時間。
- 設定値
idle_kill = 0
privileged_group
- 設定値
privileged_group =
process_limit
- 設定値
process_limit = 0
process_min_avail
利用可能なプロセスの最低数。
この数に満たない場合、新しいプロセスが生成され、その際動作していないプロセスがあれば強制終了される。
- 設定値
process_min_avail = 0
protocol
- 設定値
protocol =
service_count
- 設定値
service_count = 0
type
- 設定値
type =
unix_listener dict-asyncセクション
group
- 設定値
group =
mode
- 設定値
mode = 0600
user
- 設定値
user =
user
- 設定値
user = $default_internal_user
vsz_limit
- 設定値
vsz_limit = 18446744073709551615 B
デフォルトパラメータ
default_internal_user
パラメータ”type”の値が”login”以外の場合のパラメータ”user”のデフォルト値。
- 設定値
default_internal_user = <ユーザ名>
- デフォルト
default_internal_user = dovecot
default_login_user
パラメータ”type”の値が”login”の場合のパラメータ”user”のデフォルト値。
- 設定値
default_login_user = <ユーザ名>
- デフォルト
default_login_user = dovenull
default_client_limit
- 設定値
default_client_limit = 1000
- デフォルト
default_client_limit = 1000
default_idle_kill
動作していないプロセスを強制終了するまでのデフォルト時間。
各サービスセクションのパラメータ”idle_kill”の値で上書き可能。
各サービスセクションのパラメータ”process_min_avail”の値で規定したプロセス数に満たない場合、このパラメータで設定した時間に関係なく強制終了される。
- 設定値
default_idle_kill = 1 mins
- デフォルト
default_idle_kill = 1 mins
default_process_limit
- 設定値
default_process_limit = 100
- デフォルト
default_process_limit = 100
default_vsz_limit
- 設定値
default_vsz_limit = 256 M
- デフォルト
default_vsz_limit = 256 M
各デフォルト値
service aggregatorセクション
service aggregator { chroot = . client_limit = 0 drop_priv_before_exec = no executable = aggregator extra_groups = fifo_listener replication-notify-fifo { group = mode = 0600 user = } group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = unix_listener replication-notify { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service anvilセクション
service anvil { chroot = empty client_limit = 0 drop_priv_before_exec = no executable = anvil extra_groups = group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 1 protocol = service_count = 0 type = anvil unix_listener anvil-auth-penalty { group = mode = 0600 user = } unix_listener anvil { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service auth-workerセクション
service auth-worker { chroot = client_limit = 1 drop_priv_before_exec = no executable = auth -w extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 1 type = unix_listener auth-worker { group = mode = 0600 user = $default_internal_user } user = vsz_limit = 18446744073709551615 B }
service authセクション
service auth { chroot = client_limit = 0 drop_priv_before_exec = no executable = auth extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener auth-client { group = mode = 0600 user = $default_internal_user } unix_listener auth-login { group = mode = 0600 user = $default_internal_user } unix_listener auth-master { group = mode = 0600 user = } unix_listener auth-userdb { group = mode = 0666 user = $default_internal_user } unix_listener login/login { group = mode = 0666 user = } unix_listener token-login/tokenlogin { group = mode = 0666 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service configセクション
service config { chroot = client_limit = 0 drop_priv_before_exec = no executable = config extra_groups = group = idle_kill = 4294967295 secs privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = config unix_listener config { group = mode = 0600 user = } user = vsz_limit = 18446744073709551615 B }
service dict-asyncセクション
service dict-async { chroot = client_limit = 0 drop_priv_before_exec = no executable = dict extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = unix_listener dict-async { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service dictセクション
service dict { chroot = client_limit = 1 drop_priv_before_exec = no executable = dict extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = unix_listener dict { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service directorセクション
service director { chroot = . client_limit = 0 drop_priv_before_exec = no executable = director extra_groups = fifo_listener login/proxy-notify { group = mode = 00 user = } group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener director-admin { group = mode = 0600 user = } unix_listener login/director { group = mode = 00 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service dns_clientセクション
service dns_client { chroot = client_limit = 1 drop_priv_before_exec = no executable = dns-client extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = unix_listener dns-client { group = mode = 0666 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service doveadmセクション
service doveadm { chroot = client_limit = 1 drop_priv_before_exec = no executable = doveadm-server extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 1 type = unix_listener doveadm-server { group = mode = 0600 user = } user = vsz_limit = 18446744073709551615 B }
service imap-hibernateセクション
service imap-hibernate { chroot = client_limit = 0 drop_priv_before_exec = no executable = imap-hibernate extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = imap service_count = 0 type = unix_listener imap-hibernate { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service imap-loginセクション
service imap-login { chroot = login client_limit = 0 drop_priv_before_exec = no executable = imap-login extra_groups = group = idle_kill = 0 inet_listener imap { address = haproxy = no port = 143 reuse_port = no ssl = no } inet_listener imaps { address = haproxy = no port = 993 reuse_port = no ssl = yes } privileged_group = process_limit = 0 process_min_avail = 0 protocol = imap service_count = 1 type = login user = $default_login_user vsz_limit = 18446744073709551615 B }
service imap-urlauth-loginセクション
service imap-urlauth-login { chroot = token-login client_limit = 0 drop_priv_before_exec = no executable = imap-urlauth-login extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = imap service_count = 1 type = login unix_listener imap-urlauth { group = mode = 0666 user = } user = $default_login_user vsz_limit = 18446744073709551615 B }
service imap-urlauth-workerセクション
service imap-urlauth-worker { chroot = client_limit = 1 drop_priv_before_exec = no executable = imap-urlauth-worker extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1024 process_min_avail = 0 protocol = imap service_count = 1 type = unix_listener imap-urlauth-worker { group = mode = 0600 user = $default_internal_user } user = vsz_limit = 18446744073709551615 B }
service imap-urlauthセクション
service imap-urlauth { chroot = client_limit = 1 drop_priv_before_exec = no executable = imap-urlauth extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1024 process_min_avail = 0 protocol = imap service_count = 1 type = unix_listener token-login/imap-urlauth { group = mode = 0666 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service imapセクション
service imap { chroot = client_limit = 1 drop_priv_before_exec = no executable = imap extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1024 process_min_avail = 0 protocol = imap service_count = 1 type = unix_listener imap-master { group = mode = 0600 user = } unix_listener login/imap { group = mode = 0666 user = } user = vsz_limit = 18446744073709551615 B }
service indexer-workerセクション
service indexer-worker { chroot = client_limit = 1 drop_priv_before_exec = no executable = indexer-worker extra_groups = group = idle_kill = 0 privileged_group = process_limit = 10 process_min_avail = 0 protocol = service_count = 0 type = unix_listener indexer-worker { group = mode = 0600 user = $default_internal_user } user = vsz_limit = 18446744073709551615 B }
service indexerセクション
service indexer { chroot = client_limit = 0 drop_priv_before_exec = no executable = indexer extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener indexer { group = mode = 0666 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service ipcセクション
service ipc { chroot = empty client_limit = 0 drop_priv_before_exec = no executable = ipc extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener ipc { group = mode = 0600 user = } unix_listener login/ipc-proxy { group = mode = 0600 user = $default_login_user } user = $default_internal_user vsz_limit = 18446744073709551615 B }
service lmtpセクション
service lmtp { chroot = client_limit = 1 drop_priv_before_exec = no executable = lmtp extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = lmtp service_count = 0 type = unix_listener lmtp { group = mode = 0666 user = } user = vsz_limit = 18446744073709551615 B }
service logセクション
service log { chroot = client_limit = 0 drop_priv_before_exec = no executable = log extra_groups = group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = log unix_listener log-errors { group = mode = 0600 user = } user = vsz_limit = 18446744073709551615 B }
service pop3-loginセクション
service pop3-login { chroot = login client_limit = 0 drop_priv_before_exec = no executable = pop3-login extra_groups = group = idle_kill = 0 inet_listener pop3 { address = haproxy = no port = 110 reuse_port = no ssl = no } inet_listener pop3s { address = haproxy = no port = 995 reuse_port = no ssl = yes } privileged_group = process_limit = 0 process_min_avail = 0 protocol = pop3 service_count = 1 type = login user = $default_login_user vsz_limit = 18446744073709551615 B }
service pop3セクション
service pop3 { chroot = client_limit = 1 drop_priv_before_exec = no executable = pop3 extra_groups = group = idle_kill = 0 privileged_group = process_limit = 1024 process_min_avail = 0 protocol = pop3 service_count = 1 type = unix_listener login/pop3 { group = mode = 0666 user = } user = vsz_limit = 18446744073709551615 B }
service replicatorセクション
service replicator { chroot = client_limit = 0 drop_priv_before_exec = no executable = replicator extra_groups = group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener replicator-doveadm { group = mode = 00 user = $default_internal_user } unix_listener replicator { group = mode = 0600 user = $default_internal_user } user = vsz_limit = 18446744073709551615 B }
service ssl-paramsセクション
service ssl-params { chroot = client_limit = 0 drop_priv_before_exec = no executable = ssl-params extra_groups = group = idle_kill = 0 privileged_group = process_limit = 0 process_min_avail = 0 protocol = service_count = 0 type = startup unix_listener login/ssl-params { group = mode = 0666 user = } unix_listener ssl-params { group = mode = 0666 user = } user = vsz_limit = 18446744073709551615 B }
service statsセクション
service stats { chroot = empty client_limit = 0 drop_priv_before_exec = no executable = stats extra_groups = fifo_listener stats-mail { group = mode = 0600 user = } fifo_listener stats-user { group = mode = 0600 user = } group = idle_kill = 4294967295 secs privileged_group = process_limit = 1 process_min_avail = 0 protocol = service_count = 0 type = unix_listener stats { group = mode = 0600 user = } user = $default_internal_user vsz_limit = 18446744073709551615 B }
SSL
ssl
- 設定値
ssl = [ yes | no | required ]
- required
SSLを必須とする
- required
- デフォルト
ssl = yes
ファイル
ssl_key
鍵ファイルのパス。
値の前に”<“が必要なので注意。
- 設定値
ssl_key = {<<パス>}
- デフォルト
ssl_key =
ssl_key_password
SSL鍵ファイルにパスワードがかかっている場合、そのパスワードを指定する。
- 設定値
ssl_key_password = <パスワード>
- デフォルト
ssl_key_password =
ssl_ca
- 設定値
ssl_ca = <パス>
- デフォルト
ssl_ca =
ssl_cert
証明書ファイルのパス。
値の前に”<“が必要なので注意。
- 設定値
ssl_cert = {<<パス>}
- デフォルト
ssl_cert =
ssl_alt_cert
SSL証明書を複数使用する場合の代替証明書
- 設定値
ssl_alt_cert = <パス>
- デフォルト
ssl_alt_cert =
ssl_alt_key
- 設定値
ssl_alt_key = <パス>
- デフォルト
ssl_alt_key =
クライアント認証
ssl_client_ca_dir
- 設定値
ssl_client_ca_dir = <パス>
- デフォルト
ssl_client_ca_dir =
ssl_client_ca_file
- 設定値
ssl_client_ca_file = <パス>
- デフォルト
ssl_client_ca_file =
ssl_client_cert
- 設定値
ssl_client_cert = <パス>
- デフォルト
ssl_client_cert =
ssl_client_key
- 設定値
ssl_client_key = <パス>
- デフォルト
ssl_client_key =
その他
ssl_cert_username_field
- 設定値
ssl_cert_username_field = commonName
- デフォルト
ssl_cert_username_field = commonName
ssl_cipher_list
- 設定値
ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL
- デフォルト
ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL
ssl_crypto_device
- 設定値
ssl_crypto_device =
- デフォルト
ssl_crypto_device =
ssl_dh_parameters_length
- 設定値
ssl_dh_parameters_length = 1024
- デフォルト
ssl_dh_parameters_length = 1024
ssl_options
- 設定値
ssl_options =
- デフォルト
ssl_options =
ssl_parameters_regenerate
- 設定値
ssl_parameters_regenerate = 0
- デフォルト
ssl_parameters_regenerate = 0
ssl_prefer_server_ciphers
- 設定値
ssl_prefer_server_ciphers = [ yes | no ]
- デフォルト
ssl_prefer_server_ciphers = no
ssl_protocols
使用できるプロトコルを指定する。
もしくは使用できないプロトコルを指定する。
- 設定値
ssl_protocols = ({!}<プロトコル>) {, ...}
- デフォルト
ssl_protocols = !SSLv3
ssl_require_crl
- 設定値
ssl_require_crl = [ yes | no ]
- デフォルト
ssl_require_crl = yes
ssl_verify_client_cert
- 設定値
ssl_verify_client_cert = [ yes | no ]
- デフォルト
ssl_verify_client_cert = no
verbose_ssl
ログにSSL関係の情報を詳細出力するかどうか。
- 設定値
verbose_ssl = [ yes | no ]
- デフォルト
verbose_ssl = no
統計情報
state_dir
- 設定値
state_dir = /usr/local/dovecot-2.2.33/var/lib/dovecot
- デフォルト
state_dir = /usr/local/dovecot-2.2.33/var/lib/dovecot
stats_carbon_interval
- 設定値
stats_carbon_interval = 30 secs
- デフォルト
stats_carbon_interval = 30 secs
stats_carbon_name
- 設定値
stats_carbon_name =
- デフォルト
stats_carbon_name =
stats_carbon_server
- 設定値
stats_carbon_server =
- デフォルト
stats_carbon_server =
stats_command_min_time
- 設定値
stats_command_min_time = 1 mins
- デフォルト
stats_command_min_time = 1 mins
stats_domain_min_time
- 設定値
stats_domain_min_time = 12 hours
- デフォルト
stats_domain_min_time = 12 hours
stats_ip_min_time
- 設定値
stats_ip_min_time = 12 hours
- デフォルト
stats_ip_min_time = 12 hours
stats_memory_limit
- 設定値
stats_memory_limit = 16 M
- デフォルト
stats_memory_limit = 16 M
stats_session_min_time
- 設定値
stats_session_min_time = 15 mins
- デフォルト
stats_session_min_time = 15 mins
stats_user_min_time
- 設定値
stats_user_min_time = 1 hours
- デフォルト
stats_user_min_time = 1 hours
MDA(LDA : Local Delivery Agent)
- 参考:https://wiki.dovecot.org/LDA
hostname
メール送信時にMessage-Idに使用するドメイン名を指定する
- 設定値
hostname = { <FQDN> }
指定しない場合はサーバのホスト名になる。
- デフォルト
hostname =
postmaster_address
メール管理者のアドレス。
- 設定値
postmaster_address = <メールアドレス>
- %d
ドメイン名に置き換えられる
- %d
- デフォルト
postmaster_address = postmaster@%d
quota_full_tempfail
quota設定によるストレージ使用量上限を超えた場合、バウンスメールを返すのではなく、一時的に失敗しているという通知を返す。
- 設定値
quota_full_tempfail = [ yes | no ]
- デフォルト
quota_full_tempfail = no
recipient_delimiter
拡張メールアドレスの区切り文字
- 設定値
recipient_delimiter = <区切り文字>
- デフォルト
recipient_delimiter = +
rejection_reason
メールを受信拒否する際に返すエラーメッセージの内容。
- 設定値
rejection_reason = <エラーメッセージの内容>
- %t
受信者 - %n
改行 - %r
拒否理由 - %s
受信したメールの題名
- %t
- デフォルト
rejection_reason = Your message to <%t> was automatically rejected:%n%r
rejection_subject
メールを受信拒否する際に返すエラーメールの題名。
- 設定値
rejection_subject = <エラーメールの題名>
- %t
受信者 - %n
改行 - %r
拒否理由 - %s
受信したメールの題名
- %t
- デフォルト
rejection_subject = Rejected: %s
sendmail_path
sendmailのパス
- 設定値
sendmail_path = <パス>
- デフォルト
sendmail_path = /usr/sbin/sendmail
submission_host
メール送信の際、通常はsendmailコマンドにより通常のメール配送を行うが、この設定を行った場合指定したホストを経由してメール送信することができる。
- 設定値
submission_host = {<ホスト名>{:<ポート番号>}}
- デフォルト
submission_host =
dictセクション
プラグインで使用するためのパラメータをKey-Value形式で指定する。
ツール
doveadm
dsync
doveadmの別名
doveconf
オプション
全て表示
明示的に設定されている値とそうでないものはそのデフォルト値を表示する。
オプションを指定しない場合のデフォルトの動作でもある。
doveconf -aor
doveconf
デフォルト値の表示
全設定値のデフォルト値を表示する。
doveconf -d
変更した値の表示
デフォルト値から変更されている値を表示する。
doveconf -n
設定した値の表示
デフォルト値から変更されているかどうかに関わらず、明示的に設定した値を表示する。
doveconf -N
セクションを展開して表示
セクションを展開して表示する。
doveconf -S { -a | -d | -n | 等 }
特定のモジュールの値のみ表示
指定したモジュールに関連する値のみ表示
doveconf -m <モジュール名>
- モジュール
- imap
- imap-login
- lmtp
- pop3
- pop3-login
dovecot
sbinディレクトリに配置され、普段は使用しない。
systemdからサービスとして呼び出される。
トラブルシューティング
認証関連
passwd-file
User is missing UID
passdbにpasswd-fileを指定したが、ログインできない。
- 状況
IMAPで接続し、ログインを試みた。
telnet localhost 143 # プロンプト表示後 a login <ユーザ名> <パスワード>
- エラー内容
imap(<ユーザ名>): Error: Couldn't drop privileges: User is missing UID (see mail_uid setting) imap: Error: Internal error occurred. Refer to server log for more information.
- 解決策
userdbセクションを設定ファイルに記載していない。
もしくは記載していてもユーザID部分が不正か記載がない。
Tips
バーチャルメール
バーチャルメールボックス
Postfixのバーチャルメールボックスを使用している場合を想定する。
パスワードデータベースの作成
バーチャルメールボックスのユーザ情報は存在しないので、作成する必要がある。
vi $DOVECOT_HOME/conf/dovecot/userdbパスワードデータベースではユーザ名とパスワード情報のみ使用される。
その為、ユーザID、グループIDは不要だが、まとめて記載しておけば、ユーザデータベースと共用できる。
ユーザID、グループIDはメールスプールのメールファイルにアクセスする際に使用されるものである。全ユーザで共通で良い。
ここではmdaを使用する。uidとgidを確認する。
id mda書式は以下。パスワードは平文で記載する場合である。
<ユーザ名>:{plain}<パスワード>:<ユーザID>:<グループID>::
ユーザデータベースの作成
バーチャルメールボックスのユーザ情報は存在しないので、作成する必要がある。
vi $DOVECOT_HOME/conf/dovecot/userdbユーザデータベースではユーザ名とユーザID・グループID情報のみ使用される。
ユーザID、グループIDはメールスプールのメールファイルにアクセスする際に使用されるものである。全ユーザで共通で良い。
ここではmdaを使用する。uidとgidを確認する。
id mda書式は以下。パスワードは平文で記載する場合である。
<ユーザ名>:{plain}<パスワード>:<ユーザID>:<グループID>::
設定追加
以下はパスワードデータベースとユーザデータベースを共用にし、パスワードを平文で記載した場合である。
cat >> $DOVECOT_HOME/conf/dovecot/dovecot.conf << EOT passdb { driver = passwd-file args = /usr/local/dovecot/conf/dovecot/userdb mechanisms = PLAIN } userdb { driver = passwd-file args = /usr/local/dovecot/conf/dovecot/userdb } EOT設定完了後、設定を再読み込みする。
doveadm reload
認証確認
telnet localhost 143OR
openssl s_client -connect localhost:993 # プロンプト表示後 a login <ユーザ名> <パスワード> b list "" "*" c select INBOX d fetch 1 RFC822 e logout
SASL
Postfixにユーザ認証機能を提供する。
Dovecotの設定追加
UNIXソケットを作成し、それをPostfixが利用する。
TCP/IPを用いて別のサーバに提供することも可能。
UNIXソケットはPostfixのキューディレクトリ(queue_directory)配下に原則作成する。
基本的には次のパスに作成する。
$queue_directory/private/auth
service auth { unix_listener /usr/local/postfix/queue/private/auth { mode = 0666 user = postfix group = postfix } }
設定完了後、設定を再読み込みする。
doveadm reload
Postfixの設定追加
DovecotによるSASLに対応しているか確認する。
postconf -adovecotと表示されなかった場合はインストールしなおす必要がある。
次を”make makefiles”の実行前に実行しておくと、既存の環境に追加インストールできる。
make tidy“make makefiles”の実行時には次のオプションを付与する。
CCARGS='-DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\"dovecot\"' \設定ファイルに以下を追加する。
cat >> $POSTFIX_HOME/conf/main.cf << EOT smtpd_sasl_auth_enable = yes smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination EOT
設定完了後、設定を再読み込みする。
TLS
- 参考:https://wiki.dovecot.org/SSL/DovecotConfiguration
以下の設定を追加する。
パラメータ”ssl_key”と”ssl_cert”の値の前には”<“が必要なので注意する。
鍵ファイルにパスワードは不要なら設定は必要ない。
cat >> $DOVECOT_HOME/conf/dovecot/dovecot.conf << EOT ssl_key_password = <パスワード> ssl_protocols = !SSLv2 !SSLv3 ssl_key = <<鍵パス> ssl_cert = <<証明書パス> EOT
設定完了後、設定を再読み込みする。
doveadm reload postfix reload
認証確認
平文でログインする場合でもBase64エンコードを行う必要がある。
まずユーザ名とパスワードをBase64エンコードする。
ユーザ名は二度記載する。
printf "%s\0%s\0%s" <ユーザ名> <ユーザ名> <パスワード> | openssl base64 -e | sed "s/\\n//g"これを用いてtelnetでログインする。
telnet localhost 25 AUTH PLAIN <Base64ログイン情報> MAIL FROM:<from address> RCPT TO:<to address> DATA test mail . quit