5

I have a Debian machine (actually a Raspberry Pi) that I would like to use as a rudimentary, outgoing-only mail server over a residential connection, just for kicks. Port 25 is blocked. I would like to set it up as a standalone SMTP server, not a relay. Is that possible?

Comcast gives the impression I can use port 587 instead. http://customer.comcast.com/help-and-support/internet/email-port-25-no-longer-supported/

So does this guy (and a few others): http://dragos.fedorovici.com/exim-alternate-port-587/

But this answer https://serverfault.com/questions/452653/many-isps-is-block-port-25-how-do-i-choose-an-alternative-port/ sounds like 587 is only for use within local networks.

Nothing I have tried works. It would be nice to know if the task is possible.

EDIT: I didn't explicitly mention this, but I would like typical mail servers to be able to receive mail that I send from my machine.

3 Answers 3

1

If your ISP is blocking traffic that you send destined for another host's TCP port 25, you will not be able to set up an outbound mail server.

Conversely, if they are blocking inbound connections to your TCP port 25, other mail servers would not be able to deliver messages to you.

Additionally, it is typically not very effective sending mail directly from dynamic IP space because commonly these netblocks are abused by malware and viruses to send spam and, as a consequence, many mail servers ignore them outright.

Port 25 is the only port used between MTAs for delivery. Other ports you might read about are only used by MUAs (clients) for relay purposes.

You could configure your local MTA to use your ISP's mail relay as a smart host (outbound).

1
  • 1
    I gave up on the idea of operating a proper SMTP node and am just using a smarthost. Sad that small, ad-hoc, DIY web stuff is now a thing of the past (except for IRC I guess)
    – katriel
    Commented Apr 4, 2014 at 2:44
1

Certainly possible, I have 2525 as my SMTP port. Another option is 465 for SMTP over TLS and 587 as already mentioned. Have you checked the home router is not blocking the relevant packets to your Pi?

Check the target port is open with telnet. Through a mobile connection try and talk via telnet to the home system on that port.

Check home ports up (Debian);

sudo netstat -plant

Check open;

remote$ telnet home.example.com 25

Other than that just follow the configs.

2
  • Do typical mail servers listen on port 587? I am getting "Connection timed out" for all my tests.
    – katriel
    Commented Apr 3, 2014 at 21:48
  • They need to be in the config. exim.org/exim-html-current/doc/html/spec_html/… By default 25, 465 only are turned on, you need to add any other ports. eg. "Another two commented-out option settings follow: # daemon_smtp_ports = 25 : 465 : 587 # tls_on_connect_ports = 465" eg my netstat -plant | grep exim gets tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 19183/exim4 tcp 0 0 0.0.0.0:2525 0.0.0.0:* LISTEN 19183/exim4 no 587 Commented Apr 3, 2014 at 23:47
0

Port 25 is now generally considered "legacy SMTP". All my new SMTP boxes have used port 587 for some time now. There is nothing non-standard about it, in fact it is considered the norm today.

See Wikipedia's list of ports.

4
  • So the following is not true? It was written in 2012. "SMTP port 587 is only for MUA submission to a MTA - it's not for MTA's to talk with each other."
    – katriel
    Commented Apr 3, 2014 at 21:46
  • 2
    @katriel that statement is true. Commented Apr 4, 2014 at 0:01
  • @katriel,cpugeniusmv: Note the OP's mention "outgoing-only mail server" (Yes, I know that katriel is the OP). In the context of the question, port 587 is the expected port. Katriel: MUA is your mail program, such as Thunderbird.
    – dotancohen
    Commented Apr 4, 2014 at 8:19
  • 1
    I agree that you can listen on whichever port you like from MUA to MTA, but ultimately the MTA will have to connect to 25 on the next MTA. Since the original MUA and MTA in this scenario are on the same LAN and share the same obstacle of blocked outbound 25, he's stuck with using a smarthost. Commented Apr 4, 2014 at 14:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .