「Postfix」の版間の差分
提供: fukudat.net
ナビゲーションに移動検索に移動
(→インストール) |
(→インストール) |
||
| 1行目: | 1行目: | ||
Ubuntu上で[[google:MTA|Mail Transfer Agent (MTA)]] サービスを [[google:postfix|postfix]] で作成する覚書。 | Ubuntu上で[[google:MTA|Mail Transfer Agent (MTA)]] サービスを [[google:postfix|postfix]] で作成する覚書。 | ||
| − | == | + | == Install == |
<pre> | <pre> | ||
$ sudo apt-get install -y postfix | $ sudo apt-get install -y postfix | ||
</pre> | </pre> | ||
| + | configurator が走るので、 | ||
* メール設定の一般形式 = インターネットサイト | * メール設定の一般形式 = インターネットサイト | ||
* システムメール名 = fukudat.net | * システムメール名 = fukudat.net | ||
| + | |||
| + | としておく。 | ||
SASL認証のために dovecot (POP3/IMAP サーバー)を入れる。 | SASL認証のために dovecot (POP3/IMAP サーバー)を入れる。 | ||
| 14行目: | 17行目: | ||
</pre> | </pre> | ||
でも POP3/IMAP は使わない。 | でも POP3/IMAP は使わない。 | ||
| + | |||
| + | == Configure == | ||
| + | /etc/postfix にある main.cf を編集して、以下の変更を加える。 | ||
| + | <pre> | ||
| + | mail_owner = postfix | ||
| + | myhostname = fukudat.net | ||
| + | mydomain = fukudat.net | ||
| + | myorigin = $mydomain | ||
| + | inet_interfaces = all | ||
| + | mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain | ||
| + | local_recipient_maps = unix:passwd.byname $alias_maps | ||
| + | alias_maps = hash:/etc/aliases | ||
| + | smtpd_banner = $myhostname ESMTP | ||
| + | sendmail_path = /usr/sbin/postfix | ||
| + | newaliases_path = /usr/bin/newaliases | ||
| + | mailq_path = /usr/bin/mailq | ||
| + | setgid_group = postdrop | ||
| + | #html_directory = | ||
| + | #manpage_directory = | ||
| + | #sample_directory = | ||
| + | #readme_directory = | ||
| + | message_size_limit = 10485760 | ||
| + | mailbox_size_limit = 1073741824 | ||
| + | disable_vrfy_command = yes | ||
| + | smtpd_banner = $myhostname ESMTP | ||
| + | smtpd_helo_required = yes | ||
| + | smtpd_sasl_type = dovecot | ||
| + | smtpd_sasl_path = private/auth | ||
| + | smtpd_sasl_auth_enable = yes | ||
| + | smtpd_sasl_local_domain = $mydomain | ||
| + | smtpd_sasl_security_options = noanonymous | ||
| + | smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject | ||
| + | smtpd_relay_restrictions = permit_mynetworks,permit_sasl_authenticated,defer_unauth_destination | ||
| + | smtpd_use_tls = yes | ||
| + | smtpd_tls_cert_file = /etc/ssl/certs/fukudat.net.crt # SSL Certificate | ||
| + | smtpd_tls_key_file = /etc/ssl/private/fukudat.net.key # SSL Private Key | ||
| + | </pre> | ||
== 参考文献 == | == 参考文献 == | ||
2020年6月3日 (水) 16:53時点における版
Ubuntu上でMail Transfer Agent (MTA) サービスを postfix で作成する覚書。
Install
$ sudo apt-get install -y postfix
configurator が走るので、
- メール設定の一般形式 = インターネットサイト
- システムメール名 = fukudat.net
としておく。
SASL認証のために dovecot (POP3/IMAP サーバー)を入れる。
$ sudo apt-get install -y dovecot-core
でも POP3/IMAP は使わない。
Configure
/etc/postfix にある main.cf を編集して、以下の変更を加える。
mail_owner = postfix myhostname = fukudat.net mydomain = fukudat.net myorigin = $mydomain inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain local_recipient_maps = unix:passwd.byname $alias_maps alias_maps = hash:/etc/aliases smtpd_banner = $myhostname ESMTP sendmail_path = /usr/sbin/postfix newaliases_path = /usr/bin/newaliases mailq_path = /usr/bin/mailq setgid_group = postdrop #html_directory = #manpage_directory = #sample_directory = #readme_directory = message_size_limit = 10485760 mailbox_size_limit = 1073741824 disable_vrfy_command = yes smtpd_banner = $myhostname ESMTP smtpd_helo_required = yes smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $mydomain smtpd_sasl_security_options = noanonymous smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject smtpd_relay_restrictions = permit_mynetworks,permit_sasl_authenticated,defer_unauth_destination smtpd_use_tls = yes smtpd_tls_cert_file = /etc/ssl/certs/fukudat.net.crt # SSL Certificate smtpd_tls_key_file = /etc/ssl/private/fukudat.net.key # SSL Private Key