Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Jun 01, 2012 1:48 pm 
Offline
Senior Newbie

Joined: Fri Jun 01, 2012 1:27 pm
Posts: 7
I just moved my site from a previous host to Linode, and while I'm not shy when it comes to Linux, I am a newbie when it comes to setting up web servers. I have my site hosted fine and running beautifully. I also wanted to host my email account for that domain. I followed these instruction for my Debian 6 setup. All the tests they suggest showed everything is working. I figured then after that, I could setup Mac Mail to check my mail at mail.website.com. but I receive an error stating mail.website.com is not responding. I know there must be more for me to do, but I don't know what. Can anyone help?

Also, can someone suggest a good guide for setting up webmail on Linode with my setup?


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 1:59 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
There's so many things that can cause email servers not to work, if you provide your domain and linode ip it'll help diagnosis.

What's the output of
Code:
netstat -lpnt
iptables -L -n -v

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 2:20 pm 
Offline
Senior Newbie

Joined: Fri Jun 01, 2012 1:27 pm
Posts: 7
Yes, thank you.

I sent you a PM with the domain and IP.

Here are the outputs you requested.
Code:
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:993             0.0.0.0:*               LISTEN      13143/dovecot   
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      13143/dovecot   
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      3107/mysqld     
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      13143/dovecot   
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      13143/dovecot   
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1358/portmap   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      11176/sshd     
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      13272/master   
tcp        0      0 0.0.0.0:57599           0.0.0.0:*               LISTEN      11082/rpc.statd
tcp6       0      0 :::80                   :::*                    LISTEN      13596/apache2   
tcp6       0      0 :::22                   :::*                    LISTEN      11176/sshd   



Code:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 585K  559M fail2ban-ssh  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           multiport dports 22
 9357  731K ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
    0     0 REJECT     all  --  !lo    *       0.0.0.0/0            127.0.0.0/8         reject-with icmp-port-unreachable
 607K  575M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
  356 22096 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80
   14   764 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:443
   82  4760 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
   22  1272 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8
 1122 66972 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 5/min burst 5 LOG flags 0 level 7 prefix `iptables denied: '
 1328 79192 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 362K   38M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain fail2ban-ssh (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 585K  559M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0     


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 2:39 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
ok postfix isn't running, try running /etc/init.d/postfix start also you're firewall isn't allowing dovecot or postfix, open ports 993 and 25 with whatever firewall you use.

Your dns records are fine :)

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 3:25 pm 
Offline
Senior Newbie

Joined: Fri Jun 01, 2012 1:27 pm
Posts: 7
Okay, I started postfix with the script you supplied
Code:
Starting Postfix Mail Transport Agent: postfix.


Then I opened the ports, the firewall seems to be iptables. I didn't install anything else yet. I opened them with this command:
Code:
iptables -A INPUT -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp --dport 993 -j ACCEPT


Code:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  100  8593 fail2ban-ssh  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           multiport dports 22
   21  2635 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
    0     0 REJECT     all  --  !lo    *       0.0.0.0/0            127.0.0.0/8         reject-with icmp-port-unreachable
  144 12469 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:443
    2   164 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8
   11   704 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 5/min burst 5 LOG flags 0 level 7 prefix `iptables denied: '
   17  1088 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:25
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:993

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  170 22280 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain fail2ban-ssh (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  100  8593 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0 


And they seem to be opened but I'm still getting an error saying the IMAP server is not responding. Now what am I doing wrong :(


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 4:30 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
How did you set up your firewall in the first place? The rules you added are after the reject rule so will be ignored see
Code:
  17  1088 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable 
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:25
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:993


Ideally you should remove the reject rule and set the INPUT policy to REJECT or DROP. That should fix your problem.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 4:47 pm 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
POP3 is 110 (plaintext and STARTTLS) and 995 for SSL. SMTP is 25 for inbound and should use 465 for SSL.


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 11:52 pm 
Offline
Senior Newbie

Joined: Fri Jun 01, 2012 1:27 pm
Posts: 7
obs,

The firewall configuration is the default one that's installed with the Debian image. I didn't configurate it. But with the help of this article, I think I got it working slightly. My incoming is now working. However, my outgoing isn't. Mac Mail keeps saying the SMTP server is not responding. I assume my outgoing server is mail.website.com. What should I test for next? Thanks guys for your help!

Code:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1      627 48805 fail2ban-ssh  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           multiport dports 22
2       21  2635 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
3        0     0 REJECT     all  --  !lo    *       0.0.0.0/0            127.0.0.0/8         reject-with icmp-port-unreachable
4      666 52333 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
5        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80
6        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:25
7        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:993
8        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:465
9        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:110
10       0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:995
11       0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:443
12       1    64 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
13       0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8
14       6   396 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 5/min burst 5 LOG flags 0 level 7 prefix `iptables denied: '
15       6   396 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable


Top
   
 Post subject:
PostPosted: Sat Jun 02, 2012 12:45 am 
Offline
Senior Newbie

Joined: Fri Jun 01, 2012 1:27 pm
Posts: 7
Also, I should add that the outgoing doesn't work whether I use SSL or not. Oddly, even though port 465 is open in iptables, it doesn't show listening in netstat. Also http://www.yougetsignal.com/tools/open-ports/ says the port is closed.


Top
   
 Post subject:
PostPosted: Sat Jun 02, 2012 5:56 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Use port 25 for ssl, the guides here end up with SSL running on port 25. If you still can't connect via SSL try connecting without SSL it could be your ssl config is broken.

Your firewall config works now and your smpt and imap servers are running (I can connect)

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sat Jun 02, 2012 8:03 am 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Some ISPs are blocking any traffic to port 25, forcing clients to use their SMTP servers. In those cases I always recommend 465.

Also, enable smtps in master.cf, eg:

Code:
smtps     inet  n       -       -       -       -       smtpd
  -o smtpd_tls_wrappermode=yes


Top
   
 Post subject:
PostPosted: Sat Jun 02, 2012 11:39 am 
Offline
Senior Member
User avatar

Joined: Thu Nov 24, 2011 12:46 pm
Posts: 139
Location: Mesa AZ
I've listened on 2025 as well as 25 for a very long time on servers that are for client access. It is easier for them to remember.. ISP blocking of port 25 is a good thing IMHO.

Via mobile..

_________________
Kevin a.k.a. Dweeber


Top
   
 Post subject:
PostPosted: Sat Jun 02, 2012 1:56 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Dweeber wrote:
I've listened on 2025 as well as 25 for a very long time on servers that are for client access. It is easier for them to remember.


You have very weird (and stupid) clients if that is true.

Doh, I can't remember a two digit number "25", but I can remember a four digit number that ends in the same two digits that I can't remember.


Top
   
 Post subject:
PostPosted: Sat Jun 02, 2012 2:47 pm 
Offline
Senior Newbie

Joined: Fri Jun 01, 2012 1:27 pm
Posts: 7
Ugg. I know port 25 is blocked by my ISP. What I found odd was that the SMTP failed whether or not SSL was turned on. I did edit my master.cf by Azathoth's suggestion. As soon as I did, netstat shows port 465 is listening, and it was officially opened. However, Mac Mail kept saying the SMTP is not responding.

Then I began to realize that it might not be the server's fault. I began testing the mail on my iPhone, both on wifi and on 3G. Emails were sending without any problems. It seems the problem is with Mac Mail or with the OS. I'll have to poke around because I have no clue what would be blocking outgoing mail traffic. I'm hoping it's just a corrupt preference file. Do you guys know of anything I should try?


Top
   
 Post subject:
PostPosted: Sat Jun 02, 2012 3:11 pm 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
Default SMTP setting for Mac Mail tries 25, 465, 587, in that order. Since it never receives a reply from your server saying that 25 is unavailable, it is probably timing out. Set its SMTP conf to use 465 instead of trying to figure out which port is available.

_________________
/ Peter


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