Op 8-9-2015 om 17:15 schreef Michele Locati:
I'm using Dovecot 2.2.9 and I'm having problems configuring multiple vacation actions. The problem is that I'd like to have two different senders and two different messages, selecting the correct case by the recipient email address. I mean, if someone writes me to my email address "to-address1@example.com" I'd like to answer from "from-address1@example.com" with the message "TEST 1". If someone writes me to my email address "to-address2@example.com" I'd like to answer from "from-address2@example.com" with the message "TEST 2".
Here's my script:
require ["fileinto","vacation"];
vacation :addresses ["to-address1@example.com"] :from " from-address1@example.com" text: TEST 1 . ; }
vacation :addresses ["to-address2@example.com"] :from " from-address2@example.com" text: TEST 2 . ;
But the vacation filter doesn't work, and I see this message in the log file:
main script: line X: error: duplicate vacation action not allowed (previously triggered one was here: main script: line Y).
Is there a way to allow multiple vacation actions?
The script you posted will not even compile. There is a stray '}'.
Anyway, you need to selectively trigger vacation responses. Your script tries to send both at all times, which is not allowed by the Sieve specification.
You could do something like this:
require ["fileinto","vacation", "envelope"];
if envelope "to" "to-address1@example.com" { vacation :addresses ["to-address1@example.com"] :from " from-address1@example.com" text: TEST 1 . ; } elsif envelope "to" "to-address2@example.com" { vacation :addresses ["to-address2@example.com"] :from " from-address2@example.com" text: TEST 2 . ; }
Read these for more information:
https://tools.ietf.org/html/rfc5228 https://tools.ietf.org/html/rfc5230
Regards,
Stephan.