Top過去ログ目次掲示板

作成日:2006年05月20日 作成:おやじ
掲示板で過去に質問された内容です。

No.5972 Postfixのalways_bccについて


No.5972 投稿時間:2006年05月20日(Sat) 03:49 投稿者名:mo URL:
タイトル:Postfixのalways_bccについて

Postfixでalways_bccを使ってメールサーバに入ってくるメールを全て別アカウントにバックアップを取っていたのですが、先日Amavisd-newを導入したところ1つのメールに対して2通の全く同じメールが届くようになってしまいました。どうすれば正常にできるのでしょうか?


No.5973 投稿時間:2006年05月20日(Sat) 06:14 投稿者名:おやじ URL:
タイトル:cleanupデーモンを2回通過するから?

> Postfixでalways_bccを使ってメールサーバに入ってくるメールを全て別アカウントにバックアップを取っていたのですが、先日Amavisd-newを導入したところ1つのメールに対して2通の全く同じメールが届くようになってしまいました。どうすれば正常にできるのでしょうか?

BCCに2通くるのなら、Postfixのドキュメントに書いてあるとおりでしょう。違うなら下記は当てはまらないので無視してください。且つ理由はおやじにはわかりません。
もし、BCCに2通くるのなら、PostfxのADDRESS_REWRITING_READMEに書いてあるとおりのことが起きているのではないかと思います。
always_bcc は cleanup デーモンで動作するようですから、下記の絵のとおり普通のメール(smtpdデーモンから入ってきたメール)もamavisd-newから戻ってきたメール(内部転送ではないので新規に見える。)も cleanup デーモンを通過するのでbccが2個になってしまうのでは?

http://www.aconus.com/~oyaji/suse9.3/amavisd-new_antivir_suse9.3.htm

従って、master.cfのamavisd-newからsmtpdに戻ってくるところの下記の処理で、

127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=

(snip)

-o receive_override_options=,no_unknown_recipient_checks,no_header_body_checks

に下記のように、「no_address_mapping」を追記してあげれば止まるのでは?

 -o receive_override_options=,no_unknown_recipient_checks,no_header_body_checks,no_address_mapping

因みに、PostfixやApacheはドキュメントがしっかりしているので、見ると結構問題解決すると思いますよ。但し、わかりにくいですが・・・。


No.5978 投稿時間:2006年05月22日(Mon) 03:25 投稿者名:mo URL:
タイトル:Re: cleanupデーモンを2回通過するから?

ご教授ありがとうございます。no_address_mappingを追加したところメールがうまく受信されなくなってしまいました。もう少し試行錯誤してみようと思います。


No.5981 投稿時間:2006年05月22日(Mon) 21:25 投稿者名:おやじ URL:
タイトル:少しおやじも勘違いしていた気がします。

> ご教授ありがとうございます。no_address_mappingを追加したところメールがうまく受信されなくなってしまいました。もう少し試行錯誤してみようと思います。

少しおやじも勘違いしていた気がします。
ただ、おやじの環境ではカーボンコピーが2通くることはありません。
恐らく、master.cfのamavisからpostfixのsmtpdに戻すところの設定かと思います。master.cfは貼り付けられますか?
因みに、前回も書きましたが2通くるのはカーボンコピーのほうですよね。


No.5983 投稿時間:2006年05月23日(Tue) 02:56 投稿者名:mo URL:
タイトル:Re: 少しおやじも勘違いしていた気がします。

はい。全く同じ(ヘッダも)メールが2通配信されてしまいます。ちなみにrecipient_bcc_mapsを使ったときも同じ症状になってしまいます。master.cfは御サイトのhttp://www.aconus.com/~oyaji/suse9.3/amavisd-new_suse9.3.htmを参照して下記のように設定しました。ちなみにPostfixのバージョンは2.3-20060207でディストリビューションはScientific Linuxです。


#
# Postfix master process configuration file. For details on the format
# of the file, see the Postfix master(5) manual page.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#628 inet n - n - - qmqpd

pickup fifo n - n 60 1 pickup
-o content_filter=
filter unix - n n - 10 pipe
flags=Rq user=filter argv=/usr/local/bin/spam-filter -f ${sender} -- ${recipient}
smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=filter:dummy
# -o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache

#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
cyrus unix - n n - - pipe
user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient


No.5988 投稿時間:2006年05月23日(Tue) 20:55 投稿者名:おやじ URL:
タイトル:何で、2.3なのですか? 実験機で人柱をやっているのですか?

> はい。全く同じ(ヘッダも)メールが2通配信されてしまいます。ちなみにrecipient_bcc_mapsを使ったときも同じ症状になってしまいます。master.cfは御サイトのhttp://www.aconus.com/~oyaji/suse9.3/amavisd-new_suse9.3.htmを参照して下記のように設定しました。ちなみにPostfixのバージョンは2.3-20060207でディストリビューションはScientific Linuxです。

何で、2.3なのですか? 実験機で人柱をやっているのですか? Scientific Linuxで素直に2.1を使うのでは駄目なんですか? 2.3がどうなっているかはわかりませんが、あのFC5でさえ2.2ですから、自分で解決する力がなければ手を出す代物ではないと思いますが・・・。
因みに、FC5の2.2も何も問題なく1個しか配送されないですね。
一箇所設定がおかしいところがありますので、インラインで。

> #
> # Postfix master process configuration file. For details on the format
> # of the file, see the Postfix master(5) manual page.
> #
> # ==========================================================================
> # service type private unpriv chroot wakeup maxproc command + args
> # (yes) (yes) (yes) (never) (100)
> # ==========================================================================
> smtp inet n - n - - smtpd
> #submission inet n - n - - smtpd
> # -o smtpd_enforce_tls=yes
> # -o smtpd_sasl_auth_enable=yes
> # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
> #smtps inet n - n - - smtpd
> # -o smtpd_tls_wrappermode=yes
> # -o smtpd_sasl_auth_enable=yes
> # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
> #628 inet n - n - - qmqpd
>
> pickup fifo n - n 60 1 pickup
> -o content_filter=
> filter unix - n n - 10 pipe
> flags=Rq user=filter argv=/usr/local/bin/spam-filter -f ${sender} -- ${recipient}
> smtp-amavis unix - - n - 2 smtp
> -o smtp_data_done_timeout=1200
> -o smtp_send_xforward_command=yes
> -o disable_dns_lookups=yes
> -o max_use=20
> 127.0.0.1:10025 inet n - n - - smtpd
> -o content_filter=filter:dummy
> # -o content_filter=

これが原因かどうかはわかりませんが、これでは少なくとも正常に動作しないのでは? これがあるとここから下は無視されてしまいますよ。
master.cfはパラメータの先頭は空白は置かずに記述し、追加設定はその下に行頭に空白やtabを置くことによって記述します。また、パラメータ=値は「=」の両側に空白を含んでは駄目です。
これにより、上の
「127.0.0.1:10025」 から 下の「-o receive_override_options」までが1行で書かれているのと同じになります。

> -o local_recipient_maps=
> -o relay_recipient_maps=
> -o smtpd_restriction_classes=
> -o smtpd_delay_reject=no
> -o smtpd_client_restrictions=permit_mynetworks,reject
> -o smtpd_helo_restrictions=
> -o smtpd_sender_restrictions=
> -o smtpd_recipient_restrictions=permit_mynetworks,reject
> -o smtpd_data_restrictions=reject_unauth_pipelining
> -o smtpd_end_of_data_restrictions=
> -o mynetworks=127.0.0.0/8
> -o strict_rfc821_envelopes=yes
> -o smtpd_error_sleep_time=0
> -o smtpd_soft_error_limit=1001
> -o smtpd_hard_error_limit=1000
> -o smtpd_client_connection_count_limit=0
> -o smtpd_client_connection_rate_limit=0
> -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks



掲示板▲頁先頭