ページの先頭です。
ここから本文です。

よくあるご質問(サポートFAQ)

【InterSec/MW、InterSecVM/MW】MAILER-DAEMONより送信されるエラーメールの送信元メールアドレスのドメイン名は変更できますか?

質問内容

MAILER-DAEMONより送信されるエラーメールの送信元メールアドレスのドメイン名は変更できますか?

回答内容

MAILER-DAEMONより送信されるエラーメールの送信元メールアドレスの
ドメイン名は"@localhost.localdomain"になっておりますが、以下の方法で変更可能です。

ドメイン名を"@example.com"に変更する例です。

 (1) MWのコンソール(ssh等)へ管理者ユーザでログイン後、rootユーザにスイッチします。
   $ su -

 (2) エラー通知ファイルのコピーを作成します。
   # cp -p /usr/share/doc/postfix/bounce.cf.default /etc/postfix/bounce.cf

 (3) 「/etc/postfix/bounce.cf」をviエディタで編集します。

    エラーメールはテンプレートとしてbounce.cfに定義されています。
    設定されているテンプレートの内容を変更します。

   ・以下の4つのテンプレートの指定を行う必要があります。

    1)failure_template (メールが送信できない場合)
    2)delay_template (メールの配送が遅延している場合)
    3)success_template (メールの配送が完了した場合)
     (success_templateは通常MWでは使用しませんが定義を行ってください)
    4)verify_template (VRFYに対する応答)

    バウンスメールの場合は、failure_template (メールが送信できない場合)と
    delay_template (メールの配送が遅延している場合)
    の変更が必要です。


   ・それぞれのテンプレートは ”template_name = <<EOF” で始まり、”EOF”という
    単語のみを含む行で終わります。

   ・指定については、以下の留意事項があります。
    ・バックスラッシュ文字や空白に続く文字には特別な意味は与えられません。
     これらは常にそのまま扱われます。
    ・<<EOF から"EOF"までの間では"$"文字は特別扱いされます。"$"という文字を
     出力として生成するには、"$$"を指定します。
    ・<<EOF から "EOF"までの間では、"#"で始まる行は空行や空白のみの行と同様に
     無視されます。

   ・ヘッダー部分の指定について
    「/etc/postfix/bounce.cf」ファイル中における以下の行を編集してください。

    (編集前)
    MAILER-DAEMON (Mail Delivery System)

    (編集後)
    MAILER-DAEMON@example.com(Mail Delivery System)

   ・なお、文中におけるlocalhost.localdomainについても変更する場合は、
    以下における$myhostnameの部分を、example.comに置換してください。

    (編集前)
    This is the mail system at host $myhostname.

    (編集後)
    This is the mail system at host example.com.


    ===<ここから>===
    #
    # Do not edit this file. This file shows the default delivery status
    # notification (DSN) messages that are built into Postfix.
    #
    # To change Postfix DSN messages, perhaps to add non-English text,
    # follow instructions in the bounce(5) manual page.
    #
    
    #
    # The failure template is used when mail is returned to the sender;
    # either the destination rejected the message, or the destination
    # could not be reached before the message expired in the queue.
    #
    
    failure_template = <<EOF
    Charset: us-ascii
    From: MAILER-DAEMON (Mail Delivery System) ←この行を編集
    Subject: Undelivered Mail Returned to Sender
    Postmaster-Subject: Postmaster Copy: Undelivered Mail
    
    This is the mail system at host $myhostname.
    
    I'm sorry to have to inform you that your message could not
    be delivered to one or more recipients. It's attached below.
    
    For further assistance, please send mail to postmaster.
    
    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.
    
    The mail system
    EOF
    
    #
    # The delay template is used when mail is delayed. Note a neat trick:
    # the default template displays the delay_warning_time value as hours
    # by appending the _hours suffix to the parameter name; it displays
    # the maximal_queue_lifetime value as days by appending the _days
    # suffix.
    #
    # Other suffixes are: _seconds, _minutes, _weeks. There are no other
    # main.cf parameters that have this special behavior.
    #
    # You need to adjust these suffixes (and the surrounding text) if
    # you have very different settings for these time parameters.
    #
    
    delay_template = <<EOF
    Charset: us-ascii
    From: MAILER-DAEMON (Mail Delivery System) ←この行を編集
    Subject: Delayed Mail (still being retried)
    Postmaster-Subject: Postmaster Warning: Delayed Mail
    
    This is the mail system at host $myhostname.
    
    ##################################################
    # THIS IS A WARNING ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. #
    ##################################################
    
    Your message could not be delivered for more than $delay_warning_time_hours hour(s).
    It will be retried until it is $maximal_queue_lifetime_days day(s) old.
    
    For further assistance, please send mail to postmaster.
    
    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.
    
    The mail system
    EOF
    
    #
    # The success template is used when mail is delivered to mailbox,
    # when an alias or list is expanded, or when mail is delivered to a
    # system that does not announce DSN support. It is an error to specify
    # a Postmaster-Subject: here.
    #
    
    success_template = <<EOF
    Charset: us-ascii
    From: MAILER-DAEMON (Mail Delivery System) ←この行を編集
    Subject: Successful Mail Delivery Report
    
    This is the mail system at host $myhostname.
    
    Your message was successfully delivered to the destination(s)
    listed below. If the message was delivered to mailbox you will
    receive no further notifications. Otherwise you may still receive
    notifications of mail delivery errors from other systems.
    
    The mail system
    EOF
    
    #
    # The verify template is used for address verification (sendmail -bv
    # address...) or for verbose mail delivery (sendmail -v address...).
    # It is an error to specify a Postmaster-Subject: here.
    #
    
    verify_template = <<EOF
    Charset: us-ascii
    From: MAILER-DAEMON (Mail Delivery System) ←この行を編集
    Subject: Mail Delivery Status Report
    
    This is the mail system at host $myhostname.
    
    Enclosed is the mail delivery report that you requested.
    
    The mail system
    EOF
    ===<ここまで>===

 (4) 変更したエラーメールのテンプレートを登録します。

   「Management Console(システム管理者)」に接続し、
   「サービス > メールサーバ(postfix) > 基本設定 > 設定ファイルの直接編集」画面を
   開いてください。

   以下の行を最下行に追加してください。
    bounce_template_file = /etc/postfix/bounce.cf

   最終行は改行のみの空行としてください。
   最終行は改行のみの空行でない場合、設定が正しく反映されません。

   追加後に画面下部の [設定] をクリックしてください。

   【注意】
   他のパラメータは変更しないように十分注意してください。

 変更方法の手順は以上です。
 システムの再起動やサービスの再起動は不要です。

製品名カテゴリ

InterSecVM/MW
InterSec/MW

  • コンテンツID: 3150115691
  • 公開日: 2023年10月16日
  • 最終更新日:2023年10月16日

アンケート

サポート情報充実のためアンケートにご協力をお願いいたします。



コメント欄:
ここからページ共通メニューです。 ページ共通メニューを読み飛ばす。