[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[postfix-jp: 2441] postfixからprocmailを引数付きで起動したい



opensuse10.1でそれなりに運用していたのですが、とあるきっかけで、
クリーンインストールすることになってしまいました。

困っていること

 postfixから、mailbox_transportで指定したprocmailを起動し、
 USERとSENDERをprocmailへ渡して処理させる、ということをしていま
 した。少なくとも、前のシステムではうまく処理できていました。

で、OSから新規にインストールし直して、新たに環境を作り直して
いるのですが、procmailへうまくuserとsenderが渡らなくなってしまい
ました。

<現在の環境>
 OS:openSUSE10.1
 postfix:2.2.9-10@i586
 procmail:procmail-3.22-56

旧の環境を消す前に、main.cfとmaster.cfは確保しておきましたので
これを戻しました。postconf -nは以下のとおりです(一部使われない
設定もあるかと思いますが...)

# postconf -n
alias_maps = hash:/etc/aliases
allow_mail_to_commands = alias,forward,include
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
forward_path = /var/forward/$user/.forward
home_mailbox = Maildir/
html_directory = /usr/share/doc/packages/postfix/html
local_recipient_maps = hash:/etc/mail/postfix_u $alias_maps
mail_owner = postfix
mailbox_command = /usr/bin/procmail -a "$EXTENSION"
mailbox_transport = procmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydomain = abcd.hogecorp.co.jp
myhostname = abc-linux.abcd.hogecorp.co.jp
mynetworks = 172.31.4.0/22, 127.0.0.0/8
mynetworks_style = subnet
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES

master.cf
----------
# cat master.cf
#
# 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_etrn_restrictions=reject
#       -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps    inet  n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes
#  -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission   inet    n       -       n       -       -       smtpd
#  -o smtpd_etrn_restrictions=reject
#  -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628      inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
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
#localhost:10025 inet   n       -       n       -       -       smtpd -o content_filter=
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}
cyrus     unix  -       n       n       -       -       pipe
  user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
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
procmail  unix  -       n       n       -       -       pipe
#  flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
  flags=R user=nobody argv=/usr/bin/procmail -t -m USER=${user} SENDER=${sender} /etc/procmailrc
#tlsmgr    unix  -       -       n       1000?   1       tlsmgr

/etc/procmailrc
----------------
# cat procmailrc 
LOGFILE=/var/log/procmail/$USER.log
DELIVERMAIL=/usr/lib/cyrus/bin/deliver
SPAMIT="$DELIVERMAIL -e -a $USER -r $SENDER -m user.$USER.Spam"
VIRUSIT="$DELIVERMAIL -e -a $USER -r $SENDER -m user.$USER.Virus"
IMAP="$DELIVERMAIL -e -a $USER -r $SENDER -m user.$USER"
LOCKFILE="/var/log/procmail/$USER.lock"
VERBOSE=on

:0 fw
| /usr/local/bin/clamassassin

:0 
* ^X-Virus-Status: Yes
| $VIRUSIT

:0 fw
| /usr/bin/spamc

:0 
* ^X-Spam-Status: Yes
| $SPAMIT

:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
| $SPAMIT

:0
* !^To:
| $SPAMIT

:0
* !^From:
| $SPAMIT

:0
| $IMAP

:0 w
{
EXITCODE=$?
}
sample_directory = /usr/share/doc/packages/postfix/samples
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550

ログ
----
procmail: Unlocking "/var/log/procmail/.lock"
procmail: [7930] Fri Dec 22 13:44:56 2006
procmail: Executing "/usr/local/bin/clamassassin"
procmail: [7930] Fri Dec 22 13:45:04 2006
procmail: No match on "^X-Virus-Status: Yes"
procmail: Executing "/usr/bin/spamc"
procmail: [7930] Fri Dec 22 13:45:07 2006
procmail: No match on "^X-Spam-Status: Yes"
procmail: No match on "^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*"
procmail: No match on ! "^To:"
procmail: No match on ! "^From:"
procmail: Executing "/usr/lib/cyrus/bin/deliver,-e,-a,-r,-m,user."
procmail: Assigning "LASTFOLDER=/usr/lib/cyrus/bin/deliver -e -a -r -m user."
procmail: Notified comsat: "kateraka@:/usr/lib/cyrus/bin/deliver -e -a -r -m user."
 Subject: =?ISO-2022-JP?B?GyRCIVolLyVqJTklXiU5GyhCU0FMRRskQiEqIVslPSVLITwbKEIzM
  Folder: /usr/lib/cyrus/bin/deliver -e -a -r -m user.                     7486
procmail: Unlocking "/var/log/procmail/.lock"
-----------------------------------------------------------------------------------

以上のように、ログを見ると$USER、$SENDERの部分が展開されません。procmailの先頭に
USER=xxxxxxとすれば、user.xxxxxxとかにメールが配送されるのを確認しています。

どのあたりに問題があるでしょうか?是非ご教授ください。

--------
てらかど
--------


_______________________________________________
Postfix-jp-list mailing list
Postfix-jp-list@xxxxxxxxxxxxxxxxxxxx
http://lists.sourceforge.jp/mailman/listinfo/postfix-jp-list

Follow-Ups
[postfix-jp: 2442] Re: postfixからprocmailを引数付きで起動したい, Hopemoon Tsuda
[postfix-jp: 2443] Re: postfix からprocmailを引数付きで起動したい, Katsushi Sakurane
[postfix-jp: 2455] Re: postfixからprocmailを引数付きで起動したい, Takahiro Kambe
References
[postfix-jp: 2440] [FYI] 受信側が sender address verification 、送信側が greylisting 時の配送遅延, Ryuji Matsumoto

[検索ページ] [Postfix-JP ML Home]