email Ports 25 465 587
I have two accounts one where 587 will not open and the other I successfully opened all mail ports. nano /etc/apache2/ports.conf I added Listen 25 Listen 465 and Listen 587…. and all ports opened.
This account was my first attempt and everyone had a lot to say on how to solve and none were correct. This account I did the same thing but only after adding who know what to account like mail server php mail and so on all from others with bad advice.. so I finally said let me try ports.conf thats when I found out how to open ports… so I added all there listens to ports and apache2 freaked out and wouldn't start.. I took 587 out and restarted apache2 and it was fine but I did have to reinstall apache2 to to get rid of some small errors and everything was fine ports 25 and 465 were now opened.
My problem is why does 587 make apache2 unusable? where can 587 be used that it doesn't want to open and or conflicts with ports.conf Listen?? What could I have possibly added to create this problem?
5 Replies
I tested this out by creating my own Apache web server, and was able to open ports 25, 465, and 587:
nmap -p 25,465,587 my_test_IP
PORT STATE SERVICE
25/tcp open smtp
465/tcp open smtps
587/tcp open submission
Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds
I was able to achieve this by manually downloading Apache on my newly deployed Compute Instance, and configuring my directory /etc/apache2/ports.conf to listen to ports 25,465, and 587:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
Listen 25
Listen 465
Listen 587
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Afterwards, I installed UFW on my Compute Instance, and opened ports 25, 465, and 587. I then confirmed that these rules were successfully added by running sudo ufw status
:
sudo ufw status
Status: active
To Action From
-- ------ ----
25 ALLOW Anywhere
465 ALLOW Anywhere
587 ALLOW Anywhere
However, if you see Status: inactive
when running sudo ufw status
, then you'll need to enable it first.
After confirming that my firewall is allowing my SMTP ports, I then restarted my Apache2 service and saw that my ports were open by running nmap:
systemctl restart apache2
nmap -p 25,465,587 my_test_IP
PORT STATE SERVICE
25/tcp open smtp
465/tcp open smtps
587/tcp open submission
When troubleshooting this, I noticed that if I did not add Listen 25, Listen 465, and Listen 587 to /etc/apache2/ports.conf, the ports were closed despite allowing them in my UFW configuration. If you're seeing your port as closed, it means that your port is accessible, but there is no application listen to it. This guide here explains the port states recognized by nmap.
You'll need to confirm that /etc/apache2/ports.conf is also listening to these ports. The most important command following that is ensuring that you've restarted your Apache service so these changes can take place. It doesn't seem like there's an issue with the Apache service utilizing port 587, but more so there's a configuration issue on your end that is causing this.
To troubleshoot this, you may want to revisit your firewall configurations and Apache service and ensure that you've configured them properly as well as enabling them afterwards.
Lastly, there is also another way to forcibly open port 587, though I'd advise against it unless you're aware of what changes may take place by running these commands in the following guide:
I did all that one one instance and everything is good but the other not sure what I did why these are different netstat -tulpn | more
127.0.0.1:587 0.0.0.0:* LISTEN 65388/exim4
This one 587 isn't working… I'm going to look at what I can do with exim4,,, I believe my problem is there..
the working one I get
:::587 :::* LISTEN 358627/apache2
I don't know why but nobody listens.. I have a problem and I know you're trying to help but the info you gave me isn't what is needed.. You can try with all your instructions and you wont get it working I know I tried all those method's… I went one step further and googled how i can find out why… Here is a comparison of both sites…
netstat -tulpn | more
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.206.111:53 0.0.0.0:* LISTEN 583/named
tcp 0 0 170.187.207.171:53 0.0.0.0:* LISTEN 583/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 583/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 596/sshd: /usr/sbin
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 583/named
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 669/mariadbd
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 65388/exim4
tcp6 0 0 ::1:53 :::* LISTEN 583/named
tcp6 0 0 fe80::f03c:93ff:fe9a:53 :::* LISTEN 583/named
tcp6 0 0 2600:3c02::f03c:93ff:53 :::* LISTEN 583/named
tcp6 0 0 :::22 :::* LISTEN 596/sshd: /usr/sbin
tcp6 0 0 :::25 :::* LISTEN 73889/apache2
tcp6 0 0 ::1:953 :::* LISTEN 583/named
tcp6 0 0 :::26 :::* LISTEN 73889/apache2
tcp6 0 0 :::443 :::* LISTEN 73889/apache2
tcp6 0 0 ::1:587 :::* LISTEN 65388/exim4
tcp6 0 0 :::80 :::* LISTEN 73889/apache2
tcp6 0 0 :::465 :::* LISTEN 73889/apache2
tcp6 0 0 :::81 :::* LISTEN 73889/apache2
udp 0 0 192.168.206.111:53 0.0.0.0:* 583/named
udp 0 0 170.187.207.171:53 0.0.0.0:* 583/named
root@localhost:~# netstat -tulpn | more
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 550/sshd: /usr/sbin
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 601/mariadbd
tcp6 0 0 :::80 :::* LISTEN 358627/apache2
tcp6 0 0 :::81 :::* LISTEN 358627/apache2
tcp6 0 0 :::465 :::* LISTEN 358627/apache2
tcp6 0 0 :::22 :::* LISTEN 550/sshd: /usr/sbin
tcp6 0 0 :::25 :::* LISTEN 358627/apache2
tcp6 0 0 :::443 :::* LISTEN 358627/apache2
tcp6 0 0 :::587 :::* LISTEN 358627/apache2
udp 0 0 127.0.0.1:323 0.0.0.0:* 553/chronyd
udp6 0 0 ::1:323 :::* 553/chronyd
my solution was to restart exim4 with systemctl restart exim4
I added 587 to ports.conf now everything is open here are the sesults…
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.206.111:53 0.0.0.0:* LISTEN 583/named
tcp 0 0 170.187.207.171:53 0.0.0.0:* LISTEN 583/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 583/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 596/sshd: /usr/sbin
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 583/named
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 669/mariadbd
tcp6 0 0 ::1:53 :::* LISTEN 583/named
tcp6 0 0 fe80::f03c:93ff:fe9a:53 :::* LISTEN 583/named
tcp6 0 0 2600:3c02::f03c:93ff:53 :::* LISTEN 583/named
tcp6 0 0 :::22 :::* LISTEN 596/sshd: /usr/sbin
tcp6 0 0 :::25 :::* LISTEN 97082/apache2
tcp6 0 0 ::1:953 :::* LISTEN 583/named
tcp6 0 0 :::26 :::* LISTEN 97082/apache2
tcp6 0 0 :::443 :::* LISTEN 97082/apache2
tcp6 0 0 :::587 :::* LISTEN 97082/apache2
tcp6 0 0 :::80 :::* LISTEN 97082/apache2
tcp6 0 0 :::465 :::* LISTEN 97082/apache2
tcp6 0 0 :::81 :::* LISTEN 97082/apache2
udp 0 0 192.168.206.111:53 0.0.0.0:* 583/named
udp 0 0 170.187.207.171:53 0.0.0.0:* 583/named
udp 0 0 127.0.0.1:53 0.0.0.0:* 583/named
I also want to know about it and that is why I am looking for the solution online and I am glad I found my answer over here. When I was searching for it online, I also found https://oxessays.com/essay-writer website link where I found online essay writers who will write my essay assignments by taking fees to write essay assignments.