DevHeads.net

sieve instead procmail?

I'm wondering if anybody knows of a way to include sieve in postfix
instead of procmail? Or are all the sieve implementations so tightly
integrated to the mailer that this is not possible?

I currently have postfix -> procmail -> zarafa, and would like to have
postfix -> sieve -> zarafa. Is that possible via a milter maybe? The
sieve implementation would need to be able to call an external program
to deliver mail, but the rest is standard.

I use postfix -> dbmail, which has sieve included, and like it very
much. And testing zarafa, I'd like to re-use my sieve scripts.

mfg zmi

Comments

Re: sieve instead procmail?

By Stefan =?utf-8?... at 07/22/2009 - 08:11

Since you mentioned procmail, my buest guess is that your
Postfix/Zarafa integration is similar to the wiki page at

<a href="http://zarafa.com/wiki/index.php/MTA_integration" title="http://zarafa.com/wiki/index.php/MTA_integration">http://zarafa.com/wiki/index.php/MTA_integration</a>

This leaves me slightly puzzled, because I can't imagine where you'd
want to plug in a Sieve filter: The setup describe above looks like
the program "zarafa-agent" is doing the final delivery (as far as
Postfix is concerned), which means that ultimately, the decisions on
things like the destination mailbox are made by Zarafa, and not any
intermediate MDA (mail delivery agent).

What excatly are you trying to do with Sieve filtering?

Cheers
Stefan

Re: sieve instead procmail?

By Michael Monnerie at 07/22/2009 - 08:27

Yes, zarafa-dagent delivers, but you can tell it where:
See <a href="http://forums.zarafa.com/viewtopic.php?f=11&amp;t=2759" title="http://forums.zarafa.com/viewtopic.php?f=11&amp;t=2759">http://forums.zarafa.com/viewtopic.php?f=11&amp;t=2759</a>
Example procmail:
:0w
* ^X-Original-To: spam- ... at otherdomain dot example
| /usr/bin/zarafa-dagent $USER -CF Inbox\\SPAM_trapped
EXITCODE=$?

Maybe I can do the same with dovecot-deliver as Ralf suggested. I'll try
this tonight.

mfg zmi

Re: sieve instead procmail?

By Stefan =?utf-8?... at 07/22/2009 - 08:33

You should be aware of <a href="http://wiki.dovecot.org/LDA/Sieve" title="http://wiki.dovecot.org/LDA/Sieve">http://wiki.dovecot.org/LDA/Sieve</a>. Quote:

"Note that Sieve doesn't support running external programs."

Cheers
Stefan

Re: sieve instead procmail?

By Ralf Hildebrandt at 07/22/2009 - 05:17

* Michael Monnerie <michael. ... at is dot it-management.at>:

User dovecot deliver instead of procmail when doing local delivery.
That's it.

Re: sieve instead procmail?

By Benny Pedersen at 07/22/2009 - 09:00

sieve reject does a accept and bounce, its still on to-do to get fixed

Re: sieve instead procmail?

By Michael Monnerie at 07/22/2009 - 05:43

Oh, nice. Only problem is, I'd need to deliver to an external program.
Or did you mean "local" from the postfix POV, and that external delivery
is possible from dovecot, and that dovecot has sieve? (Sorry, don't know
dovecot at all)

So I guess it should be
postfix -> dovecot/sieve -> zarafa
Right?

mfg zmi

Re: sieve instead procmail?

By Ralf Hildebrandt at 07/22/2009 - 05:54

* Michael Monnerie <michael. ... at is dot it-management.at>:

postfix -> local -> dovecot-deliver/sieve -> zarafa
\------> external program

Re: sieve instead procmail?

By Benny Pedersen at 07/22/2009 - 09:26

or add sieve protocol to zarafa

Re: sieve instead procmail?

By Michael Monnerie at 07/23/2009 - 10:32

I'd wish that, but that's not in my possibility.

Just why is there not a simple sieve implementation that rewrites mails
going to ... at y dot z to x+ ... at y dot z and re-calls postfix again. That would
be a simple postfix -> sieve -> postfix setup, and then you can deliver
to any mailserver capable of the "+" mailbox addressing?

mfg zmi

Re: sieve instead procmail?

By Benny Pedersen at 07/23/2009 - 11:40

tryed <a href="http://horde.org/" title="http://horde.org/">http://horde.org/</a> ?

this can be done with postfix header test imho, and dovecot can use + addresing

if it was simple then this maillist wont exists

Re: sieve instead procmail?

By Michael Monnerie at 07/23/2009 - 12:16

You miss the point: I need *sieve* to decide to which folder a mail
should be sent, but instead of actual delivery, it should rewrite the
recipient envelope to x+ ... at y dot z, and return that to postfix. This
way, one could integrate sieve into every mailserver capable of +
addressing.

5 years ago I maybe would have believed it's complicated. It looks very
easy now, thanks to the various lists I'm in. You can learn a lot from
reading here, and that's good for everybody.

(But still, I can't use sieve as I want ;-)

mfg zmi

Re: sieve instead procmail?

By Brian Evans - P... at 07/23/2009 - 12:46

You are using a proprietary MDA. You also mentioned this is across machines.
Once you decide on this, you get what they give you, unless you hack it
yourself.
Sieve is filtering language. So what ever MDA you use, must support it
to use it.

If your MDA does not support specifying folders or manipulating files,
nothing you do will change that.
Dovecot + Sieve works because it is the same machine and simple file
manipulation.

You should take this up with your MDA host as it is not a Postfix issue.