Adding additional minor_ccat and associated maps in config file or custom hook

Mark Martinec via amavis-users amavis-users at amavis.org
Wed May 7 23:12:02 CEST 2014


Thomas,

> Is it possible, in the config file or via a custom hook, to add an
> additional minor_ccat and then the associated _maps to handle things
> like subject line rewrites, quarantining etc, based on the category
> being assigned in a custom hook?

Yes.

All the %*_by_ccat settings base their result on a current
highest contents category (sorted by major first, then minor).
If a custom hook can turn on a suitable ccat soon enough,
the rest of the program will comply.

> Here's the idea.  Add a field "spam_subject_tag_bulk" field to the
> policy sql table.  Then in a custom hook, check the List-Precedence
> header, or for other things that indicate bulk email.  And then to add
> a new CCAT for a recipient - perhaps something like "CC_SPAMMY,2".

Sounds good. Check the attributes is_mlist, is_bulk and is_auto
(in package Amavis::In::Message). The is_mlist is true if a mail
is coming from a mailing list.

> Then add @spam_subject_bulk_maps, and add that map to 
> %subject_tag_maps_by_ccat.

Ok.  The @spam_subject_bulk_maps is not necessary, you can add
a listref directly into %subject_tag_maps_by_ccat if you prefer.

> Could those things be set in either the config file or a hook?
> Or would it involve patching the main code?

The %subject_tag_maps_by_ccat can be adjusted in a config file,
but flagging a "CC_SPAMMY,2" would need to be in a custom hook.

> And would those additions result in the proper subject line rewriting,
> etc? Or would that have to be done manually in the custom hook?

Should be handled correctly by existing code.

   Mark


More information about the amavis-users mailing list