LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing port in sendmail, sendmail not working. (http://www.linuxquestions.org/questions/linux-newbie-8/changing-port-in-sendmail-sendmail-not-working-613960/)

flschou 01-16-2008 08:18 AM

Changing port in sendmail, sendmail not working.
 
Hi all,
For over a year now I've been working with linux(trixbox), and herin installed my own mailserver, and when installing the mailserver I needed to change the port for which sendmail listens, port 25. I changed it to port 2525, but my problem is that now when a mail is sent from my server to me(or anyone else) locally, it's not getting anywhere.
In my maillog I have the following: sendmail[1850]: m0GD2U80001850: to=XXXXXX@XXXXX.dk, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30029, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
When I change the port back to 25 it works just fine.
I can telnet localhost 2525, and here do the mail to, rcpt to, data and so on, and it works fine, the mail gets through and all.
But why do I get error on server sent mails, when sendmail is set to listen on port 2525??
It's only a problem when I have my server sent to local emails addys, when sending out of the house, it connects to my mailserver fine to do so.

This has been a puzzle for me in a very long time, and I have been reading boat load of sites to find the solution, can someone pls point in a direction, and not like just have sendmail listen on port 25, cause that's not really an option.

TIA

Regards
Flemming

cconstantine 01-16-2008 09:18 AM

you missed the MSA
 
modern sendmail uses a dual configuration. The mail transport agent (MTA) is what you've been configuring. Probably via a 'sendmail.mc' generating a 'sendmail.cf', probably in your /etc/mail directory. That's fine, you've changed it's listening port from tcp/25 to tcp/2525.

but sendmail also has a message submission agent (MSA) mode. This is just the sendmail engine running with a different configt (the "submit" config.) Many reasons why, beyond my time to explain here...

Anyway. Check your submit.mc (and the generated submit.cf), probably in your /etc/mail directory. The submit.mc usually has a line near the end that says "MTA is over here". And it's normally just [127.0.0.1] -- the square brackets telling it not to do an MX lookup for the named host, just connect straight away.

Now off the top of my head, I don't recall how to tell the *MSA* you've moved the port. But that's what you need to do. :)

-c

Dinithion 01-16-2008 09:20 AM

I'm not sure if I understand your question properly. But SMTP standard assumes your smtp server is listening on port 25 (Or 465 for ssl-tunnel). A MTA (Mail transfer agent) will therefor connect to port 25. If the connection is closed, the MTA assumes there is no SMTP-server on the IP-address (Or a technical error).

So in order to get this to work, you would need a iptable roule to forward traffic from port 25 to 2525.

flschou 01-16-2008 09:59 AM

Hot damn, it's working.
 
Hi Cconstantine and others..
In submit.cf I changed msp to my server local ip, instead of 127.0.0.1 and now it's working, sendmail is connecting through my mailserver and sending mails...this is how I wanted it to work, gr8, thank you C for pointing my in the direction of submit.cf.

Regards
Flemming

cconstantine 01-16-2008 10:03 AM

.
 
Quote:

Originally Posted by flschou (Post 3024545)
gr8, thank you C for pointing my in the direction of submit.cf.

you're welcome!
-c


All times are GMT -5. The time now is 10:39 AM.