-1

I am having a problem sending mail through sendmail. I have configured sendmail and it is fine. I telnetd the localhost and it connects but when i telnet port 25 is says telnet: Unable to connect to remote host: Connection refused. Also the smtp server uses port 25 so is there any way I can switch sendmail to listen to another port. I am using ubuntu. I don't have much experience with the mail server configurations so please help me out.

Thanks

usmanali
  • 109
  • 1
  • 5
  • So you have both Sendmail and another SMTP server running? – Chris S Jan 19 '11 at 16:22
  • Thats exactly the way it is – usmanali Jan 20 '11 at 10:36
  • If I may ask, why are you doing that? Postfix, the default Mail Transfer Agent on Ubuntu, is perfectly adequate for most purposes and usually easier to configure than Sendmail. Running two MTAs on the same server is also likely to cause problems unless you carefully configure both MTAs to avoid each other. – telcoM Mar 15 '18 at 06:34
  • @telcoM Let's just say I was too naive at that time. – usmanali Mar 15 '18 at 06:38
  • 1
    Oh, I didn't notice this was an old question that had been bumped up. Sorry for the noise :-) – telcoM Mar 15 '18 at 06:47

1 Answers1

1

The default server on Ubuntu is postfix which provides SMTP services. It should be able to be configured to listen on any or all of the standard ports SMTP(25), SSMTP(465), and Submission (587). The port used for any of these services should be reconfigurable. Configuration should be in /etc/postfix.com and or /etc/postfix.d. Check the configuration for a port string. man postfix.conf should give you documentation on the configuration.

The command aptitude install postfix-doc will install the postfix documentation package into /usr/share/doc/postfix.doc.

I use Exim4, which does allow the ports to be specified, instead of postfix. You should only have one SMTP package installed. The sendmail interface is provided by the Exim4, postfix, and sendmail packages.

Make sure you have an SMTP program running with the command netstat -lnt | grep :25. This should return at least one line.

Unless you have a static address configure your server to use your ISP's mail relay as a Smarthost. Your ISP may (should) be blocking outgoing connections to the Internet on port 25. This is done to deal with spambots which often run on virus infected PCs.

BillThor
  • 27,737
  • 3
  • 37
  • 69