MTA integration
From Zarafa wiki
Alorovyzyw (Talk | contribs) |
Ddebyttere (Talk | contribs) m (Reverted edits by Alorovyzyw (talk) to last revision by Elentirmo) |
||
| Line 1: | Line 1: | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
== Delivery of email == | == Delivery of email == | ||
| Line 33: | Line 25: | ||
flags= user=vmail argv=/usr/bin/zarafa-dagent ${user} | flags= user=vmail argv=/usr/bin/zarafa-dagent ${user} | ||
| - | '''Note:''' do not forget the | + | '''Note:''' do not forget the <space> before ' flags='. |
The ''vmail'' user should be added as a local user to the Linux system: ''adduser vmail'' | The ''vmail'' user should be added as a local user to the Linux system: ''adduser vmail'' | ||
| Line 135: | Line 127: | ||
/etc/exim4/update-exim4.conf | /etc/exim4/update-exim4.conf | ||
Change the line | Change the line | ||
| - | dc_localdelivery= | + | dc_localdelivery=<something> |
to | to | ||
dc_localdelivery=zarafa_pipe | dc_localdelivery=zarafa_pipe | ||
Revision as of 09:11, 24 November 2010
Contents |
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.
Postfix
Modify your /etc/postfix/main.cf 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/main.cf 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/master.cf 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.
Qmail
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.
Procmail
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] EXITCODE=$?
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.
Prerequisites:
- 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
/etc/exim4/conf.d/transport/30_exim4-config_zarafa_pipe
with the following content.
zarafa_pipe:
debug_print = "T: zarafa_pipe for $local_part@$domain"
driver = pipe
path = "/bin:/usr/bin:/usr/local/bin"
command = "/usr/bin/zarafa-dagent $local_part"
return_path_add
delivery_date_add
envelope_to_add
zarafa_pipe_junk:
debug_print = "T: zarafa_pipe for $local_part@$domain"
driver = pipe
path = "/bin:/usr/bin:/usr/local/bin"
command = "/usr/bin/zarafa-dagent -j $local_part"
return_path_add
delivery_date_add
envelope_to_add
- Then create
/etc/exim4/conf.d/router/700_exim4-config_zarafa
with this content.
zarafa_junk:
debug_print = "R: zarafa junk for $local_part@$domain"
driver = accept
domains = +local_domains
check_local_user
transport = zarafa_pipe_junk
require_files = +/usr/bin/zarafa-dagent
no_verify
no_expn
condition = "${if def:header_X-Spam-Flag: }"
zarafa:
debug_print = "R: zarafa for $local_part@$domain"
driver = accept
domains = +local_domains
check_local_user
transport = zarafa_pipe
require_files = +/usr/bin/zarafa-dagent
no_verify
no_expn
- Continue with editing
/etc/exim4/update-exim4.conf
Change the line
dc_localdelivery=<something>
to
dc_localdelivery=zarafa_pipe
- Activate the new config with
#> update-exim4.conf #> /etc/init.d/exim4 restart
XMailServer
The XMailServer as MTA can also be integrated (community contribution).