This documentation is about integrating SocketMail with Exim to receive incoming mails.
|
Note: MTA integration is the preferred method if your PHP do not have PCNTL module or you want only selected domains to be handled by SocketMail and the rest of the domains to be handled by the existing MTA. |
1. Locate Exim configuration file
Firstly, you must locate Exim configuration file within your server. Usually, Exim configuration file will be named exim.conf. You may issue the following command to locate the file: locate exim.conf
System will response with the list of location where exim.conf file located. Normally, you could find exim.conf in the /etc/ folder.
2. Determine your socketmail-domains file
If during installation, you have chosen other than SocketMail Daemon in the SMTP Definition, as of version 2.2.1 Final release, the Provider Admin will generate and maintain the socketmail-domains file in the /system-files/ folder. The socketmail-domains file is a text file which contains list of domains that managed by SocketMail which was defined in the Provider Admin.
3. Modify exim.conf file
Using your preferred text editor, edit the exim.conf file.
3.1 Define the domain list file
In exim.conf, add line for exim to find the list of domains that managed by SocketMail. Find the following statement:
|
domainlist local_domains = lsearch;/etc/localdomains |
Either below or above (doesn't matter) the line, add the following statements:
|
### SOCKETMAIL
domainlist socketmail_domains = lsearch;/xxx/xxx/socketmail-domains |
Replace /xxx/xxx/ with the full path to socketmail-domains file.
3.2 Variable definition
Find the MAIN CONFIGURATION SETTINGS:
|
######################################################################
# MAIN CONFIGURATION SETTINGS #
###################################################################### |
Towards the end of the section, you will find the ACL (Access Control Lists) section as shown below :
|
#!!#######################################################!!#
#!!# This new section of the configuration contains ACLs #!!#
#!!# (Access Control Lists) derived from the Exim 3 #!!#
#!!# policy control options. #!!#
#!!#######################################################!!# |
Just above the begining of the ACL section (the above section), add the following statements:
|
### SOCKETMAIL
SOCKETMAIL_HOME = /xxx/xxx/public_html/system-files/
SOCKETMAIL_MX = /usr/bin/php -q /xxx/xxx/public_html/system-files/mx.php
SOCKETMAIL_UID = xxxa
SOCKETMAIL_GID = xxxb |
Change
/xxx/xxx/public_html/system-files/ to your correct full path to your socketmail system-files sub folder. Change
/xxx/xxx/public_html/system-files/mx.php to your correct full path to your mx.php in socketmail /system-files/ sub folder.
If you need your full server path you can find it by looking at your phpinfo.php file. The full path can be found by going to phpinfo.php (http://www.mydomain.com/phpinfo.php)
Replace the value xxxa and xxxb with the owner and the group permission for the file mx.php. To find out the owner and the group owner for the file, do a simple ls -l to list the file showing the owner and group owner of the file.
3.3 Define router
Find the Router Configuration section header:
|
######################################################################
# ROUTERS CONFIGURATION #
# Specifies how remote addresses are handled #
######################################################################
# ORDER DOES MATTER #
# A remote address is passed to each in turn until it is accepted. #
######################################################################
# Remote addresses are those with a domain that does not match any item
# in the "local_domains" setting above. |
Right after the section text, insert the following statements:
|
### SOCKETMAIL (router)
socketmail:
driver = accept
domains = +socketmail_domains
transport = socketmail |
3.5 Define transport
Find the Transports Configuration section:
|
######################################################################
# TRANSPORTS CONFIGURATION #
######################################################################
# ORDER DOES NOT MATTER #
# Only one appropriate transport is called for each delivery. #
###################################################################### |
Towards the end of the section, you will find the Retry Configuration:
|
######################################################################
# RETRY CONFIGURATION #
###################################################################### |
Just above the Retry Configuration, insert the following statements:
|
### SOCKETMAIL
socketmail:
driver = pipe
command = SOCKETMAIL_MX ${lc:$local_part}@$domain
current_directory = SOCKETMAIL_HOME
home_directory = SOCKETMAIL_HOME
user = SOCKETMAIL_UID
group = SOCKETMAIL_GID
return_output = true |
4. Restart Exim
Once all the changes made to the exim.conf file, you need to restart Exim so that the changes will take place. Restart command : /etc/rc.d/init.d/exim restart