[Dovecot] Too stupid for sieve (former maildrop user)

Dieter Knopf dieterknopf at googlemail.com
Fri Sep 17 11:27:44 EEST 2010


Hello,

I just migrated from Postfix/Courier/Maildrop to
Postfix/Dovecot/Deliver/Sieve and don't unterstand the right syntax
for sieve :(
I searched and found many small examples and many links to the RFC,
but nothing was usefull for me (or i didn't unterstand it)

I installed the latest Dovecot-Sieve (hg).

Examples from my maildrop config:

# Filter FROM
if($E =~ /name at domain1\.tld/)
{
 to "$M/.Friends.Name1/"
}

# Filter FROM with OR
if($E =~ /name1 at domain1\.tld/ || $E =~ /name2 at domain2\.tld/)
{
 to "$M/.Friends.Name2/"
}

# Filter Mailinglists
if (/^List-Id: .*<sylpheed\.sraoss\.jp>/)
{
 to "$M/.ML.Sylpheed/"
}

# Filter FROM AND SUBJECT
if($E =~ /fname at domain.tld/ && /^Subject: *foooooo/)
{
 to "$M/.foo/"
}

# Filter TO
 if (hasaddr("name at domain.tld"))
 {
   to "$M/.foo/"
 }

# Or something like this:
if($E =~ /.*@facebookmail\.com/)
{
 if (/^Subject: .*invited you to join the group/)
 {
   to "$M/.Facebook.Invites.Groups/"
 }
 if (/^Subject: .*invited you to the event/)
 {
   to "$M/.Facebook.Invites.Events/"
 }
}

$E was a shortcut for (adressmatching):
 ADDR=getaddr($MATCH)
 E=`echo $ADDR | sed 's/^M//'`

$M was the path to the maildir, like /home/vmail/domain.tld/name

Is that possible? Or is maildrop simple more powerful?

Thank you :-)

Dieter


More information about the dovecot mailing list