[Dovecot] sieve vacation question
Hello Stephan,
I love to use the vacation extension to build an echo service. I have not to worry about whether to answer or not if the sender is a list, postmaster, mailer-daemon or other crasy thing.
But i like to echo the *complete headers* back. I did not found a solution with sieve yet. Is it really impossible?
Thanks Andreas
Op 6-9-2013 22:40, Andreas Schulze schreef:
Hello Stephan,
I love to use the vacation extension to build an echo service. I have not to worry about whether to answer or not if the sender is a list, postmaster, mailer-daemon or other crasy thing.
But i like to echo the *complete headers* back. I did not found a solution with sieve yet. Is it really impossible?
Well, Sieve is certainly not meant for something like that. To echo the complete message back verbatim you could do the following:
require "envelope"; require "variables"; require "relational";
if envelope :matches "from" "*" { if string :count "gt" "${1}" "0" { redirect "${1}"; } }
Pigeonhole doesn't currently implement anything that could modify that message's body. Only the header can be modified using the editheader extension. That way you could swap from and to and modify the subject, e.g. as follows:
require "envelope"; require "variables"; require "relational"; require "editheader";
if envelope :matches "from" "*" { if string :count "gt" "${1}" "0" { set "sender" "${1}";
if header :matches "from" "*" { set "from" "${1}"; }
if header :matches "subject" "*" { set "subject" "${1}"; }
deleteheader "from";
deleteheader "to";
deleteheader "cc";
deleteheader "subject";
addheader "subject" "ECHO: ${subject}";
addheader "from" "Echo Service <echo@somedomain.tld>";
addheader "to" "${from}";
redirect "${sender}";
}
}
I haven't tested the above only with sieve-test and not in the wild.
Regards,
Stephan.
Am 09.09.2013 10:26 schrieb Stephan Bosch:
Well, Sieve is certainly not meant for something like that. To echo the complete message back verbatim you could do the following: ...
I haven't tested the above only with sieve-test and not in the wild.
Stephan,
thanks for your response. I tried both scripts. They work as expected with the mentioned limitation: no header is echoed back in the body.
But I learned: the editheader extension must be enabled in dovecot.conf :-)
Andreas
participants (2)
-
Andreas Schulze
-
Stephan Bosch