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

virtual_transport = $transport_maps

maildrop_destination_recipient_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:<p></p>

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

Postfix related links:

http://gentoo-wiki.com/Maildrop_configuration#Autoreply