Re: Port 2525 Test sendmail
- From: Understudy <brendhan@xxxxxxxxxxxxx>
- Date: Sun, 11 Jun 2006 14:38:29 -0400
Robert Harker wrote:
Understudy wrote:Okay, I have to admit I have been slow to respond to this because I desperatly wanted to understand the answer. The fact is this answer goes way over my head. It also appears what I thought was a simple question was not. This is what happens when I don't realize what I am asking. I am going to give some details here because I believe this is a simple question that should have a hopefully simple answer.
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(virtuser, testuser@xxxxxxxxxxx) => testuser@hiport (0)
map_lookup(host, hiport) => NOT FOUND (68)
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
I have FreeBSD boxes at home. I want them to send out the periodicals on port 2525 because my ISP blocks port 25.
All of my home boxes are simple not true DNS boxes. So they send out as root@xxxxxxxxxxxxxxxxxxxx The aliases files has them going to a real email I have with 34sp.com I check my email either at home or on the road with mozilla mail and I want the periodicals to show up there in my inbox for the address shown in the aliases.
I have tried modifying freebsd.mc because there is no sendmail.mc in FreeBSD. This has not gotten my periodicals to me.
I thought if I could simply send a test email on port 2525 I could test some items. Apparently it is not simple to send a test email on port 2525.
So in a nutshell how do I get my periodicals to go out using port 2525.
I aplogize if I made this more complcated than needed.
Sincerely,
Brendhan
.
- Follow-Ups:
- References:
- Port 2525 Test sendmail
- From: Understudy
- Re: Port 2525 Test sendmail
- From: Robert Harker
- Port 2525 Test sendmail
- Prev by Date: Using procmail through virtusertable for non local user?
- Next by Date: sending port irrelevant, was Re: Port 2525 Test sendmail
- Previous by thread: Re: Port 2525 Test sendmail
- Next by thread: sending port irrelevant, was Re: Port 2525 Test sendmail
- Index(es):
Relevant Pages
|
|