SST Lab Dokuwiki Header header picture

ユーザ用ツール

サイト用ツール


linux:postfix_install

差分

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

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
linux:postfix_install [2022/08/19 13:54] – [Setting-up Postfix] kimilinux:postfix_install [2022/08/23 13:34] (現在) – 外部編集 127.0.0.1
行 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''にある。
  
 +変更は''postconf''を使って
 <code sh> <code sh>
-sudo cp /usr/share/postfix/main.cf.dist /etc/postfix/main.cf+sudo postconf smtpd_banner=\$myhostname\ ESMTP\ \$mail_name
 </code> </code>
 +のように行う。
 +
 +^パラメータ^デフォルト^設定値^
 +|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''| |''#mail_owner = postfix''|''mail_owner = postfix''|
-|''#myhostname = host.domain.tld''|''myhostname = (内部host名).(内部ドメイン名)''+|''#myhostname = host.domain.tld''|''myhostname = mail.local''|
-|''#mail_owner = postfix''|''#mail_owner = postfix''+
-|''#myhostname = host.domain.tld''|''#myhostname = host.domain.tld''|+
 |''#mydomain = domain.tld''|''#mydomain = domain.tld''| |''#mydomain = domain.tld''|''#mydomain = domain.tld''|
 |''#myorigin = $mydomain''|''#myorigin = $mydomain''| |''#myorigin = $mydomain''|''#myorigin = $mydomain''|
linux/postfix_install.1660884885.txt.gz · 最終更新: 2022/08/23 13:34 (外部編集)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki