X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/e1a7d701fab28141a9de8e5d3f4d970d29b41e92..fda6a20821ae68a5feedae89864a4465e8b9c3f9:/procmail/msgid-index diff --git a/procmail/msgid-index b/procmail/msgid-index index 102dacc..caccf83 100644 --- a/procmail/msgid-index +++ b/procmail/msgid-index @@ -14,10 +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\\''); - select * from messages where filename = '\\'$THISLOGFILE_REL\\''" -TRAP="$TRAP; case \"$($DO_QUERY '$QUERY')\" in '') - echo 'msgid-index: failed to insert reference into database';; esac" + $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