How to transform global maildrop rule to global sieve rule

Discussion in 'Installation/Configuration' started by vistree, Aug 20, 2016.

  1. vistree

    vistree Member HowtoForge Supporter

    Hi,
    I installed a new ispconfig 3 server on Debian 8 (Jessie) together and migrated from an oder server.
    On the old server I used postfix, courier and maildrop.
    The new one is build with dovecot.
    Everything works besides ONE problem: on the old server I created a global maildrop rule in
    /var/vmail/.mailfilter
    There, below the line
    `echo $SIZE >> /var/vmail/$HOST/$USER/ispconfig_mailsize`
    }
    I inserted a cutom rule to deliver mails for defined hosts to a second mailsystem (Zarafa)
    if ( $HOST eq "my-domain1.de" || $HOST eq "my-domain2.de" || $HOST eq "my-domain3.de" )
    {
    `user=vmail /usr/bin/zarafa-dagent $RECIPIENT`
    }

    Is there any way to transform this global rule to a sieve rule? I don't want to create local sieve rules everytime a new user mail inbox is created ....
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    I believe you can configure dovecot's sieve to run external commands but it won't do so out of the box for security reasons. Is there a reason it has to be in a sieve rule? If not, I would handle it at the postfix level - create a transport to run zarafa-dagent in master.cf, then set those domains to use that transport (which can be done in manual postfix config or in ispconfig gui under Email > Mail Routing).
     
  3. vistree

    vistree Member HowtoForge Supporter

    Hi Jesse,
    thanx for your reply. Yes, doing it at postfix level would be much better! But is it possible to have multiple transports? I need to keep the official ispconfig virtual_transport and add an extra one for zarafa. Do you have an example (link) for this kind of configuration?
     
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Yes, postfix defines and uses multiple transports out of the box, and ispconfig adds a few more, you're certainly able to add some custom ones. If a message is sent to multiple recipients and some should deliver with one transport, while others with a different transport, postfix will sort it out and send things where they need to go.

    Get your new master.cf entry defined/tested if needed (http://wiki.zarafa.com/index.php/Postfix_multiserver_setup says zarafa-dagent has an lmtp service, so you may not need to do anything at all), then under Email Routing you add the transports, eg. domain my-domain1.de, type custom, destination lmtp:localhost:2003
     
  5. vistree

    vistree Member HowtoForge Supporter

    Hi Jesse,
    thanx again! I will try to figure out how to set this up with postfix transport maps!
     

Share This Page