[Rspamd-Users] Accepting only certain attachment types for one email address
Jesse Norell
jesse at kci.net
Thu Jan 20 18:20:27 UTC 2022
On Wed, 2022-01-19 at 15:22 +0100, Ralf Hildebrandt wrote:
> Hi!
>
> I have an email adress, which should only receive PDF, plain text and
> maybe HTML -- nothing else.
>
> How do I combine these two restrictions using multimap? My initial
> draft is:
>
> ALLOW_TYPE_TO_ZR {
> type = "combined";
> prefilter = true;
> action = "accept";
> rules {
> type {
> map = "${LOCAL_CONFDIR}/local.d/zr_extensions.map";
> selector = "files:???";
> }
> rcpt = {
> map = "${LOCAL_CONFDIR}/local.d/zr_address.map";
> selector = "rcpts:domain";
> }
> }
> expression = "type & rcpt"
> }
>
> zr_extensions.map contains the allowed extensions, while
> zr_address.map contains the recipient address.
>
> My problem is the selector for the attachment type... ("files:???")
>
Hello,
I imagine the route you were heading might be a bit more elegant, but
if you don't find the requisite selector syntax for that, an
alternative would be to create separate rules to match the file type
and the domain names, and a composite rule to put the two together. (A
filename rule to work from is at
https://community.nethserver.org/t/attachment-blocked/13733/3 - note
that rejects, which you don't want to do there.)
--
Jesse Norell
Kentec Communications, Inc.
970-522-8107 - www.kci.net
More information about the Users
mailing list