2017年8月20日日曜日

mail 日本語対応

mail 日本語対応

2017 Aug. 20.
mail,日本語,文字化け

msg="sentense"
subject="title"
mailDest="abc@xx def@yy ghi@zz"

echo -e "${msg}" | nkf -j  | mail -s `echo "${subject}" | nkf -jM` $mailDest

postfix設定

2018 Sep. 23.
2017 Aug. 20.

このページは無視して、こちらを参照すればよい。


myhostname = gmeil.com, mydomain = gmail.com と設定したら、gmailへのメールが届かな
い。
no-ipで取得しているドメイン名にしたらgmailへのメールが届いた。
設定後、 # systemctl restart postfix.service。
# systemctl restart postfix ではだめのよう。



[/etc/postfix/main.cf]

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = xxxx.no-ip.info
mydomain = xxxx.no-ip.info
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relayhost = [smtp.gmail.com]:587
mynetworks = 127.0.0.0/8 192.168.1.0/24
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
smtp_helo_name = $myhostname
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_password_maps = hash:/etc/postfix/gmail_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_use_tls = yes
smtp_tls_CApath = /etc/ssl/certs/ca-certificates.crt