sieve-extprogram: How to hand over a variable or pipe a mail so a shell script?

M. Koehler dovecot-ml at makomi.de
Thu May 19 12:40:19 UTC 2016


Hi,

I´m just playing around with sieve-extprogram but it didn´t works like I 
think. I want

a. execute a shell script that get the subject as parameter

my try:

require ["fileinto","variables","envelope","vnd.dovecot.execute"];
if header :contains "Subject" "123test"
     {
         execute :input "${1}" "exec-test";
         keep;
     }

and

require ["fileinto","variables","envelope","vnd.dovecot.execute"];
if header :contains "Subject" "123test"
     {
         execute "exec-test" "${1}";
         keep;
     }

The shell script will create a file with $1 as text. But I didn´t get 
any output - the created file is empty

b. later the complete mail should piped to the shell script

require ["fileinto","variables","envelope","vnd.dovecot.execute"];
if header :contains "Subject" "123test"
     {
         execute :pipe "exec-test";
         keep;
     }

This should (as 
http://hg.rename-it.nl/dovecot-2.2-pigeonhole/raw-file/tip/doc/rfc/spec-bosch-sieve-extprograms.txt 
described) hand over the complete mail to the script But I don´t know 
how I handle the complete mail with a shell script? I think the mail 
will not hand over as a parameter to the shell script, right? But how 
should I store the mail into a file or should I pipe it through a sed 
command line (and so one) into a shell script?

Hope someone could bring some lights into my darkness :)

Best regards,

Michael



More information about the dovecot mailing list