SST Lab Dokuwiki Header header picture

ユーザ用ツール

サイト用ツール


linux:postfix_install

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
最新のリビジョン両方とも次のリビジョン
linux:postfix_install [2022/08/19 13:41] – [Setting-up Postfix] kimilinux:postfix_install [2022/08/23 11:31] – [dovecot] kimi
行 2: 行 2:
 今回は旧学科メールサーバからの転送を受け取るだけのサーバを立てることにする。 今回は旧学科メールサーバからの転送を受け取るだけのサーバを立てることにする。
   * Postfix(SMTPサーバ)   * Postfix(SMTPサーバ)
-  * (imapサーバ)+  * dovecot(imapサーバ)
  
 ===== Postfixのインストール ===== ===== Postfixのインストール =====
 インストールは''apt''一発とはいかない。(Ubuntu Serverの場合)<code sh> インストールは''apt''一発とはいかない。(Ubuntu Serverの場合)<code sh>
 $ sudo apt install postfix $ sudo apt install postfix
 +$ sudo apt install mailutils # デフォルトでmailコマンドが入ってないなんて!
 </code> </code>
 途中で 途中で
行 35: 行 36:
   └─────────────────────────────────────────────────────────────────────────┘   └─────────────────────────────────────────────────────────────────────────┘
 </code> </code>
-のような選択肢が出るので、ここは''No configuration''を選択する。+のような選択肢が出るので、ここは''Local only''を選択する。 
 +<code txt>
  
 + ┌─────────────────────────┤ 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>                   │
 + │                                                                           │
 + └───────────────────────────────────────────────────────────────────────────┘
 +</code>
 +これで''XXX@XXX.XXX.XXX.ac.jp''宛のメールを受け取ることができる。
  
 ===== Setting-up Postfix ===== ===== Setting-up Postfix =====
-設定ファイルは''/etc/postfix/main.cf''。雛形が''/usr/share/postfix''にある。+設定ファイルは''/etc/postfix/main.cf''雛形が''/usr/share/postfix''にある。
  
-sudo cp /usr/share/postfix/main.cf.dist /etc/postfix/main.cf+変更は''postconf''を使って 
 +<code sh> 
 +sudo postconf smtpd_banner=\$myhostname\ ESMTP\ \$mail_name 
 +</code> 
 +のように行う。
  
-雛形 ^ 設定変更 +^パラメータ^デフォルト^設定
-|#mail_owner = postfix|mail_owner = postfix|+|myorigin|''$myhostname''
 +|mydestination|''$myhostname localhost.$mydomain localhost''| | 
 +|inet_interfaces|''local-loopback''| | 
 +あたりの設定が必要。 
 +最終的に、外からアクセスして以下のようなレスポンスが返ってくるようになってればOK。 
 +<code sh> 
 +% telnet mail.global.jp 25 
 +Trying XXX.XX.XX.XXX... 
 +Connected to mail.global.jp. 
 +Escape character is '^]'
 +220 mail.local ESMTP Postfix (Ubuntu) 
 +mail from: xyz@abc.net 
 +250 2.1.0 Ok 
 +rcpt to: user@mail.global.jp 
 +250 2.1.5 Ok 
 +data 
 +354 End data with <CR><LF>.<CR><LF> 
 +This mail comes from outside. 
 +
 +250 2.0.0 Ok: queued as D186F80AFD 
 +quit 
 +221 2.0.0 Bye 
 +Connection closed by foreign host. 
 +% telnet mail.global.jp 25 
 +Trying XXX.XX.XX.XXX... 
 +Connected to mail.global.jp. 
 +Escape character is '^]'
 +220 mail.local ESMTP Postfix (Ubuntu) 
 +mail from: xyz@abc.net 
 +250 2.1.0 Ok 
 +rcpt to: user@somewhere.else.jp 
 +454 4.7.1 <user@somewhere.else.jp>: Relay access denied 
 +quit 
 +221 2.0.0 Bye 
 +Connection closed by foreign host. 
 +%  
 +</code>
  
 +===== dovecot =====
 +インストールは''apt''一発。(Ubuntu Serverの場合)<code sh>
 +$ sudo apt install dovecot-imapd
 +</code>
 +
 +設定ファイルは''/etc/dovecot/dovecot.conf''
 +
 +===== 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.txt · 最終更新: 2022/08/23 13:34 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki