Page 1 of 2

SMTP Relay and Sendmail interaction

Posted: Thu Nov 30, 2006 6:09 am
by nkm
Hi all

Simple question, as I understand it, the SMTP Relay process listens on port 25, accepts e-mails and if SMTPFILTER=TRUE passes the message to sendmail, where it does it's thing, and passes it back.

However my question is where do I configure RBL testing, as sendmail sees the IP of the machined that relayed the message as 127.0.0.1.

Looking for best practice sort of thing

Regards

Posted: Thu Nov 30, 2006 7:16 am
by Valerion
I usually set up a relay server (in the DMZ) that's in front of Scalix. That machine can then do basic checking (relaying, RBL, etc), and send Scalix the messages that remains. Alternatively you can let sendmail do all the mail relaying, instead of the SMTP Relay, which will still allow for this kind of filtering. I am not sure if any of the other milters can do this, but that is also possible.

Posted: Thu Nov 30, 2006 8:43 am
by nkm
How do I configure sendmail to do this and still allow sendmail and DMTP Relay to interact (both on same server).

Regards

Posted: Thu Nov 30, 2006 9:14 am
by Valerion
To have sendmail listen directly to incoming mail you will have to disable the SMTP relay.

1) omsetsvc -a smtpd n
2) omoff -d0 -w smtpd
3) edit sendmail.mc and change
DAEMON_OPTIONS(`Port=smtp, Addr=127.0.0.1, Name=MTA')dnl
to
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
4) Rebuild sendmail.cf
5) omsendin

In Scalix's case sendmail either needs to listen to the incoming port itself, if you have to know the relay address, or the process passing the information to it needs to handle the RBL, which SMTP Relay can't do as of yet. It may be possible to have a milter read the headers and determine the relays in between, but I don't know of such a milter.

Posted: Mon May 21, 2007 9:16 am
by grahamk
Great answer Valerion, I'm not sure if people will also need to restart sendmail?

Posted: Mon May 21, 2007 12:24 pm
by btisdall
grahamk wrote:Great answer Valerion, I'm not sure if people will also need to restart sendmail?


omsendin takes care of that.

Posted: Wed Jan 16, 2008 3:30 pm
by dbroll
If I apply this solution, I can send mail through the Outlook connector but I can no longer send mail through SWA. I must have something misconfigured somewhere... any ideas?

Thanks!

Posted: Wed Jan 16, 2008 3:48 pm
by techsharp
dbroll:

Here is the post I made and Valerion gives the config for SWA as well

viewtopic.php?t=9747

Posted: Wed Jan 16, 2008 4:05 pm
by dbroll
Thanks techsharp!

I will try it out.

Posted: Wed Jan 16, 2008 5:39 pm
by techsharp
No problem-

basically edit the swa.properties file in /var/opt/scalix/??/webmail

edit the smtpServer line and add :587 to the end of it - for example

swa.email.smtpServer=emailserver.net:587

after that restart tomcat and webmail should work great.

Posted: Wed Apr 30, 2008 2:22 pm
by dougp23
OK, so I thought I would resurrect this thread after a few PMs between me and techsharp.

Here are the changes summarized, Valerion and techsharp can correct me if I am wrong.

STEP 1.

In sendmail.mc change

DAEMON_OPTIONS(`Port=smtp, Addr=127.0.0.1, Name=MTA')dnl

to

DAEMON_OPTIONS(`Port=smtp,Name=MTA')dnl

Rebuild sendmail.cf ( m4 sendmail.mc > sendmail.cf)

STEP2.

Setup the webmail interface.

Edit /var/opt/scalix/xx/webmail/swa.properties

Find the line that starts with

swa.email.smtpServer and add a :587 to the end of the line. For instance, if the line was
swa.email.smtpServer=mail.mymail.com
it should now be
swa.email.smtpServer=mail.mymail.com:587

STEP3.

Edit smtpd.cfg to not listen on port 25

Uncomment SUBMIT=ON. Right above this line add
SMTP=OFF

Find the section that starts with
[SUBMIT]
And add your server name with the port 587 directive, i.e.

[SUBMIT]
Listen=mail.mymail.com:587

Reboot the box just to restart everything!

Posted: Fri May 02, 2008 4:54 am
by ra
Hi,

Will this configuration allow Sendmail to log all incoming and outgoing email in/var/log/maillog?

Posted: Fri May 02, 2008 2:41 pm
by dougp23
Where sendmail logs messages is a function of syslog, but under CentOS4, it is /var/log/maillog.

If you use a different Linux, then:

$ grep mail /etc/syslog.conf
# Log anything (except mail) of level info or higher.
* .info;mail.none;authpriv.none;cron.none
/var/log/messages
# Log all the mail messages in one place.
mail.* /var/log/maillog

You would then see where it is logging all mail messages.

Posted: Thu May 08, 2008 7:18 am
by Valerion
If its just logging you want you can add SMTPFILTER=TRUE to the smtpd.cfg, that will force all emails to go through sendmail, though SMTP Relay is still the primary listener.

Posted: Wed Jun 11, 2008 3:23 am
by phillsky
I have tried to configure scalix and sendmail for this, but it won't work. This is what I have done.

in smtpd.cfg

# Uncomment the following lines to enable the Submission and LMTP listeners
SUBMIT=OFF
SUBMIT=ON
#LMTP=ON

[SUBMIT]
LISTEN=server.mydomain.com:587

in swa.properties

swa.email.smtpServer=server.mydomain.com:587

in sendmail.cf
O DaemonPortOptions=Port=smtp,Name=MTA

restarted tomcat and smtpd and sendmail

lsof -i :25
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
sendmail 22551 root 4u IPv4 12764794 TCP *:smtp (LISTEN)

lsof -i :587
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
omsmtpd 29099 root 4u IPv4 12786539 TCP server.mydomain.com:submission (LISTEN)

Mail in works as expected, but no one can send emails from the webclient. If i do a
omstat -a i see this
SMTP Relay Partially Abor 09:56:05

and in the fatal log i see this.
ERROR SMTP Relay (SMTPD Relay Pr) Wed Jun 11 09:56:05 2008
[OM.DMON 2171] The SMTP Relay could not listen on port 25.
Pid of logging process: 29093

I can't figure out why it still thinks it should listen on port 25