body_digest in SQL?
Mark Martinec
Mark.Martinec+amavis at ijs.si
Fri Apr 6 01:17:07 CEST 2012
Patrick,
> I'd like to be able to use the body_digest in quarantine handling.
> I see it as macro in notification, which gives me part 1 on my
> TODO list, but I don't see it written to a SQL quarantine table.
> Did I miss it?
You are right, the body digest is available as $msginfo->body_digest,
and also as a macro 'b'. Currently it is stored as a hex-encoded
string of a digest (MD5, but could also be a SHA-1 or SHA-256),
although it may be sensible to change the internal representation
in $msginfo->body_digest to binary and do the encoding to hex or
to base64 or to whatever encoding when externalizing it.
The body_digest is not written to an SQL table msgs, although
it should be fairly easy to do so, just need to add an argument
to the $conn_h->execute($upd_msg...) call in sub save_info_final
and update the SQL clause in $sql_clause{'upd_msg'} accordingly.
And adjust the SQL schema by adding a field to the table.
I can prepare a small patch, although it probably won't find
its way into the release because it would require people to
adjust their schema by adding a field, and currently there is
no change in SQL schema planned between 2.7.0 and a would-be 2.8.0.
Mark
More information about the amavis-users
mailing list