Docunext

  • About

Postfix Notes

April 28th, 2006

Postfix Vacation Autoresponder Howto

Setting up courier-vacation:

1. Needs maildrop - emerge maildrop

1b.Need to edit master.cf - change /usr/local/bin/maildrop to /usr/bin/maildrop

1c.Add this to /etc/postfix/main.cf:

transport_maps = mysql:/etc/postfix/mysql-transport.cf

virtualtransport = $transportmaps

maildropdestinationrecipient_limit = 1

  1. change transport in database to be maildrop: instead of virtual:
  2. Edit /etc/maildrop/maildropmysql.cf
  3. Install courier-maildrop plugin
  4. Config courier-maildrop plugin
  5. Edit /etc/maildroprc
  6. Add .mailfilter to home directory:

    if (/^X-Spam-Flag: *YES/){
    # log this spam mail
    log "SPAM date: $DATE, recipient: $RECIPIENT, sender: $SENDER -> /dev/null"    to "/dev/null"
    # nothing more to do
    exit
    }
    `test -f vacation.msg && exit 1 || exit 0`
    if ($RETURNCODE==1){
       {
       if (!/^List-Unsubscribe:.*/:h )
       {
               if (!/^X-Spam-Flag: YES/:h )
               {
                      #RESPOND="$MAILDIR/$USER.autorespond.msg"
                      RESPOND="vacation.msg"
                      RESPONDDB="$MAILDIR/$USER.autorespond.db"
                      # The following must be one contiguous line
                      cc "| mailbot -t $RESPOND -A 'From: $LOGNAME' -s 'Auto Response: from $LOGNAME' /usr/sbin/sendmail -t -f ''"
               }
       }
       }
    }

    Spamassassin:

    Add to /etc/postfix/master.cf: -o content_filter=spamassassin

Yearly Indexes: 2010 2003 2005 2006 2007 2008 2009 2004 2011 2012 2013 2015 2019 2020