linux:postfix_install
文書の過去の版を表示しています。
メールサーバの構築
今回は旧学科メールサーバからの転送を受け取るだけのサーバを立てることにする。
- Postfix(SMTPサーバ)
- (imapサーバ)
Postfixのインストール
インストールはapt
一発とはいかない。(Ubuntu Serverの場合)
$ sudo apt install postfix
途中で
Package configuration ┌────────────────────────┤ Postfix Configuration ├────────────────────────┐ │ │ │ Please select the mail server configuration type that best meets your │ needs. │ │ No configuration: │ Should be chosen to leave the current configuration unchanged. │ Internet site: │ Mail is sent and received directly using SMTP. │ Internet with smarthost: │ Mail is received directly using SMTP or by running a utility such │ as fetchmail. Outgoing mail is sent using a smarthost. │ Satellite system: │ All mail is sent to another machine, called a 'smarthost', for │ delivery. │ Local only: │ The only delivered mail is the mail for local users. There is no │ network. │ │ <Ok> │ │ └─────────────────────────────────────────────────────────────────────────┘
のような選択肢が出るので、ここはInternet site
を選択する。
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are yPackage configuration ┌─────────────────────────┤ Postfix Configuration ├─────────────────────────┐ │ The 'mail name' is the domain name used to 'qualify' _ALL_ mail │ │ addresses without a domain name. This includes mail to and from <root>: │ │ please do not make your machine send out mail from root@example.org │ │ unless root@example.org has told you to. │ │ │ │ This name will also be used by other programs. It should be the single, │ │ fully qualified domain name (FQDN). │ │ │ │ Thus, if a mail address on the local host is foo@example.org, the │ │ correct value for this option would be example.org. │ │ │ │ System mail name: │ │ │ │ XXX.XXX.XXX.ac.jp_________________________________________________________ │ │ │ │ <Ok> <Cancel> │ │ │ └───────────────────────────────────────────────────────────────────────────┘
これでXXX@XXX.XXX.XXX.ac.jp
宛のメールを受け取ることができる。
Setting-up Postfix
設定ファイルは/etc/postfix/main.cf
。雛形が/usr/share/postfix
にある。
sudo cp /usr/share/postfix/main.cf.dist /etc/postfix/main.cf
雛形 | 設定変更 |
---|---|
#mail_owner = postfix | mail_owner = postfix |
#myhostname = host.domain.tld | myhostname = mail.local |
#mydomain = domain.tld | #mydomain = domain.tld |
#myorigin = $mydomain | #myorigin = $mydomain |
#inet_interfaces = all | #inet_interfaces = all |
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain | #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain |
#local_recipient_maps = unix:passwd.byname $alias_maps | #local_recipient_maps = unix:passwd.byname $alias_maps |
#home_mailbox = Maildir/ | #home_mailbox = Maildir/ |
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) | smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) |
sendmail_path = | sendmail_path = |
newaliases_path = | newaliases_path = |
mailq_path = | mailq_path = |
setgid_group = | setgid_group = |
html_directory = | html_directory = |
manpage_directory = | manpage_directory = |
sample_directory = | sample_directory = |
readme_directory = | readme_directory = |
linux/postfix_install.1660887112.txt.gz · 最終更新: 2022/08/23 13:34 (外部編集)