ietf-mta-filters
[Top] [All Lists]

A little sieve help

2008-12-10 17:39:48

Hi, I'm in the process of moving my mail to a new server, which will be using sieve instead of procmail. I've run into some difficulty, and this list was the only one I could find mentioned in conjunction with sieve; if this is an inappropriate venue for my questions,
my apologies.

First I tried the conversion script mentioned in:

http://dovecot.org/list/dovecot/2007-March/020895.html

But that didn't produce any output.

I'm trying to turn this procmail script into a sieve script (alterations from real
script in <>):

:0
* ^TO_(online)
| /usr/local/bin/dmail +online

:0
* ^TO_(support|internal)
| /usr/local/bin/dmail +Support

:0
* ^From:(_dot_)ship(_at_)(_dot_)*(<company-name>\.com)
| /usr/local/bin/dmail +SHIPMENTS

:0c
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: to_gmail
| (formail -i"Cc:" -I"To: <user name>@gmail.com" \
              -A"X-Loop: to_gmail" \
 ) | $SENDMAIL -t

:0
| /usr/local/bin/dmail


In sieve, I was thinking something like:

require ["fileinto","regex","envelope"];

if address :is "To" "online" {
 fileinto "online";
} elsif address :is "To" "Support" { fileinto "Support";

if address :is "From" "<ship address>" {
 fileinto "SHIPMENTS";
}

redirect "<user name>@gmail.com";
keep;

stop;


...but I'm really not sure.  I also haven't figured out how to have sieve
insert a header to avoid mail loops like I did with procmail.

Any help much appreciated.

Regards,

--
Patrick Baldwin
Systems Administrator
Studsvik Scandpower
617-965-7455
<Prev in Thread] Current Thread [Next in Thread>