Misc/メールサーバー構築 Ubuntuの場合
2017-06-14 (水) 06:49:17 (3140d)
Postfixセットアップ †インストールはUbuntuインストール時に指定 main.cf †# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
mail_owner = postfix
default_privs = nobody
unknown_local_recipient_reject_code = 550
home_mailbox = Maildir/
mail_spool_directory = /var/spool/mail
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = localhost.localdomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost
# DNSで作ったすべての名前を列挙
relayhost = xxx
# プロバイダのメールサーバー等のリレー先を書いておく
mynetworks = 127.0.0.0/8 xxx.xxx.x.x/24 [::ffff:127.0.0.0]/104 [::1]/128
# 自分のネットワーク名も付け加えておくことによりリレーできるようにする
# mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
OB25B対策のためには †http://tech.ckme.co.jp/mail.shtml OB25B対策が今後役に立つかも まだ実際には設定してないけれども… IMAP4サーバー構築 †慣れているのでcourier-imapにする。 sudo apt-get install courier-imap sudo apt-get install courier-imap-ssl courier-ssl ちなみに sslのまえは courier-imap 単独で入れたり remove したり… とくになにか影響はないと思うけれども over SSL のみ有効にしたいため sudo vi /etc/courier/imapd IMAPDSTART=NO としておく。パスワードをUNIXパスワードと別にするのはSSL化してるのでいいやという結論で。 SSL用のpemkey作り直し/サーバー名対応 †Ubuntuは CA.sh が最初から入っている。 /usr/lib/ssl/misc/CA.sh あとは Misc/SSL証明書 を参考。ちなみに demoCA/serial の中身は 01 (適時変更)しておく。そうしないとサーバー名/シリアル同じ場合証明書が無効といわれる。 参考サイト † |