FreeBSD (smtp-auth)

No responses yet »
Read 123 views

sasl2を入れてsmtp-authを有効にするために/usr/local/etc/postfix/main.cfに以下を追加。

CODE:
  1. ####################
  2. # SMTP AUTH w/SALS2
  3. #
  4. smtpd_sasl_auth_enable = yes
  5. smtpd_sasl_local_domain = $myhostname
  6. broken_sasl_auth_clients = yes
  7. smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination

/usr/local/lib/sasl2/smtpd.confを作る。

CODE:
  1. # cat /usr/local/lib/sasl2/smtpd.conf
  2. pwcheck_method: auxprop
  3. auxprop_plugin: sasldb
  4. mech_list: cram-md5 digest-md5 plain login

/etc/sasldb2を用意しておく。

CODE:
  1. # touch /etc/sasldb2
  2. # chown postfix:postfix /etc/sasldb2

smtp-authのユーザーを作る。

CODE:
  1. #  saslpasswd2 -c -u `postconf -h myhostname` username

パスワードを二回訊いてくるので入力する。

ユーザーのパスワードの変更

CODE:
  1. #  saslpasswd2 -u `postconf -h myhostname` username

同じくパスワードを二回訊いてくるので入力する。

ユーザーの削除

CODE:
  1. #  saslpasswd2 -u `postconf -h myhostname` -d username

ユーザーの確認

CODE:
  1. #  sasldblistusers2

参考リンク) 1, 2, 3

FreeBSD (postfix)

No responses yet »
Read 72 views

/usr/ports/mail/postfix のインストール

# portinstall mail/postfix

で一発。オプションはPCREとSASL2とTLSを指定。

Added group “postfix”.
Added group “maildrop”.
Added user “postfix”.
You need user “postfix” added to group “mail”.
Would you like me to add it [y]?

と訊いてくるところはそのままエンター(y)。

Would you like to activate Postfix in /etc/mail/mailer.conf [n]?

ここはsendmailではなくpostfixを有効にしたいので”y”。

postfix-2.3.4,1
cyrus-sasl-2.1.22
pcre-6.7

がインストールされました。
あとの設定は、/etc/rc.confで

postfix_enable=”YES”

sendmail_enable=”NO”
sendmail_submit_enable=”NO”
sendmail_outbound_enable=”NO”
sendmail_msp_queue_enable=”NO”

/usr/local/etc/postfix にmain.cfがあるので、cp -p main.cf main.cf.orgでバックアップしてから編集。

myhostname = virtual.domain.tld
mydomain = domain.tld
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain $mydomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

rehash かけたあと、newaliasesしておけば一応OK。