让 postfix 退回除 procmail 相关的未送达通知之外的所有邮件

让 postfix 退回除 procmail 相关的未送达通知之外的所有邮件

请原谅我在 serverfault 上重新发布;我之前错误地将其最初发布在 stackoverflow 上,并被善意提醒在这里发布......

问题:我时不时遇到当 procmail 失败时发送未送达消息的情况。任何未送达通知都应该发出,但由于 procmail 错误而发出的通知则不应该。

未达到预期的尝试

  • main.cf:仍会反弹至外部发件人

    notify_classes = 2bounce, data, delay, resource, software, bounce
    bounce_notice_recipient = postmaster
    
  • master.cf:根本没有退回邮件

    bounce     unix  -       -       y       -       0       discard
    
  • 我的 procmailrc 设置似乎导致了错误(但自 2000 年代初以来一直运行良好,直到两个月前我升级到 Debian 10)

    VERBOSE=ON
    LOGABSTRACT=ALL
    PATH=/bin:/usr/bin:/usr/local/bin
    SERVER=`hostname`
    RECYEAR=`date +%Y`
    RECMONTH=`date +%Y%m`
    MAILDIR=$HOME/mail
    MAILDIRchk="`test -d $MAILDIR || mkdir -p $MAILDIR`"
    BACKUPDIR=$HOME/Backup
    BACKUPDIRchk="`test -d $BACKUPDIR || mkdir -p $BACKUPDIR`"
    BACKYEARDIR=$HOME/Backup/$RECYEAR
    BACKYEARDIRchk="`test -d $BACKYEARDIR || mkdir -p $BACKYEARDIR`"
    BACKUP=$BACKYEARDIR/$RECMONTH.backup
    LOGDIR=$HOME/MailLog/$RECYEAR
    LOGDIRchk="`test -d $LOGDIR || mkdir -p $LOGDIR`"
    LOGFILE=$LOGDIR/$RECMONTH.log.$SERVER
    
  • 错误消息已报告给发送者:(

    <[email protected]> (expanded from <[email protected]>): Command
        time limit exceeded: "procmail -a "$EXTENSION"". Command output: procmail:
        [44927] Mon May 18 15:48:12 2020 procmail: Assigning "LOGABSTRACT=ALL"
        procmail: Assigning "PATH=/bin:/usr/bin:/usr/local/bin" procmail: Executing
        "hostname" procmail: Assigning "SERVER=mail-vm" procmail: Executing
        "date,+%Y" procmail: Assigning "RECYEAR=2020" procmail: Executing
        "date,+%Y%m" procmail: Assigning "RECMONTH=202005" procmail: Assigning
        "MAILDIR=/home/lpr_cxa/mail" procmail: Executing "test -d $MAILDIR || mkdir
        -p $MAILDIR" procmail: Assigning "MAILDIRchk=" procmail: Assigning
        "BACKUPDIR=/home/lpr_cxa/Backup" procmail: Executing "test -d $BACKUPDIR ||
        mkdir -p $BACKUPDIR" procmail: Assigning "BACKUPDIRchk=" procmail:
        Assigning "BACKYEARDIR=/home/lpr_cxa/Backup/2020" procmail: Executing "test
        -d $BACKYEARDIR || mkdir -p $BACKYEARDIR" procmail: Assigning
        "BACKYEARDIRchk=" procmail: Assigning
        "BACKUP=/home/lpr_cxa/Backup/2020/202005.backup" procmail: Assigning
        "LOGDIR=/home/lpr_cxa/MailLog/2020" procmail: Executing "test -d $LOGDIR ||
        mkdir -p $LOGDIR" procmail: Assigning "LOGDIRchk=" procmail: Assigning
        "LOGFILE=/home/lpr_cxa/MailLog/2020/202005.log.mail-vm" procmail: Opening
        "/home/lpr_cxa/MailLog/2020/202005.log.mail-vm"
    Reporting-MTA: dns; mail.destination.tld
    

问题:Postfix 中是否有任何配置设置,使得不报告由于 procmail 故障而导致的错误 - 但仍然报告所有其他错误?

[[添加]]

看来 bogofilter 存在超时问题

procmail: Executing "bogofilter,-uep"
procmail: [44927] Mon May 18 16:04:13 2020
procmail: Timeout, terminating "bogofilter"
procmail: [44927] Mon May 18 16:04:13 2020
procmail: Rescue of unfiltered data succeeded
procmail: [44967] Mon May 18 16:04:15 2020
procmail: Timeout, terminating "bogofilter"
procmail: [44967] Mon May 18 16:04:15 2020
procmail: Rescue of unfiltered data succeeded
procmail: Assigning "SPAMASSASIN=spamc"
procmail: Assigning "JUNK=Junk"
procmail: Assigning "LASTFOLDER=/home/lpr_cxa/Backup/2020/202005.backup"
procmail: Opening "/home/lpr_cxa/Backup/2020/202005.backup"
procmail: Acquiring kernel-lock

相关内容