Code:
I use Sendmail's 'SMART_HOST' feature to send mail through my ISP's regular SMTP engine. I could send mail via a different port through DynDNS, but that would involve additional costs that I do not want to spend at this time.
I would like to configure QMail to receive mail on ports 10025 and 25 but send on port 25. Obviously, it must still handle any mail sent locally via the internal network.
OK, so outgoing is untouched using port25 outbound.
Incoming listening on post 10025 and ALSO port25?
I assume incoming port 25 to support local LAN email transit?
For outbound you need not change anything. qmail's outgoing requests will be generated from ANY high level port number randomly selected by the daemon to the remote ISP SMTP server at 25. You appear comfortable with using the ISP as a relay at port 25 so enough said. Just get yourself familiar with the 'smtproutes' file and you'll be all set there.
Incoming port 25 is typically configured as a normal process using Life with Qmail or any other configuration guide for qmail that I've seen. You CAN run qmail-smtpd on different concurrent ports by creating different instances of qmail-smtpd. I'll assume that you're going to use daemontools and other DJB tools, again as are commonly referred to by LWQ, etc.
Thus you'll go ahead and prepare your 'run' file for port 25 in typical fashion under /var/qmail/supervise/qmail-smtpd/run and will symlink that folder under /service. At that point you're listening on port 25. Again, all very typical stuff, well documented elsewhere.
Now to create the high port instance of smtpd, in /var/qmail/supervise create a new folder called qmail-smtpd10025 and create the same scripts and environments for the 'run' file and associated logging as you did before.
HOWEVER in this new instance of the 'run' file, you'll need to make a modification to the new port!
Your original qmail-smtpd/run file:
Code:
<snip>
-c 30 -R -u "$VPOPMAILUID" -g "$VPOPMAILGID" 0 smtp \
/usr/local/bin/rblsmtpd -b -C \
</snip>
Your modified qmail-smtpd/run file for port 10025:
Code:
<snip>
-c 30 -R -u "$VPOPMAILUID" -g "$VPOPMAILGID" 0 10025 \
/usr/local/bin/rblsmtpd -b -C \
</snip>
(don't worry if I've got other variables or different order of appearance)
As you'll note, the net of this change was to replace the string 'stmp' with the port number '10025'. If you're a smarty you'll note that the 'smtp' reference is looking at /etc/services to figure out which port 'smtp' corresponds to.
Again, go ahead and symlink this new folder under /service and you should be listening on port 10025 ALSO.
I THINK it's also legal to register a new value in /etc/services and place that string (such as 'myhighsmtp') into the 'run' file instead of hard coding the value for the port number directly. However, there's not much point IMHO.
Did I answer your query?
D.E.R. Management - IT Project Management Consulting