Hello,

I wanted to build a prefilter for a mailbox in order to convert this mailbox into a simple mailing list. Only a very small circle of senders should be able to send to the distribution list (in the following example this is allowed@domain.de). If it should be another sender, he should get a corresponding notification and preferably his original mail forwarded in the attachment.
I have created the following Sieve Code for this purpose:

`require “vacation”;

if anyof (
header :contains “From” “allowed@domain.org
) {
redirect “user1@domain1.org”;
redirect “user2@domain2.org”;
keep;
}
else {
vacation :days 99 :addresses [“list@mydomain.org”] :subject “Not allowed”
“Its not allowed for you to send to that Mailinglist”;
attach :original;
discard;
}
stop;`

Unfortunately this is not validated:

Sieve Parser: line 13: unknown command attach

Is there a workaround for that to do? Or is it not possible to do that with this sieve Version which is in the mailcow dockerized Version?

I would be very happy about help
Regards Wise

I thought I had found the solution myself, because the require "attach"; had been missing at the beginning. Unfortunately the sieve version in Mailcow doesn’t seem to know this function. I get the following error message:

quoted string “attached” where require string expected

Does this function not exist with Mailcow?

Alternatively I tried “reject”. My problem is that I can’t leave the mail in the mailbox if i use reject. I would actually like the mail to stay in the mailbox with a “not allowed” flag or to be moved to an appropriate subfolder.

I would be very happy if someone could help me with this.

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

No one is typing