]> git.madduck.net Git - etc/mailfilter.git/blob - procmail/record-delayed-mail

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

rewrite processing of postponed messages
[etc/mailfilter.git] / procmail / record-delayed-mail
1 # create table messages (msgid text unique not null, filename text
2 # primary key not null unique, release_ts integer not null);
3
4 DELAYED_QUEUE_DB=$PMVAR/delayed-queue.sqlite
5
6 DO_QUERY="$SQLITE $DELAYED_QUEUE_DB"
7
8 DATA="$MSGID"
9 INCLUDERC=$PMDIR/sql-escape
10
11 QUERY="insert into messages values ($DATA, '\$DESTFILE', $RELEASE_TS);"
12 TRAP="$TRAP; OUT=\"$(echo \"$QUERY\" | $DO_QUERY 2>&1)\";
13       [ -n \"\$OUT\" ] && echo \"delay:       failed register delayed mail in database: \$OUT\""
14
15 QUERY
16 DATA
17 DO_QUERY
18 DELAYED_QUEUE_DB