Difference between revisions of "HowTos/MTA Integration"

From Scalix Wiki
Jump to: navigation, search
(chironoc)
m (Removing (accidental?) link.)
 
Line 49: Line 49:
 
  # m4 sendmail.mc > sendmail.cf
 
  # m4 sendmail.mc > sendmail.cf
  
NOTE: If you get an error message like that ''[["sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory"]]'' you need to install the SENDMAIL-CF rpm package.
+
NOTE: If you get an error message like that ''"sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory"'' you need to install the SENDMAIL-CF rpm package.
  
 
run omsendin
 
run omsendin

Latest revision as of 18:10, 21 March 2012

dronle Scalix Wiki -> How-Tos -> MTA Integration

Basic MTA configuration

By default, the MTA will not be visible to the outside world; this means it must be configured not to listen on the system's external IP address.

Postfix configuration

With Postfix, this configuration is archieved by setting the inet_interfaces parameter. As with most configuration changes, this should be done using postconf and the MTA be restarted afterwards:

postconf -ev inet_interfaces=loopback-only

This has to be added to /etc/postfix/main.cf:
local_recipient_maps=
Then do /etc/init.d/postfix restart

Outgoing Internet Traffic

The Scalix service router places messages adressed to Internet/SMTP recipients on the ROUTER queue. This queue is being processed by the outgoing Internet mail gateway, the unix.out process. Depending on the format selected for the recipient (MIME or TNEF), the message is being transformed and finally a RFC-2822 compliant message is being generated.

The message is then handed over to the operating system's MTA through a local SMTP conversation. The MTA is invoked through the command line interface; the exact command to be used is specified in /var/opt/scalix/sys/unix.mapper, e.g.

transport-service = /usr/sbin/sendmail -bs

Note: This configuration will also work with Postfix as it provides a /usr/sbin/sendmail by default that will emulate a number of sendmail options; the -bs option for local SMTP mode is one of them.

The message will then be processed by the MTA as usual. A few special configurations require additional configuration.

Smarthost configuration

Setting up a Smarthost with sendmail

To set up a Smarthost (with authentication) in sendmail, we have to create the File /etc/mail/auth/client-info and modify the sendmail.mc.

The content in /etc/mail/auth/client-info is our Login on the Smarthost.

Example /etc/mail/auth/client-info

AuthInfo:<smarthost> "U:<username>" "I:<account>" "P:<password>"
AuthInfo:mailto.provider.com "U:my_email@provider.com" "I:my_email@provider.com" "P:Uh_this_is_secret"

Now build the Database with

# cd /etc/mail/auth/ && makemap hash client-info < client-info

The next step is to tell sendmail, that all outgoing Mail is send via Smarthost

Edit the /etc/mail/sendmail.mc and insert before the line MAILER_DEFINITIONS

...
define(`SMART_HOST', mailto.provider.com)dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo', `hash /etc/mail/auth/client-info')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
...

and build the sendmail.cf

# m4 sendmail.mc > sendmail.cf

NOTE: If you get an error message like that "sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory" you need to install the SENDMAIL-CF rpm package.

run omsendin

# omsendin

Setting up a Smarthost with Postfix

To setup the smarthost in Postfix, execute the following commands to reconfigure and restart Postfix:

postconf -ev <relayhost>[:<portnumber>]
/etc/init.d/postfix restart

Configurations without DNS

t.b.d.

Setting up sendmail without DNS

t.b.d.

Routing local messages into Scalix

Some applications on the Scalix server will also submit messages via /usr/sbin/sendmail or similar. If the recipient of the message is a local Scalix user, the message must be passed on to Scalix as if it was an incoming Internet mail message. Therefore, the MTA will have to recognize the message recipient as local.

Mapping local recipients with sendmail

To bar sendmail sending local Mail thru the Smarthost, tell him your local processed Mail-Domains. For this, insert your domains in the file /etc/mail/local-host-names.

This file should look like

localhost
scalix.localdomain
mylocaldomain.com
anotherlocaldomain.org

run make in /etc/mail

# cd /etc/mail && make

run omsendin

# omsendin

Mapping local recipients with Postfix

t.b.d.