0

Is an open SMTP port necessary when sending mails from an SMTP server?

From the design perspective, in a client-server architecture, this would not be needed, since SMTP server acts as a client connecting to other SMTP servers to send a mail.

But I'm not sure if the protocol itself requires a connection from outside too?

3

You do not need to have the SMTP port - thatis, TCP 25 - open for incoming requests on the machine (e.g. your laptop) from which you're sending mail via a mailclient.

The SMTP port must be open only in a machine which is used as a SMTP server, i.e. to receive mail (and then either forward it to another mailserver up to its final destination, or deliver to a local inbox).

EDIT: If you need to use a SMTP server running on the same machine, in this case you make sure that the SMTP server is configured to accept SMTP connections from localhost only; it doesn't need to accept connections on port 25 from outside.
An open relay can be a big problem, as it can - and will - be abused to send spam. For this reason, most mailservers e.g. Sendmail, by default configuration, do not accept connections from outside.

  • The case is an application on the same server wants to use SMTP. From outside I want no client using it. – Roland Kofler Apr 6 '16 at 8:30
  • Ok, the application on the server wants to use SMTP. Is it going to connect to a SMTP server running locally on the same machine, or to a remote SMTP server? – dr01 Apr 6 '16 at 8:53
  • SAME server i said – Roland Kofler Apr 6 '16 at 8:55
  • In this case you configure the SMTP server running on the machine to accept SMTP connections from localhost only; it doesn't need to accept SMTP connections on port 25 from outside (a open relay can be a big problem, as it can - and will - be abused to send spam). – dr01 Apr 6 '16 at 9:03
  • if you edit your answer to reflect that it doesn't need to accept SMTP connections on port 25 from outside i can baptise it as the true answer – Roland Kofler Apr 6 '16 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.