I'm trying to install and configure Postfix/Dovecot on an EC2 instance running Amazon Linux 2. The documentation I've run across so far talks about opening ports using firewall-cmd or iptables on the EC2 instance. But are these really necessary if using AWS Security Group, wouldn't opening the inbound ports there take care of it?

I know some people want to use their own firewall on EC2 in additional to the AWS Security Group, but my question is it a requirement to use firewall-cmd/iptables so that Postfix/Dovecot can allow users to connect to pop3 their e-mail?


If there's no firewall running on the instance, or the rules allow all traffic, then just opening the ports in the AWS Security Group will suffice. On Amazon Linux, the default rules allow all inbound and outbound traffic.

However, if there is a firewall with restrictive ules running on the instance, you may have to open the ports in the firewall in addition to opening the ports in the AWS Security Group.

Typically, on AWS, people will just use security groups. However, using a local firewall is an option if the situation warrants it.

  • iptables -L returns this: Chain INPUT (policy ACCEPT) target prot opt source destination So that's entirely disabled? – Edward_178118 Aug 25 '19 at 15:59
  • 1
    I think it's more accurate to say it is running and accepting all traffic by default. Practically speaking, you don't need to worry about it, and can just use the security group. – vjones Aug 25 '19 at 16:16

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.