no subject logging in SQL

Joolee amavisd at joolee.nl
Mon Oct 27 10:12:36 CET 2014


You could get creative with your SQL queries:

    'upd_msg' =>
      'UPDATE msgs SET content=?, quar_type=?, quar_loc=?, dsn_sent=?,'.
      ' spam_level=?, message_id=?, from_addr=?, subject=LEFT(?, null),
client_addr=?,'.
      ' originating=?'.
      ' WHERE partition_tag=? AND mail_id=?',

MySQL Manual:

LEFT(*str*,*len*)
<http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_left>

Returns the leftmost *len* characters from the string *str*, or NULL if any
argument is NULL.

The only time the subject is visible from the SQL server would be during
the update when monitoring the server with SHOW PROCESSLIST;


On 24 October 2014 21:05, Mark Martinec <Mark.Martinec+amavis at ijs.si> wrote:

> Carsten,
>
>  how can i turn off subject logging in SQL?
>> Everything else should be logged, but not the subject, due to privacy
>> reasons.
>>
>
> It is not configurable, you'd need to change the code, e.g.:
>
>
> --- amavisd~    2014-10-24 20:52:43.705420534 +0200
> +++ amavisd     2014-10-24 21:03:09.181378822 +0200
> @@ -26855,4 +26855,5 @@
>                          $m_id, $from, $subj);
>        # update message record with additional information
> +      $subj = '';  # privacy reasons
>        $conn_h->execute($upd_msg,
>                 $content_type, $q_type, $q_to, $dsn_sent,
>
>
> Mark
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.amavis.org/pipermail/amavis-users/attachments/20141027/4c505d67/attachment.html>


More information about the amavis-users mailing list