qmail smarthost smtproutes

popowich

EQ Forum Admin
Staff member
Hello,

Would you like to configure a qmail server to relay all outgoing messages to another mail server? The file to create is /var/qmail/control/smtproutes. you can create both entries to forward all e-mail for a domain, or all e-mail regardless of domain. Sorry, but wildcards are not allowed in a standard smtproutes file.

To relay e-mail for a specific domain.com to another mail server create the line:

domain.com:some-other-mail-server.com

To relay all e-mail to another mail server, regardless of the destination domain, create the line:

:some-other-mail-server.com.

It is OK to send e-mail for a few domains to alternate mail servers, and then have a catchall line at the end for any remaining domains, for example:

domain1.com:relay-mail-server.com
domain2.com:relay-mail-server.com
domain3.com:relay2-mail-server.com
:relay3-mail-server.com
 

checkpro

New Email
I hope this is pertinent to this "qmail smarthost smtproutes" posting, so here goes.
I need to configure qmail so that it will act as a smarthost or smartrelay for my Unix (ASP) server which only sends emails out. Due to the implementation of a new Anti-Spam feature in my SonicWall NSA2600 emails sent from the ASP server to domains hosted on my Linux qmail server are not getting to the email server. Emails from the ASP server to all other domains are received with no problem. When I set the qmail server up on my ASP sendmail config as a SMART_HOST in sendmail.cf all emails to domains on hosted on the Linux server began to work but all other domains stopped working. Both servers reside on my local network but because of the way the Anti-Spam feature works there is an internal conflict on the SW between the public and private address of the email server. I need to configure qmail to relay ALL email traffic from the ASP server to wherever it is suppose to go, not just the emails bound for domains it hosts.

Thanks.
 

popowich

EQ Forum Admin
Staff member
Hello,

The above directions are for where email should be relayed after being accepted by qmail.

I believe you are asking how to configure your qmail server to accept and relay email for other computers on your network.

How did your qmail get installed? Was it by following Life with qmail?

Check your qmail-smtpd run file. A typical location for the relay rules is:

/etc/tcprules.d/qmail-smtpd

For port 25 IP based relay you'll need lines such as:

192.168.1.:allow,RELAYCLIENT=""

Don't forget to remake the cdb file when done.

With some more specifics about your particular install of qmail I can help make more specific directions if needed.

Once the above is working you'll need to tell your unix host to relay mail through the qmail server, maybe using the DS option in your /etc/mail/sendmail.cf
 

checkpro

New Email
I'm not the guy who did the install, but I will run all this by him asap. Here is what I have found:
I don't have a tcprules.d on this Linux system.
[root@linux /]# find / -name tcprules*
/usr/local/bin/tcprules
/usr/local/bin/tcprulescheck
/usr/src/qmail/ucspi-tcp-0.88/tcprules.c
/usr/src/qmail/ucspi-tcp-0.88/tcprulescheck.c
/usr/src/qmail/ucspi-tcp-0.88/tcprules.o
/usr/src/qmail/ucspi-tcp-0.88/tcprules
/usr/src/qmail/ucspi-tcp-0.88/tcprulescheck.o
/usr/src/qmail/ucspi-tcp-0.88/tcprulescheck

And a search for qmail-smtpd returns:
[root@linux /]# find / -name qmail-smtpd
/var/log/qmail/qmail-smtpd
/var/qmail/supervise/qmail-smtpd
/var/qmail/bin/qmail-smtpd
/usr/src/qmail/qmail-1.03/qmail-smtpd
/service/qmail-smtpd
All of these are binary.

This is an old server btw:
# uname -a
Linux linux.vsi-hou.com 2.4.21-63.ELsmp #1 SMP Wed Oct 28 23:15:46 EDT 2009 i686 i686 i386 GNU/Linux
 

popowich

EQ Forum Admin
Staff member
Can you paste the contents of /var/qmail/supervise/qmail-smtpd/run in a reply?
 

checkpro

New Email
WoooHooo! Thanks for pointing me in the right direction. We got it working by adding 10.:allow,RELAYCLIENT=" to /etc/tcp.smtp. Our local network is 10.0.1.0/24, so this allows any email generated from a server on the local network to be relayed.:thanks:
 
Similar threads

Similar threads

Top