開発したアプリなど一覧

CentOS に postfix をいれた。

アフィリエイトリンクを含む場合があります

CentOSには標準で sendmail が入ってるのですが気に食わないので postfix さんを入れました。

まず最初に入ってる sendmail をストップ。

# /etc/init.d/sendmail stop # chkconfig --level 123456 sendmail off

そんで postfix を入れる。

# yum install postfix # chkconfig --add postfix # chkconfig --list postfix postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off # /etc/init.d/postfix start Starting postfix: [ OK ]

動いた。

次に設定

まずはpostfixの設定。
ドメイン設定する箇所があるが、自分のドメインは Google Apps で使用しているのでサブドメインで登録している。

myhotname = test.example.com mydomain = example.com myorigin = $myhostname inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetwork = 127.0.0.0/8 relay_domains = $mydestination home_mailbox = Maildir/


こんなところ?

次にDNSの設定。メール用にサブドメインを3個ほど追加した。DNS全然知らんのでこれで合ってんのか不安である。smtpとpop追加したは良いが使わなそう...

test mx test.example.com 10 test a 182.163.58.xx smtp mx test.example.com 10 pop mx test.example.com 10

これで設定おわり。

プログラムから送信してログとメールを送れてるか確認。下記は /var/log/maillog

May 10 15:01:41 dti-vps-srv14 postfix/smtp[29777]: 3C47C162E4080: to=<********@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.127.27]:25, delay=2.5, delays=0.07/0.01/0.54/1.8, dsn=2.0.0, status=sent (250 2.0.0 OK 1305007301 w11si23250750wfd.135) May 10 15:01:41 dti-vps-srv14 postfix/qmgr[42766]: 3C47C162E4080: removed

受信。なんとなくうまくいっている様だ。

May 10 15:12:27 dti-vps-srv14 postfix/smtpd[19475]: connect from mail-iw0-f180.google.com[209.85.214.180] May 10 15:12:28 dti-vps-srv14 postfix/smtpd[19475]: 628B0162E4080: client=mail-iw0-f180.google.com[209.85.214.180] May 10 15:12:28 dti-vps-srv14 postfix/cleanup[19486]: 628B0162E4080: message-id=<BANLkTi=io0xthA9gxidEF6dWQxd9kV-NpA@mail.gmail.com> May 10 15:12:28 dti-vps-srv14 postfix/qmgr[42766]: 628B0162E4080: from=<**********@gmail.com>, size=1601, nrcpt=1 (queue active) May 10 15:12:28 dti-vps-srv14 postfix/local[19496]: 628B0162E4080: to=<test@example.com>, relay=local, delay=0.44, delays=0.43/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir) May 10 15:12:28 dti-vps-srv14 postfix/qmgr[42766]: 628B0162E4080: removed

Sponsored Link

コメント

タイトルとURLをコピーしました