Sendmail forwarding

John Arthur lists at
Wed Jun 2 15:07:45 CST 2004

The port used for outgoing SMTP connections can be changed via the
respective *_MAILER_ARGS macros for the various SMTP mailers. In a default
configuration, sendmail uses either the relay mailer (for e.g. SMART_HOST
when no mailer is specified) or the esmtp mailer (when sending directly to
the MX of the recipient domain).

So, if you want all outgoing SMTP connections to use port 2525, you can use
this in your .mc file:

	define(`RELAY_MAILER_ARGS', `TCP $h 2525')
	define(`ESMTP_MAILER_ARGS', `TCP $h 2525')

If you want to use an alternate port only for specific destinations, change
(e.g.) only the RELAY_MAILER_ARGS, and make sure the relay mailer is not
used for anything else. E.g. you can have sendmail use port 2525 only when
sending to your domain with this in your .mc file:
	define(`confRELAY_MAILER', `esmtp')
	define(`RELAY_MAILER_ARGS', `TCP $h 2525')

and then in your mailertable:

This will force sendmail to use port 2525 for connections to
Of course, change 2525 to whatever alternate port number you wish to use.

> -----Original Message-----
> From: linuxsa-bounces at
> [mailto:linuxsa-bounces at]On Behalf Of Jeremy
> Sent: Wednesday, 2 June 2004 11:06 PM
> To: linuxsa at
> Subject: Sendmail forwarding
> Hi,
> Does anybody know if it is possible for sendmail (or qmail) to forward
> mail to another SMTP host running on an alternative TCP port, but only
> for one domain, not for all the domains hosted on the server.
> Thanks,
> Jeremy
> --
> LinuxSA WWW: IRC: #linuxsa on
> To unsubscribe or change your options:

More information about the linuxsa mailing list