X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/097c75254f91531513cd2c9a43749e46b8d27e11..2fe122be2f3654cdb90e54d784d4eee8f5058879:/procmail/deliver diff --git a/procmail/deliver b/procmail/deliver index c3188ff..168ccdf 100644 --- a/procmail/deliver +++ b/procmail/deliver @@ -1,30 +1,26 @@ :0 -* DEST ?? . -{ - :0 - * DEST ?? .+[^/]$ - { DEST="$DEST/" } +* ! DEST ?? . +{ DEST=/ } - :0 - *$ DEST ?? ^$BASE/\/.+ - { DEST="$MATCH" } - - :0 - *$ DEST ?? ^\. - { } +:0 +* DEST ?? .+[^/]$ +{ DEST="$DEST/" } - :0 E - { DEST=".$DEST" } +:0 +*$ DEST ?? ^$BASE/\/.+ +{ DEST="$MATCH" } - LOG="deliver: delivering message $MSGID to $DEST$NL" - DEST="$BASE/$DEST" - :0 - $DEST -} +:0 +*$ DEST ?? ^\. +{ } :0 E -{ - LOG="deliver: delivering message $MSGID to default destination$NL" - :0 - $DEFAULT -} +{ DEST=".$DEST" } + +TRAP="DEST=\"\${LASTFOLDER#$BASE/}\"; + echo \"delivered: \$DEST\" >> '$THISLOGFILE'; + $TRAP" + +LOG="deliver: delivering message $MSGID to $DEST$NL" +:0 +$BASE/$DEST