-1

I have an EC2 running Ubuntu with Kafka installed, I've installed mailutils on the server because I have a script monitoring diskspace on the box and to email me when it reaches a certain threshold eg: 80%.

The Kafka server I've locked down to internal use, if I open all the ports on my outbound security group I can receive the warning from the script to my email.

I would like to lock this down to a port number on my outbound security group but can't seem to do it, I've tried ports 465 and 587. I have looked around online but nothing I found to do what I need, does anyone know what port it is?

Gman
  • 107
  • 4
  • 1
    Possible duplicate of [What ports to open for mail server?](http://serverfault.com/questions/149903/what-ports-to-open-for-mail-server) – Ryan Babchishin Sep 21 '16 at 17:07
  • Not sure why it a duplicate, mine is to do with AWS EC2 security group. Should I edit the title more? – Gman Sep 21 '16 at 17:16
  • @RyanBabchishin Does Postfix use the destination ports as the outbound ports? – Paul Sep 22 '16 at 02:29
  • @Paul SMTP servers will usually connect to other servers on port 25, if that's what you mean. Because SMTP servers listen on that port. – Ryan Babchishin Sep 22 '16 at 03:58
  • @RyanBabchishin I read his question as configuring outbound ports, which are usually not the same as destination ports. – Paul Sep 22 '16 at 04:07
  • @Paul Source ports I think you mean are usually chosen by the OS and don't mean much. Outbound port = destination port. I don't believe there is anything in Postfix to configure the source port, but I haven't bothered to check. It isn't an issue. I believe there would be many source ports, one for each outbound connection (which can be a lot on a busy server). It's not really an SMTP or Postfix specific concept. – Ryan Babchishin Sep 22 '16 at 19:03
  • @RyanBabchishin Some firewalls are configured to prevent anything from connecting to the Internet without specific allow rules, in which case it would be an issue. I may have the terminology wrong, but I do understand that most source ports are chosen randomly within a defined range by most tools. – Paul Sep 22 '16 at 19:10
  • @Paul Really off topic here.. TCP/Firewalls 101 – Ryan Babchishin Sep 22 '16 at 19:11

1 Answers1

1

You're probably looking for TCP port 25.

https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

SMTP by default uses TCP port 25. The protocol for mail submission is the same, but uses port 587. SMTP connections secured by SSL, known as SMTPS, default to port 465 (nonstandard, but sometimes used for legacy reasons).

Ryan Babchishin
  • 6,160
  • 2
  • 16
  • 36
  • Duplicate of http://serverfault.com/questions/149903/what-ports-to-open-for-mail-server?rq=1 – Ryan Babchishin Sep 21 '16 at 17:07
  • Why duplicate, this is specific to AWS EC2 – Gman Sep 21 '16 at 17:13
  • @Gman Not really. AWS has a firewall... this is about opening ports in a firewall. AWS/pfSense/iptables... makes no difference, it's the same answer, same issue. – Ryan Babchishin Sep 22 '16 at 03:52
  • I will remove the question then – Gman Sep 23 '16 at 09:05
  • @Gman You don't need to do that (unless you want to). Your question hasn't been voted closed, which means not enough people agree with my opinion that this is a duplicate. Also, if the answer doesn't work and there is some EC2 specific problem to resolve, you can update your question and get help. I'll retract my vote/comments in that case. Did you try allowing port 25? – Ryan Babchishin Sep 23 '16 at 15:05
  • yes and it works 100% – Gman Sep 23 '16 at 16:47