MTA integration

From Zarafa wiki

Revision as of 22:27, 23 November 2010 by Alorovyzyw (Talk | contribs)
Jump to: navigation, search


Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page


Delivery of email

To deliver an email into a user's inbox, you need to use the zarafa-dagent program. The zarafa-dagent will read an SMTP email message from the standard input or a file. A parameter to the zarafa-dagent is needed to select the store to deliver the incoming message to. A few examples are given for different email servers.


Modify your /etc/postfix/ file, and set the mailbox_command to:

mailbox_command = /usr/bin/zarafa-dagent "$USER"

For this configuration to work, the users need to be present in both unix and Zarafa databases. If you are using virtual users, please consult our Postfix/LDAP documentation. An alternative configuration is as follows, where users do not need to be in the unix database. Modify your /etc/postfix/ file, and set the mailbox_transport to:

local_recipient_maps = 
mailbox_transport = zarafa:
zarafa_destination_recipient_limit = 1

Add the following line to the /etc/postfix/ file:

zarafa unix - n n - 10 pipe
 flags= user=vmail argv=/usr/bin/zarafa-dagent ${user}

Note: do not forget the <space> before ' flags='.

The vmail user should be added as a local user to the Linux system: adduser vmail

Change the following option in the /etc/zarafa/server.cfg file:

local_admin_users = root vmail

This makes sure that vmail can login to any store without a password, which is required for email delivery.

Please also note that in this setup, the ${user} part will be "guessed" by postfix, using the first part of the email address. Aliases need to be setup in the postfix' aliases hash map or via virtual alias maps in LDAP.


Place in your $HOME/.qmail file a line containing:

| /usr/bin/zarafa-dagent -q [user name]

The [user name] tag needs to be replaced with the name of the user to correctly deliver the email. The -q switch is to notify the zarafa-dagent program to return qmail style error codes. When an email can temporarily not be delivered, it will stay in the qmail queue, which will try to deliver the email again later.


Create a file called .procmailrc in the users home directory. If you have virtual users, you can create a global /etc/procmailrc file. Please read the email delivery section in the Advanced configurations chapter on more procmail details and setups. This chapter can be found in the Linux installation documentation from the main site.

A simple procmailrc file should contain the following lines:

:0 w
| /usr/bin/zarafa-dagent [user name]

The w after the :0 tells procmail to wait for the zarafa-dagent to finish. You can also type the c flag to make a 'carbon copy' of the email. This way, your email will be delivered to Zarafa as well as your normal Mailbox or Maildir. Again, [user name] needs to be replaced with the name of the user. If you have a system wide /etc/procmailrc file and unix login names are the same as Zarafa user names, you can replace [user name] with $LOGNAME.

Exim4-Integration with Spam-Detection

The following setup works fine with our company-mailserver which is a Debian Lenny running Zarafa 6.20.


  • Debian-Server (or compatible)
  • Exim4-Server with split configuration and working spamchecker (which sets the header "X-Spam-Flag: Yes")
  • Zarafa 6.20 with the db-plugin (other plugins might need other settings for verifying users)

  • Create a basic setup using
dpkg-reconfigure plow exim4
  • Create the file

with the following content.

       debug_print = "T: zarafa_pipe for [email protected]$domain"
       driver = pipe
       path = "/bin:/usr/bin:/usr/local/bin"
       command = "/usr/bin/zarafa-dagent $local_part"
       debug_print = "T: zarafa_pipe for [email protected]$domain"
       driver = pipe
       path = "/bin:/usr/bin:/usr/local/bin"
       command = "/usr/bin/zarafa-dagent -j $local_part"
  • Then create

with this content.

       debug_print = "R: zarafa junk for [email protected]$domain"
       driver = accept
       domains = +local_domains
       transport = zarafa_pipe_junk
       require_files = +/usr/bin/zarafa-dagent
       condition = "${if def:header_X-Spam-Flag: }"
       debug_print = "R: zarafa for [email protected]$domain"
       driver = accept
       domains = +local_domains
       transport = zarafa_pipe
       require_files = +/usr/bin/zarafa-dagent
  • Continue with editing

Change the line



  • Activate the new config with
#> update-exim4.conf
#> /etc/init.d/exim4 restart


The XMailServer as MTA can also be integrated (community contribution).

Personal tools