X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/41ea64f4271cd90b8dc99b4b9d8308aa317b2439..0bdaf799927d3d663247f2506f23f28497dbdd37:/procmail/msgid-index diff --git a/procmail/msgid-index b/procmail/msgid-index index 67606fa..caccf83 100644 --- a/procmail/msgid-index +++ b/procmail/msgid-index @@ -1,5 +1,5 @@ # create table messages (sender text not null, recipient text not null, -# subject text not null, msgid text unique not null, filename text primary key +# subject text not null, msgid text not null, filename text primary key # not null unique, timestamp integer, dest text not null); # # create trigger insert_messages_timestamp after insert on messages begin @@ -14,8 +14,9 @@ DATA="$FROM,$NL$ORIGINAL_TO,$NL$SUBJECT,$NL$MSGID" INCLUDERC=$PMDIR/sql-escape QUERY="insert into messages (sender, recipient, subject, msgid, filename, dest) values ( - $DATA, '\\'$THISLOGFILE_REL\\'', '\\'\$DESTFILE\\'')" -TRAP="$TRAP; $DO_QUERY '$QUERY'" + $DATA, '$THISLOGFILE_REL', '\$DESTFILE');" +TRAP="$TRAP; OUT=\"$(echo \"$QUERY\" | $DO_QUERY 2>&1)\"; + [ -n \"\$OUT\" ] && echo \"msgid-index: failed to insert reference into database: \$OUT\"" QUERY DATA