Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri May 31, 2013 6:02 am 
Offline
Junior Member

Joined: Sat Nov 10, 2012 10:24 pm
Posts: 22
I have setup a new server (LEMP) on Ubuntu 12.04 LTS 64bit following this guide
https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql

But email results in error when using Outlook / Thunderbird (unable to connect to POP)

The /var/mail/logs show no activity at all. Empty file.

Going thru the guide twice, double checking the settings, config files.

When I check Dovecot Step 15, 20 both return 1 (The command should return 1 if it is successful)

Step 25 returns the email address as expected.

Not sure where to go from here or where to look.

PHP info for the server as of now can be found here http://jobied.com/

Any ideas would be great.

Thanks,
Dave


Top
   
PostPosted: Fri May 31, 2013 7:59 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
Are the email ports open on your VPS?

A quick scan of your domain returned no response on the following ports:
- 25 (smtp)
- 110 (pop)
- 143 (imap)
- 465 (smtp secure)
- 587 (alt smtp)
- 993 (imap secure)
- 995 (pop secure)


Top
   
PostPosted: Fri May 31, 2013 9:18 am 
Offline
Junior Member

Joined: Sat Nov 10, 2012 10:24 pm
Posts: 22
I followed all the steps in the guide. Copied the iptable setup as noted in the guide.

https://library.linode.com/securing-your-server#sph_creating-a-firewall

that all looks Greek to me so no idea what I may have done there.


Top
   
PostPosted: Fri May 31, 2013 9:33 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
Code:
#  Allow HTTP and HTTPS connections from anywhere (the normal ports for websites and SSL).
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

#  Allow SSH connections
#
#  The -dport number should be the same port number you set in sshd_config
#
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

<snip>

#  Drop all other inbound - default deny unless explicitly allowed policy
-A INPUT -j DROP
-A FORWARD -j DROP


That looks like it confirms my port scans. You're allowing incoming traffic on ports 80 (http) & 443 (https), as well as 22 (ssh). You've blocked all other ports (including email ports).

I'm not very experienced with iptables so someone else will need to verify this before you take it as gospel, but the following should allow incoming SMTP & POP3 traffic (based on the previous line for port 80):
-A INPUT -p tcp --dport 25 -j ACCEPT
-A INPUT -p tcp --dport 110 -j ACCEPT

# Allow secure pop3 if you're using a an ssl on your email connections
-A INPUT -p tcp --dport 995 -j ACCEPT

You should also verify that your smtp server can't be used as an open relay (you'll need to search for the steps based on your email server of choice).


MSJ


Top
   
PostPosted: Fri May 31, 2013 10:43 am 
Offline
Junior Member

Joined: Sat Nov 10, 2012 10:24 pm
Posts: 22
These are the ports that I need for this set up anyways.

Made sure that your firewall is not blocking any of the standard mail ports (25, 465, 587, 110, 995, 143, and 993)


Top
   
PostPosted: Fri May 31, 2013 11:39 am 
Offline
Junior Member

Joined: Sat Nov 10, 2012 10:24 pm
Posts: 22
I set the iptable rules as follows:

Code:
*filter

# Allow loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use the lo0 interface
-A INPUT -i lo -j ACCEPT
-A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT

# Accept established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow all outbound traffic
-A OUTPUT -j ACCEPT

# Allow HTTP and HTTPS connections
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

# Allow SSH/SFTP
# Change the value 22 if you are using a non-standard port
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Email ports
-A INPUT -p tcp -m state --state NEW --dport 25 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 465 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 587 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 110 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 995 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 143 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 993 -j ACCEPT





# Allow FTP
# Purely optional, but required for WordPress to install its own plugins or update itself.
-A INPUT -p tcp -m state --state NEW --dport 21 -j ACCEPT

# Allow PING
# Again, optional. Some disallow this altogether.
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# Reject ALL other inbound
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT



And reboot server, netstat -ntl results with

$ netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:11211 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 0.0.0.0:993 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::25 :::* LISTEN
tcp6 0 0 :::993 :::* LISTEN
tcp6 0 0 :::995 :::* LISTEN



I have no idea what to do.

Any other ideas?

Thanks all

Dave


Top
   
PostPosted: Fri May 31, 2013 6:05 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
Port 110 (your POP3 mail port) is not in your list of listening ports. Are you sure your mail service is running?


Top
   
PostPosted: Fri May 31, 2013 8:57 pm 
Offline
Junior Member

Joined: Sat Nov 10, 2012 10:24 pm
Posts: 22
At this point I am not sure of anything.

POP3 as in the guide says its using secure only so 110 is not even need since the Dovecot / Postfix is set to secure only.


Top
   
PostPosted: Fri May 31, 2013 11:09 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
movepixels wrote:
POP3 as in the guide says its using secure only so 110 is not even need since the Dovecot / Postfix is set to secure only.

So your email client is set to use secure pop on port 995?


Top
   
PostPosted: Sat Jun 01, 2013 6:22 am 
Offline
Junior Member

Joined: Sat Nov 10, 2012 10:24 pm
Posts: 22
Correct.

I can receive emails to the address now but sending I get the connect to SMTP error.


Top
   
PostPosted: Sat Jun 01, 2013 6:24 am 
Offline
Senior Member

Joined: Mon Sep 12, 2011 3:29 am
Posts: 63
ICQ: 1081190
Website: http://kyhwana.org
AOL: kyhwana
Location: New Zealand
Tried port 465 (ssmtp). Most residential ISPs block port 25 outgoing to SMTP servers that aren't their own (in general) to stop spam.


Top
   
PostPosted: Sat Jun 01, 2013 6:44 am 
Offline
Junior Member

Joined: Sat Nov 10, 2012 10:24 pm
Posts: 22
Yes I currently have it set to 465.
Outlook does the send and receive and no issues but sending from the account just sits there.
Says success but outbox still has the message.
Nothing gets sent but it does not throw errors now.

So getting closer but still no sending.

Will check the mail.log see if anything there stands out.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group