@Mail System Documentation : v 3.4
The latest version of this file can be found at:
http://atmail.nl/docs/


@Mail Exim Configuration

1 Introduction: What is Exim

2 Configuring Exim for @Mail
    2.1 Verify configuration
    2.2 How Exim receives emails

3 Contact Information


1 Introduction: What is Exim?

Exim is an SMTP (Simple Mail Transfer Protocol) Server for UNIX. Exim is a replacment for Sendmail. Exim is vastly improved over Sendmail in many ways. The most notable is easy configuration and support for mySQL in the Exim configuration file.

2 Configuring Exim for @Mail

If Exim is not currently installed, download and uncompress the tar file. Make sure to edit the Local/Makefile and declare your Spool directory and all your needed options.

Open the /usr/exim/configure file.

If the main configuration section:

Change the variable declarations to match your system as described on the file. Make sure that you add your domains to /etc/localdomains At the bottom of the main configuration section, add the following.

# Change your webserver username
trusted_users = nobody

ATMAIL_HOME = /usr/local/atmail/
ATMAIL_SAVEEMAIL = /www/atmail3/saveemail.pl
ATMAIL_UID = nobody
ATMAIL_GID = nobody

# Optional - If using the SQL database backend for @Mail. Your Exim binary must be
# compiled with mySQL support ( libmysqlclient )
hide mysql_servers = localhost/databaesname/username/password

The above line is only required if you are using the SQL version of @Mail. Exim supports mySQL to query the @Mail user-database before delivering a message. The mysql_servers line requires the hostname of the mySQL server, database name, username and password (the password must be set in mySQL, Exim does not accept a blank password) To use mySQL support Exim must be compiled with libmysqlclient (See the Exim website for more information)

Exim 3.X Configuration:

Follow the above steps to configure @Mail with Exim 3.X

At the top of the Exim configuration file define the following definition:

local_domains = lsearch;/path/to/atmaildir/atmail-domains

This configures Exim to recognize which domain-names to relay email for. The atmail-domains file is used to load
the domain-names used for @Mail ( Use the @Mail Webadmin to add new domain-names )

In the Transports configuration section, add the following:

atmail:
driver = pipe
command = ATMAIL_SAVEEMAIL ${lc:$local_part}@$domain
current_directory = ATMAIL_HOME
home_directory = ATMAIL_HOME
user = ATMAIL_UID
group = ATMAIL_GID
return_output = true

At the top of the Directors section ( or below the system_aliases definition if exists), add the following for the flat-file version of @Mail:

all:
driver = smartuser
transport = atmail

Or for the mySQL support in @Mail:

all:
driver = smartuser
condition = ${lookup mysql{select Account from Users where Account='$local_part@$domain'}}
transport = atmail

If you are running the @Mail POP3 server and want to use the POP before SMTP method to add accepted relay domains to your allowed hosts, add the following line to your Exim configuration. See the POP3 section of the docs for more information on running the @Mail POP3 Server

host_accept_relay = localhost : hostname : 127.0.0.1 : net-lsearch;/usr/exim/relay-access

Exim 4.X Configuration:

At the top of the Exim configuration file define the following definition:

domainlist local_domains = lsearch;/path/to/atmaildir/atmail-domains

This configures Exim to recognize which domain-names to relay email for. The atmail-domains file is used to load
the domain-names used for @Mail ( Use the @Mail Webadmin to add new domain-names )

In the Transports configuration section, add the following:

atmail:
driver = pipe
command = ATMAIL_SAVEEMAIL ${lc:$local_part}@$domain
current_directory = ATMAIL_HOME
home_directory = ATMAIL_HOME
user = ATMAIL_UID
group = ATMAIL_GID
return_output = true

At the top of the Routers section ( or below the routers system_aliases definition if exists), add the following for the flat-file version of @Mail:

atmail:
driver = accept
transport = atmail

Or for the mySQL support in @Mail:

atmail:
driver = accept
condition = ${lookup mysql{select Account from Users where Account='$local_part@$domain'}}
transport = atmail

If you are running the @Mail POP3 server and want to use the POP before SMTP method to add accepted relay domains to your allowed hosts, add the following line to your Exim configuration. See the POP3 section of the docs for more information on running the @Mail POP3 Server

hostlist relay_from_hosts = 127.0.0.1 : net-lsearch;/usr/exim/relay-access

2.1 Verify the configure file and Start / Restart Exim.

Verify the configure file.
root# /usr/exim/bin/exim -C /usr/exim/configure -bV

You should receive similar to:

Exim version 3.32 #4 built 27-Feb-2002 07:38:43
Copyright (c) University of Cambridge 2001

If you recieve any errors, check your syntax in the configure file.

root# killall -HUP exim

or, if exim is not running:

root# /usr/exim/bin/exim -d2 -bd -q30m

Next open the @Mail Webadmin via your webserver and and set the option Mail Configuraiton -> SMTP server = localhost . This is required to send emails from the Web-interface of @Mail. Messages will be relayed locally via the SMTP server.

If you have problems configuring Exim and @Mail view the log file for debugging information:

root# tail -f /var/spool/exim/log/mainlog ( or /var/log/exim/* , depending on your O/S)

2.2 How @Mail receives emails

By configuring the exim with a new rule, all emails to the destination hostname are sent to the @Mail saveemail.pl script for delivery.

The saveemail.pl script receives the recipient of the email via the command line , the headers and body of the message are sent via STDIN.

3 Contact Support

For additional support, please visit our web site, http://webbasedemail.com
Or send us an eMail : support@CalaCode.com