#ホスト名を設定する(ホスト名.ドメイン名) myhostname = ns.sea-bird.org mydomain = sea-bird.org #送信者メールアドレスの@以降をドメイン名にする myorigin = $mydomain #Postfix が待ち受けるべき全てのネットワークインターフェースを指定 inet_interfaces = all #メールをローカルで受信するドメイン名を指定(ドメイン全体のメールサーバ) mydestination = $myhostname, localhost.$mydomain, $mydomain #信頼されたネットワークをCIDR (network/mask) 表記で指定(ローカルネットワーク) mynetworks_style = subnet mynetworks = 192.168.0.0/24, 127.0.0.0/8 #中継を許可するドメインを指定 relay_domains = $mydestination #メールボックスを各ユーザのホームディレクトリに配置 home_mailbox = Mailbox # Postfixが出力する情報/なるべく嘘をついた方がよい smtpd_banner = $myhostname ESMTP sendmail 0 #ホストの接続に関しての拒否/SPAM対応 smtpd_client_restrictions = permit_mynetworks, reject_rbl_client relays.ordb.org, permit #メール送信時にアカウント名・パスワードをサーバに通知し、メールサーバから認証を受ける smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination #anonymousユーザを許さない smtpd_sasl_security_options = noanonymous
# touch /etc/skel/Mailbox # chmod 660 /etc/skel/Mailbox
# cp /etc/aliases /etc/postfix/aliases # vi /etc/postfix/aliases #webmaster: root ← コメント(#)にする # Person who should get root's mail root: webmaster ← コメントを外して webmaster に修正
# /usr/sbin/postalias /etc/postfix/aliases
# /etc/rc.d/init.d/sendmail stop # yum -y remove sendmail
# /etc/rc.d/init.d/postfix start
# chkconfig postfix on
#プロトコルを指定 protocols = imap imaps pop3 pop3s #メールボックスを各ユーザのホームディレクトリに配置 default_mail_env = mbox:~/Mailbox #chrootユーザのディレクトリ valid_chroot_dirs = /home
# /etc/rc.d/init.d/dovecot start
# chkconfig dovecot on
新着(~/Mailbox/new)メールがあるにもかかわらず mail コマンドで「No mail for」ってなるときは、環境変数がたりないから
$ mail -f ~/Maildir
export MAIL=$HOME/Maildir