X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/0f4bcee75353935ff9bc605f7e0b31d12e302605..700c128727523a5d4535a4e40b0204bf3e1df2c4:/procmail/deliver diff --git a/procmail/deliver b/procmail/deliver index 5a4f355..af2f70c 100644 --- a/procmail/deliver +++ b/procmail/deliver @@ -1,6 +1,15 @@ +:0 +*$ DEST ?? ^$NULL$ +{ + LOG="deliver: sending message $MSGID to $DEST$NL" + + :0 + $NULL +} + :0 * ! DEST ?? . -{ DEST="$DEFAULT" } +{ DEST=/ } :0 * DEST ?? .+[^/]$ @@ -11,16 +20,24 @@ { DEST="$MATCH" } :0 -*$ DEST ?? ^\. -{ } - -:0 E +*$ ! DEST ?? ^\. { DEST=".$DEST" } -TRAP="DEST=\"\${LASTFOLDER#$BASE/}\"; - echo \"delivered: \$DEST\" >> '$THISLOGFILE'; - $TRAP" +:0 +* MARK_READ ?? . +{ + LOG="deliver: marking messages $MSGID as read because of $MARK_READ$NL" + TRAP="$TRAP; BASENAME=\"\${DESTFILE##*/}:2,S\"" + TRAP="$TRAP; DIRNAME=\"\${DESTFILE%/new/*}/cur\"" + TRAP="$TRAP; DESTFILE=\"\$DIRNAME/\$BASENAME\"" + TRAP="$TRAP; mv \"\$LASTFOLDER\" \"$BASE/\$DESTFILE\"" +} -LOG="deliver: delivering message $MSGID to $DEST$NL" :0 -$BASE/$DEST +{ + LOG="deliver: delivering message $MSGID to $DEST$NL" + TRAP="$TRAP; echo \"delivered: \$DESTFILE\" >> '$THISLOGFILE'" + + :0 + $BASE/$DEST +}