自宅サーバからOCNのSMTPサーバ経由でメール送信を行う場合にはまった。
1  | vi /etc/postfix/main.cf  | 
1  | relayhost = [受信メールサーバ]  | 
なぜかrelayhostには受信メールサーバを指定する。
後はググって出てくる一般的な設定でOK。
 例えば
1  | vi /etc/postfix/main.cf  | 
1 2 3 4  | myhostname = 自ホスト名 mydomain = ドメイン名 myorigin = $myhostname mydestination = $myhostname, localhost.$mydomain, localhost  | 
と書き換え、
1  | vi /etc/postfix/main.cf  | 
1 2 3 4  | smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/authinfo smtp_sasl_security_options = noanonymous smtp_sasl_mechanism_filter = LOGIN  | 
を追加する。
認証情報として以下を作成。
1  | vi /etc/postfix/authinfo  | 
1  | 送信サーバ メールアカウント:メールパスワード  | 
1 2  | chmod 640 /etc/postfix/authinfo postmap /etc/postfix/authinfo  | 
などとする。
※relayhost及び認証(文中では/etc/postfix/authinfo)で指定するポートは25でも587でもOKだったので、ここでは特に明示しない設定とした。
 とは言えメール送信としての25番ポートは受け付けないので、場合によっては:587を指定する必要があるだろう。