2009年3月2日月曜日

Macで開発用SMTPサーバをたてたい!

メール送信をするSMTPサーバを簡単にローカルでたてたい!
(メール送信をするプログラム作成時の時など用に...)
ということで少しみてました。

MacOSXではpostFixというのが予め入っているみたいで、これを使うと出来るようです。

/etc/hostconfig に

MAILSERVER=-YES-


という行を追加。

で、ターミナルで
> postfix start
ってすればいけるみたいー。

ログは /var/log/mail.log に出てます。
でも、これだけの設定だとGmailへの送信は蹴られちゃうみたい。
ログをみるとこんな感じ。

connect to gmail-smtp-in.l.google.com[209.85.199.27]: Connection refused (port 25)
connect to alt1.gmail-smtp-in.l.google.com[209.85.133.27]: Connection refused (port 25)
connect to alt2.gmail-smtp-in.l.google.com[209.85.135.27]: Connection refused (port 25)
connect to alt3.gmail-smtp-in.l.google.com[209.85.220.10]: Connection refused (port 25)
connect to alt4.gmail-smtp-in.l.google.com[209.85.221.72]: Connection refused (port 25)
650B49BE09: to=<*****@gmail.com>, relay=none, delay=2667, delays=2660/0.02/7/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[209.85.221.72]: Connection refused)



多分、スパムよけでなんかしてるんでしょうーね。。
MacのマシンからPostfixでGmailに送信できるようにするという記事のを反映したら上手くいくのかも。(まだ試してないですww)
• • •