X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/45ff291908a431109c67c04807993f654089e24d..22ae42b9d0e4e2fc052da922ae9c20bc4862940e:/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