Hi,

>> need: queue_id macro
>> instead of: message_id macro (%m)
>> 
>> Is there a macro for queue_id in amavis that I can use instead of %m?

> I'm not involved in the Amavis development, so I may easily be wrong in
> this, but what you mean by queue_id? The MX queue id?

Yes, I mean the queue ID of the MX.
> 
> And why do you need it? Can't you just enumerate the spam files in your
> quarantine folder and 'pick' the ones more recent than the last processed
> one?

I am trying to run my own OpenDKIM reputation database. OpenDKIM provides the 
possibility of looking into each mail and check the signature. It also could 
look for X-Spam-Flag or vice versa.

Normally you would run Amavis as a milter in front of OpenDKIM. Amavis would 
check incoming mail for spam/viruses/etc. and reject it on the setting of 
D_REJECT (Germany; in session reject). The problem is that Amavis does reject 
mail directly, if the mail was spam, so OpenDKIM would never ever see mails 
marked being spam _and_ having a DKIM signature.

For this reason I turned the order of the milters. First OpenDKIM, second 
Amavis. So now OpenDKIM sees mail and always treats them as "no spam". It 
stores information in a flat file, which in turn is inserted into a database on 
a cron job basis. To correct the mistake of "each mail is no spam", I must 
store spam mails in quarantine _and_ reject the mail.

A second cron job is looking into quarantine and now I need the quarantine ID. 
If the file name _is_ the queue-ID, I can do a quick search in the database 
"UPDATE foobar SET spam=1 WHERE jobid=Queue-ID". After having done so, I would 
run another OpenDKIM job that calculates reputation scores for each domain. And 
exactly this way I get a live reputation for each domain and on basis of this 
score, even OpenDKIM can decide to accept mail or do whatever.

> Some years ago I developed a small perl script
> (http://www.tomassoni.biz/spamgrass/) to report quarantined messages to
> SpamCop. There you may find some logic to pick the latest drops in the
> quarantine folder, if this is what you need.

Not sure if that might help me :)

-Christian Rößner

--
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
Aufsichtsratsvorsitzender: Joerg Heidrich

Reply via email to