Re: Port 2525 Test sendmail
- From: "Robert Harker" <harker@xxxxxxxxxx>
- Date: 8 Jun 2006 13:51:45 -0700
Understudy wrote:
Is there a way I can do a test mail and
force the test mail to use port 2525.
I think your question has two parts; how to get your local sendmail
daemon
to listen to port 2525 and how to get a remote SMTP client to deliver
to port 2525 on you server. I think you have done the first part.
I suspect you have simply set your daemon port option to listen to
port 2525. The second part is harder. If your new sendmail server
is behind another sendmail server that you can modify, then you can
instruct external sendmail server to use a specific port on the
internal
server to deliver to. On the other hand, if your sendmail server is
the
external relay that the wider Internet delivers to, then it becomes a
bit convoluted.
In the first case you need to change the port sendmail connects to on
the SMTP client host. As far as I know, the only way to do this is in
the mailer definition itself (the M line). If you want to forward all
mail to port 2525, then you can use M4 to change the argument vector
(A= field) for the esmtp and relay mailers:
define(`ESMTP_MAILER_ARGS',`TCP $h 2525')
define(`RELAY_MAILER_ARGS',`TCP $h 2525')
The third parameter to the argument vector is the port to connect to.
If on the other hand you only want to forward for specific domains to
port 2525, then you will have to create a custom mailer. Look in your
new 8.13.6 sendmail.cf file for the mailer definition for the esmtp
mailer and grab those lines. They should look something like this:
Mesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP,
R=EnvToSMTP/HdrFromSMTP, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=TCP $h
The mailer specific rulesets (S= and R=) may be different.
In your sendmail.mc file you will add a modified version of these
lines.
You will change the name of the mailer and you will change its argument
vector. You would add this new mailer with MAILER_DEFINITIONS:
MAILER_DEFINITIONS
`Mhiportesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP,'
`R=EnvToSMTP/HdrFromSMTP, E=\r\n, L=990,'
`T=DNS/RFC822/SMTP,'
`A=TCP $h 2525'
Now that you have added the mailer, you now need to call this new
mailer for specific recipient addresses. You can do this with the
mailertable feature. Add to your sendmail.mc file:
FEATURE(`mailertable')
In the mailertable database make an entry for each host or domain you
want to reroute.
example1.dom hiportesmtp:example1.dom
example2.dom hiportesmtp:example2.dom
You can check that the correct mailer is being called for each
domain with:
sendmail -bv user@xxxxxxxxxxxx
or sendmail -bv -C newconfig.cf user@xxxxxxxxxxxx
What you should see is:
user@xxxxxxxxxxxxxxx deliverable: mailer hiportesmtp,
host example1.dom, user user@xxxxxxxxxxxx
Now if all you want to do is forward mail for a single test address
to port 2525, not mail for the entire domain, then it is doable,
but a bit convoluted. If you are trying to do this on a single host,
you will have to run two sendmail daemons; your old standard sendmail
daemon listening to port 25, and a second sendmail daemon listening to
port 2525 with your new 8.13.6 configuration.
First, for your new 8.13.6 configuration, you will need to set the
daemon port option to use port 2525:
DAEMON_OPTIONS(`Port=2525')
Next, you will need to add a new custom mailer in the existing sendmail
configuration. This is like the example above, except that it
specifies
localhost in the argument vector and it uses the "k" mailer flag (F=)
which allows sendmail to connect back to itself without giving the
"local configuration error" rejection:
MAILER_DEFINITIONS
`Mhiportesmtp, P=[IPC], F=mDFMuXak, S=EnvFromSMTP/HdrFromSMTP,'
^
`R=EnvToSMTP/HdrFromSMTP, E=\r\n, L=990,'
`T=DNS/RFC822/SMTP,'
`A=TCP localhost 2525'
^^^^^^^^^
Next you would configure the mailertable to deliver mail addresses to
the pseudo host "hiport" with the "hiportesmtp" mailer:
hiport hiportesmtp:localhost
The host name in the mailer:host pair does not matter in this case.
Finally you would configure the virtusertable to rewrite the specific
address you want rerouted into user@hiport:
testuser@xxxxxxxxxxx testuser@hiport
Now the way this works is that when sendmail processes the recipient
address "testuser@xxxxxxxxxxx" the virtusertable will first rewrite the
address as:
testuser@hiport
Next for the host "hiport", the mailertable will then call the
hiportesmtp mailer. And finally the "hiportesmtp" mailer will
connect to port 2525 on the localhost.
Again you can verify this with:
sendmail -bv testuser@xxxxxxxxxxx
or sendmail -bv -C newconfig.cf testuser@xxxxxxxxxxxx
What you should see is:
testuser@xxxxxxxxxxxxxx deliverable: mailer hiportesmtp,
host localhost, user testuser@xxxxxxxxxxx
If you want to see the database rewrites you can add the -d60.1 debug
flag before the test address. Before the mailer, host, user triple you
should see:
map_lookup(host, example.dom) => example.dom. (0)
map_lookup(dequote, testuser) => NOT FOUND (0)
map_lookup(host, hiport) => NOT FOUND (68)map_lookup(virtuser, testuser@xxxxxxxxxxx) => testuser@hiport (0)
map_lookup(mailertable, hiport) => hiportesmtp:localhost (0)
Hope this helps
RLH
For info about our "Managing Internet Mail, Setting Up and Trouble
Shooting sendmail and DNS" and a schedule of dates and locations,
please send email to info@xxxxxxxxxx, or visit www.harker.com
Robert Harker Harker Systems
Sendmail and TCP/IP Network Training 4182 Pleasant Hill Rd.
Sendmail, Network, and Sysadmin Consulting Lincoln, CA 95648
harker@xxxxxxxxxx 530-887-9990
.
- Follow-Ups:
- Re: Port 2525 Test sendmail
- From: Understudy
- Re: Port 2525 Test sendmail
- References:
- Port 2525 Test sendmail
- From: Understudy
- Port 2525 Test sendmail
- Prev by Date: Re: Problems with new version of Sendmail 8.13.6
- Next by Date: Re: DNS Changes
- Previous by thread: Re: Port 2525 Test sendmail
- Next by thread: Re: Port 2525 Test sendmail
- Index(es):
Relevant Pages
|
|