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