Sendmail forwards to Lyris
Create an alias and tell sendmail to forward email addressed to the alias to Lyris that runs on another port.
The main advantage of this approach is that it will work with virtually any system configuration. Both sendmail and Lyris can coexist on the same machine, without having to assign new TCP/IP
addresses or any other significant system changes.
The only significant disadvantage to this method is that it requires 2 lines of sendmail.cf changes, and a one line DNS entry. The 2 sendmail changes are very simple, and these instructions will
walk you through them.
The first step in using this approach is to define an alias (an alternate name) for your machine.
Please note: You cannot use a DNS CNAME for this purpose, because newer versions of sendmail will often detect the CNAME in the RCPT TO: address and rewrite it to be the host the CNAME
points to (canonical form), thus negating the purpose of creating the CNAME in the first place.
Instead, you should add a new 'A' record in your DNS with the "alias" name, pointing to the same TCP/IP address already used by your machine. There will then be two 'A' records for your TCP/IP
address, defining the two names.
For example, to define an alias called "lists" for a machine named "apollo" you would first locate the line which reads "apollo IN A 184.108.40.206", copy and duplicate that line, defining the alias
name in the second line. Your DNS file would read:
apollo IN A 220.127.116.11 ; the original host name Please consult your network administrator if you need help in doing this.
lists IN A 18.104.22.168 ; the new "alias" host name
Once your alias is configured, go ahead and install Lyris.
You now need to tell Lyris to listen for incoming SMTP connections on an alternate port. Because sendmail will be listening to port 25 (the SMTP standard) you should pick something which does not
conflict. A common choice is port 26.
While you are installing Lyris, you will be given the option to do this through the installation program. Alternatively, you can inform Lyris that it should use the alternate port with the
"smtpport" command line parameter. For example:
Lyris will respond with "Successfully updated SMTP port number"
Finally, you need to define a sendmail rule to tell sendmail to forward mail which is addressed to the alias (the new "DNS A record" you just created) to Lyris that is running on the alternate port.
There are two steps to this. First, you must define a mail delivery agent, then you must define a RULE 0 to look for your alias and use that delivery agent.
You must first define a delivery agent. Edit /etc/mail/sendmail.cf and search for a line which begins with "Mprog", then add this line below it:
Mlyris, P=[TCP], A=TCP localhost 26 $hThis command will eventually allow sendmail to forward mail to an alternate port.
Then, search for a line which reads "S0" and add this line below the "S0":
R$*<$*@lists.$*>$* $#lyris $@lists.$3 $:$1<$2@lists.$3>$4in the above line, change the word "lists." in each of the 3 instances to your alias. For example, if "juno" is the alias for "apollo", you would substitute in the word "juno." at
Here is what the line would look like for a "juno" alias:
R$*<$*@juno.$*>$* $#lyris $@juno.$3 $:$1<$2@juno.$3>$4 Comments:
 searches for "juno." in the RCPT TO: address,
 must be a tab,
 specifies the Lyris delivery agent,
 specifies the hostname
 specifies the username.
This line is not as complicated as it looks: all we've done is instructed sendmail to look for "@juno." In the RCPT TO: address, and forward messages that match this on to Lyris running on port 26.
Very important: the character before $#lyris must be a tab, and all the other blanks must be a space, and must not be a tab. The rule will not work correctly unless this is exactly
Now, restart sendmail. The easiest way to do this is to first "kill" sendmail, then restart it with "/usr/lib/sendmail -bd"
To test that these changes work, start Lyris in the foreground with the "debug" parameter, like this: "lyris start debug". Then send email to the alias name, such as "firstname.lastname@example.org". You
should see immediate activity on the Lyris screen, indicating that the email message was received.
You should also receive a prompt reply to your email message from Lyris.