Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot telnet to port 25 on EC2 instance

My security group has the following:

>22 (SSH)   0.0.0.0/0   
>80 (HTTP)  0.0.0.0/0   
>143 (IMAP) 0.0.0.0/0   
>443 (HTTPS)    0.0.0.0/0   
>995 (POP3S)    0.0.0.0/0   
>465 (SMTPS)    0.0.0.0/0   
>25 (SMTP)  0.0.0.0/0

Running a netstat on the server shows the following:

>Active Internet connections (servers and established)
>Proto Recv-Q Send-Q Local Address           Foreign Address         State      
>tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN     
>tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
>tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
>tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN     
>tcp        0      0 10.211.30.202:44025     194.14.0.125:6667       ESTABLISHED
>tcp6       0      0 :::995                  :::*                    LISTEN     
>tcp6       0      0 :::110                  :::*                    LISTEN     
>tcp6       0      0 :::143                  :::*                    LISTEN     
>tcp6       0      0 :::22                   :::*                    LISTEN     
>tcp6       0      0 :::25                   :::*                    LISTEN     
>tcp6       0      0 :::993                  :::*                    LISTEN     

And when I try and access the box from the outside world, I get nothing.

>thedude:~ root$ telnet mail.sd0a.com 25<br />
>Trying 107.20.235.215...<br />
>telnet: connect to address 107.20.235.215: Operation timed out<br />
>telnet: Unable to connect to remote host<br />

Anyone have any positive experiences with Amazon EC2 instances and getting mail to a state where it will work? Its worth noting that via command line, mail seems to go through. System is Ubuntu 12.04.1 LTS if that matters.

like image 628
Joseph Devaney Avatar asked Aug 30 '12 17:08

Joseph Devaney


2 Answers

Might be your ISP filtering outbound connections to port 25/tcp in order to prevent botnet spam.

like image 152
Ansgar Wiechers Avatar answered Oct 17 '22 12:10

Ansgar Wiechers


To eliminate the obvious: Have you tried

  • connect to another port other than 25?
  • connect to another new ec2 instance, port 25? (straightforward task to duplicate it on EC2)
  • connect from another machine (or your friend's PC) to sd0a.com:25?
  • traceroute to identify where the packets are dropped?
  • setup postfix on port 2525 (remember to add that into Security Groups)
  • ufw* on Ubuntu. (Default is off... but good to check)

As far as I can tell, all IP addresses on Amazon EC2 are blacklisted in spamhaus.com (and a lot of other anti-spam list). Hence most likely your ISP is blocking these packets, if so it is IP block or port block?

like image 1
Alvin K. Avatar answered Oct 17 '22 14:10

Alvin K.