X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/4a3212dc350e8b9584823bf603e3eb71a7528cae..4b042b91f8b7bcec952b1325e8eeeecff557eb22:/procmail/deliver diff --git a/procmail/deliver b/procmail/deliver index 7a7b9a9..168ccdf 100644 --- a/procmail/deliver +++ b/procmail/deliver @@ -1,14 +1,26 @@ :0 -*$ $DEST -{ - LOG="deliver: delivering message $MSGID to $DEST$NL" - :0 - $DEST -} +* ! DEST ?? . +{ DEST=/ } + +:0 +* DEST ?? .+[^/]$ +{ DEST="$DEST/" } + +:0 +*$ DEST ?? ^$BASE/\/.+ +{ DEST="$MATCH" } + +: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