I'm trying to set up sendmail
to receive system messages on my real email account. I've set up alias for root and started newaliases
. Now mailq
reports:
Deferred: Connection timed out with mymail.server.com
I suspect it due to ISP blocking port 25 (I cannot telnet on this port to my mail server, telneting with port 587 works fine).
My question is how to configure sendamil, to connect with other servers using port 587 instead of 25? I'm using TurnKey Core (Ubuntu 10.04 based) distro.
You may look into some of the SMTP relay services like changeip.com which can assist with alternative port relaying of SMTP traffic.
The other consideration is that when this occurs with a lot of ISPs, it is because they have restricted the hosting of servers/servicer services within the AUP for the class of services you are subscribed to. If that is the case, then some ISPs may find that violating their AUP is cause for them to drop you as their subscriber or "upgrade" you to (in their view) an appropriate service offering.
Your question is based upon confusion. You have a message that is clearly about outbound mail, and you are asking how to receive inbound mail.
Receiving inbound SMTP mail requires that the rest of the world be able to connect to the SMTP Relay port on your machine — no ifs, buts, maybes, or alternative ports. (Unless they are using MTSes like
exim
and so forth that have come into the 21st century and understandSRV
resource records for_smtp._tcp.
.) If your ISP has prevented the rest of the world from doing this, you are dead in the water to all except the 21st century MTS users. At best you'll have to make do with some store-and-forward arrangement via your ISP.Most ISPs that block ports, however, more usually block you from connecting to the SMTP Relay port on other people's servers on the rest of Internet. That's a concern for sending outbound mail, not for receiving inbound mail. And it's done precisely to stop ISP customers from sending mail directly to other people.
So sort out exactly what is being blocked, and what direction of mail travel you are concerned with.
It is common (and in my mind desirable) for ISPs to block outgoing connections to port 25. This is is a feature which helps prevent spambots on their network from being fully effective. The vast majority of the Spam I block is from infected PCs running spambots.
Your best option is to configure you server to relay via your ISPs relay server. If they are blocking port 25, they will almost certainly provide such a server.
Alternatively, you may be able to use an encrypted and authenticated connection to the submission port (587) on the host you want to send email to. SMTPS (465) is not commonly supported, but may not be blocked if your mail server supports it.
EDIT: Sendmail is likely overkill in your case. Exim4 and Postfix are alternate full implementations which could also be overkill.
postfix
andexim4
tend to be installed more often thansendmail
.One of the relay only SMTP forwarders might be easier more appropriate and easier to configure. These include
esmtp
,msmtp
, andssmtp
. They will forward all mail to other servers, so are not appropriate if you want to receive some mail on the server.In any case you should configure your host as a satellite of your ISP's mail relay. You will also need to setup the appropriate aliasing so that your email is delivered to your desired email address. This is done in
/etc/aliases
forsendmail
,postfix
, andexim4
. These programs may also use /etc/email-addresses to rewrite the sender address.