FreeBSDでpkg/ports版のSendmailを使う

SMTP Authへの攻撃がだんだんウザくなってきたのでBlacklistdに対応させるべく。FreeBSD同梱のsendmailはいつまで経ってもblacklistd対応するつもりがなさそうなので。

しかし、今更ながら情報が少ない。「FreeBSDというマイノリティ×Sendmailというマイノリティ×pkg/ports版に入れ替え」という3重のマイノリティなので仕方ないか。

基本的にはpkg/portsインストール後のメッセージの通り。

=====
Message from sendmail-8.xx:

--
you should add in /etc/make.conf:
SENDMAIL_CF_DIR=	/usr/local/share/sendmail/cf

To deliver all local mail to your mailhub, edit the last line of submit.mc:
FEATURE(`msp','[mailhub.do.main]`)dnl

To update your configuration look at /usr/local/share/sendmail/cf/README.
---------------------------------------------------
To use the binaries supplied by the port you should add the following lines
to your sendmail.mc file before any mailer or feature definition:

define(`confEBINDIR', `/usr/local/libexec')dnl
define(`UUCP_MAILER_PATH', `/usr/local/bin/uux')dnl

---------------------------------------------------
To activate sendmail as your default mailer, run:
$ cd /usr/local/etc/mail && cp mailer.conf.sendmail mailer.conf

Your '/usr/local/etc/mail/mailer.conf' should look like this:
#
# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
#
sendmail	/usr/local/sbin/sendmail
send-mail	/usr/local/sbin/sendmail
mailq		/usr/local/sbin/sendmail
newaliases	/usr/local/sbin/sendmail
hoststat	/usr/local/sbin/sendmail
purgestat	/usr/local/sbin/sendmail

You may also need to update /etc/rc.conf.

古い情報だと、pkg/portsインストールするだけでmailer.confやらを勝手に差し替えてくれてそのまま動くよ…みたいに書いてあったりしますが、少なくとも現状では設定書換えが必要。将来は分からないけど。

UUCPの設定は今時いらないとして、sendmailの設定ファイルへのconfEBINDIRとか、ちゃんと設定してるって書いてる記事あんまり見ないんですよね…。FreeBSD側のバイナリとキメラで動いちゃったりしてるんでしょうか。

/etc/rc.confについては”may also”とだけしか書いてないやん…。こんな感じで追記しました。

sendmail_program="/usr/local/sbin/sendmail"
sendmail_procname="/usr/local/sbin/sendmail"

blacklistd対応するなら以下も追加

sendmail_flags="-L sm-mta -bd -q30m -O UseBlacklist"

そもそもpkg/ports版はデフォルトでSASLリンクしてるので、SASL(SMTP Auth)使うなら、もうpkg/ports版使った方がよさげ。

カテゴリー: 未分類 タグ: , , パーマリンク

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です