X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/ec33cde8f8ecb3f68c805ce48b4d62838647a739..3b32045cdff2adde99553954828361a4739697d9:/procmail/deliver diff --git a/procmail/deliver b/procmail/deliver index 928d52c..e299423 100644 --- a/procmail/deliver +++ b/procmail/deliver @@ -1,23 +1,33 @@ -VERBOSE=yes :0 -*$ $DEST +*$ DEST ?? ^$NULL$ { - :0 - * DEST ?? .+[^/]$ - { DEST="$DEST/" } - - :0 E - *$ DEST ?? ^\. - { DEST="$BASE/$DEST" } + LOG="deliver: sending message $MSGID to $DEST$NL" - LOG="deliver: delivering message $MSGID to $DEST$NL" :0 - $DEST + $NULL } -:0 E +:0 +* ! DEST ?? . +{ DEST=/ } + +:0 +* DEST ?? .+[^/]$ +{ DEST="$DEST/" } + +:0 +*$ DEST ?? ^$BASE/\/.+ +{ DEST="$MATCH" } + +:0 +*$ ! DEST ?? ^\. +{ DEST=".$DEST" } + +:0 { - LOG="deliver: delivering message $MSGID to default destination$NL" + LOG="deliver: delivering message $MSGID to $DEST$NL" + TRAP="$TRAP; echo \"delivered: \$DESTFILE\" >> '$THISLOGFILE'" + :0 - $DEFAULT + $BASE/$DEST }