yum install postfix

 

★postfixの設定

vi /etc/postfix/main.cf

myhostname = mail-dev.nilesflow.net

mydomain = nilesflow.net

myorigin = mail-dev.nilesflow.net

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

local_recipient_maps =

mynetworks = 127.0.0.0/8, 192.168.1.0/24, x.x.x.x/32, y.y.y.y/32

relay_domains = $mydestination

virtual_alias_domains = mail-dev.nilesflow.net
virtual_alias_maps = hash:/etc/postfix/virtual

#home_mailbox = Mailbox
#home_mailbox = Maildir/

sendmail_path = /usr/sbin/sendmail

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_application_name = smtpd
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
#smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination
~

★ヘッダ記録

smtpd_sasl_authenticated_header = yes

 

★sasl2の設定

889 adduser postfix sasl
890 id postfix
894 gpasswd -a postfix sasl

 

929 vi /etc/sasl2/smtpd.conf

pwcheck_method: saslauthd
mech_list: plain login

変更なしかな

933 vi /etc/sysconfig/saslauthd

SOCKETDIR=/var/run/saslauthd

MECH=pam

# DAEMONOPTS=–user saslauth

FLAGS=

変更なしかな
934 saslpasswd2 -u mail-dev.nilesflow.net -c nilesflow
935 sasldblistusers2

 

★エイリアスの設定

995 vi /etc/aliases

nilesflow: “|/usr/local/php-5.6.12/bin/php -f /var/tmp/php/recvmail.php”
997 newaliases

 

★バーチャルエイリアスの設定

1040  vi /etc/postfix/virtual

@mail-dev.nilesflow.net nilesflow@mail-dev.nilesflow.net

 

1046  postmap hash:/etc/postfix/virtual

 

★サブミッション

vi /etc/postfix/master.cf

submission inet n – n – – smtpd
#-o smtpd_tls_security_level=encrypt
#-o smtpd_sasl_auth_enable=yes
#-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING

とりあえずSSLは使わないので