13 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Vacation scripting fo...
FromSent OnAttachments
Todd LyonsOct 13, 2005 1:59 pm 
Rolan YangOct 13, 2005 2:15 pm 
Todd LyonsOct 13, 2005 2:50 pm 
moussOct 13, 2005 6:27 pm 
Todd LyonsOct 14, 2005 11:37 am 
moussOct 14, 2005 3:39 pm 
Todd LyonsOct 14, 2005 4:05 pm 
moussOct 15, 2005 5:45 am 
Todd LyonsOct 17, 2005 10:48 am 
Ralf HildebrandtOct 18, 2005 5:21 am 
Todd LyonsOct 18, 2005 8:51 am 
Ralf HildebrandtOct 18, 2005 8:54 am 
Todd LyonsOct 19, 2005 12:12 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] Vacation scripting for maildropActions...
From:mouss (use@free.fr)
Date:Oct 13, 2005 6:27:15 pm
List:net.sourceforge.lists.courier-maildrop

Todd Lyons a écrit :

Hey all, I've been putting together a little bit of scripting to do vacation. It started from the example in the maildropex man pages and now has a few protective things added to it, protective as in not sending auto-replies to list/bulk mail.

1) Has anyone else done this? Google has turned up nothing yet. 2) What I've got so far, does it seem reasonable? Can it be optimized? Anything I can do to result in spawning less shells? (ignoring using gdbm for now)

Management is pretty simple. Put a message in $HOME/vacation.msg (no headers, just message body) and make it owned by the correct user:group and mode 600 and it takes off from there. To turn it off, 'rm -f $HOME/vacation.{msg,lst}'.

Give me some feedback please.

--------- /etc/maildroprc ----------- # Global maildrop filter file

logfile "/var/log/maildrop.log"

DEFAULT="$HOME/Maildir/"

`test -f $HOME/vacation.msg` if ( $RETURNCODE == 0 ) { cc $DEFAULT

/^Precedence:.*/ if ( $MATCH =~ /bulk|list/ ) { log "No vacation message: $MATCH" exit }

/^(X-BeenThere|X-Loop|Mailing-List):.*/ if ( $MATCH ) { log "No vacation message: $MATCH" exit }

/^(From|Return-Path):.*/ if ( $MATCH =~ /MAILER-DAEMON/ ) { log "No vacation message: $MATCH" exit }

/^X-Spam-Status:.*/ if ( $MATCH =~ /Yes/ ) { log "No vacation message: $MATCH" exit }

log "Vacation mail delivery for $LOGNAME" xfilter "reformail -r -t -I 'From: $LOGNAME' -I 'X-Loop: $LOGNAME Vacati on'" /^To:.*/ getaddr($MATCH) =~ /^.*/;

MATCH=tolower($MATCH); flock "vacation.lock" { `fgrep -iqx "$MATCH" vacation.lst 2>/dev/null || { \ echo "$MATCH" >> vacation.lst ; \ exit 1; \ } ` } if ( $RETURNCODE == 0 ) exit to "| (cat - ; echo ''; cat vacation.msg) | $SENDMAIL -t" } else { log "Normal mail delivery for $LOGNAME" to "$DEFAULT" }

see ftp://ftp.rfc-editor.org/in-notes/rfc3834.txt