Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th November 2011, 08:47
blainarm387 blainarm387 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Question Problems with sending and receiving mail on CentOS

Hello there.

I'm a first-time poster to this site, and I will gladly admit I'm a newbie when it comes to linux and configuring sites. I've done quite a bit of programming in PHP and Javascript, so I'm not completely clueless, but I have to confess to being a bit short on knowledge when it comes to configuring a server.

I have a VPS with a Japanese hosting company, and they provide users with a standard installation using Cent OS 5.5. I went through the guide at http://bit.ly/aRRadF in order to configure it.

For the most part, everything works just fine, though I decided to keep phpmyadmin as using cookies for authentication. However, I can't for the life of me get the mail server to work. I tried setting up Mozilla Thunderbird, but it says that it can't find the settings for my email account.

So next, I tried using Squirrelmail. At first, it told me that it could not connect to the IMAP server. Logging in with a bad username/password combination told me that the login had failed, so I knew that it was working. After poking around a bit, I found that if you don't have a Maildir directory in the user's home directory, Squirrelmail won't work. I put one in, and it let me log in.

But then, we have another problem. Sending mail to anyone other than myself doesn't work. The program doesn't give me any errors, but the mails don't get through. Sending mails from other accounts doesn't work either. A couple of days ago, I sent some test mails, and now, two days later, I'm getting error messages from Mailer-Daemon saying that the server refused all attempts to connect.

Also--and here's the weird thing--when I send a mail to myself via Squirrelmail, it won't show up in my inbox. But then when I log in to my server via SSH and type mail, it shows up fine. But it then tells me that the mail is in the directory /var/spool/mail/[my username].

Connecting to my IMAP server via Telnet seems to work, though I have no clue what to do from there.

I really have no clue as to what is going on here. I have tried doing searches to find the answer for myself, but I really don't know what questions to ask.

That's why I'm here.

Anyway, if anyone can help me I'd really appreciate it.

Warmest regards,

Blain Armstrong
Chiba, Japan
Reply With Quote
Sponsored Links
  #2  
Old 6th November 2011, 12:06
jmerken jmerken is offline
Junior Member
 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 3 Times in 3 Posts
Default hi

Hi Blain,

can you reach the SMTP server from the CentOS server? It seems that the emails arent getting out so that would mean SMTP settings could be wrong..

also make sure no firewall is blocking it. for example you can run iptables -F to flush the rules so you can test.

you will probably find the SMTP settings from this Japanese provider on their help pages..

e.g. I am with one.com and their settings are different :

send.one.com:2525

but it could be something different in your case so you need to find that out first:
e.g.
SMTP Server :mail.yourisp.net
SMTP Port :25

Good luck
Jan
Reply With Quote
The Following User Says Thank You to jmerken For This Useful Post:
blainarm387 (7th November 2011)
  #3  
Old 6th November 2011, 14:02
blainarm387 blainarm387 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hi Jan.

Thank you for replying. I think we might be getting closer to the source of the problem. I tried making a telnet connection to my server at port 25, but to no avail. A telnet connection to port 143 is working fine though.

I actually ran system-config-securitylevel-tui, and it showed that the firewall was disabled. (When installing CentOS, there are no options for enabling/disabling the firewall). I also tried the command iptables -F, and nothing happened.

I am starting to think that the SMTP server might be listening on a different port. How could I go about confirming this?
Reply With Quote
  #4  
Old 6th November 2011, 14:09
blainarm387 blainarm387 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

I actually just run netstat -tap, and couldn't find anything for smtp or postfix. Here's what I got:


Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:imaps *:* LISTEN 8001/dovecot
tcp 0 0 *op3s *:* LISTEN 8001/dovecot
tcp 0 0 localhost.localdomain:10024 *:* LISTEN 7985/amavisd (maste
tcp 0 0 *:mysql *:* LISTEN 3893/mysqld
tcp 0 0 *op3 *:* LISTEN 8001/dovecot
tcp 0 0 localhost.local:dyna-access *:* LISTEN 4190/clamd
tcp 0 0 *:imap *:* LISTEN 8001/dovecot
tcp 0 0 localhost.localdomain:smtp *:* LISTEN 9332/master


Any idea what's going on, and how to fix it?
Reply With Quote
  #5  
Old 6th November 2011, 15:04
jmerken jmerken is offline
Junior Member
 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I do see :
tcp 0 0 localhost.localdomain:smtp *:* LISTEN 9332/master
strange you cannot reach port 25 then..

check your /etc/services file to see what port is linked to smtp

what does service command show >> service --status-all | grep postfix

maybe check the instructions shown in this link:

http://www.linuxmail.info/postfix-sm...owto-centos-6/
Reply With Quote
The Following User Says Thank You to jmerken For This Useful Post:
blainarm387 (7th November 2011)
  #6  
Old 6th November 2011, 16:26
blainarm387 blainarm387 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

OK, we seem to be making progress here. I tried reconfiguring the mail.cf file and now I can receive mail via Squirrelmail,which I couldn't do before.

I tried running service --status-all | grep postfix like you said, and nothing got returned. (Dovecot is working fine).

The changes I made to mail.cf didn't seem to help. Any idea why postfix might not be listening on port 25?
Reply With Quote
  #7  
Old 7th November 2011, 09:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Postfix is listening only on localhost, no on all interfaces. Please set inet_interfaces to all in your main.cf and restart Postfix.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
blainarm387 (7th November 2011)
  #8  
Old 7th November 2011, 13:32
blainarm387 blainarm387 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

I tried that. Several times, in fact. It doesn't seem to be working. Any idea why? I even searched for all instances of inet_interfaces in the file, and it only showed inet_interfaces = all along with the other three that are commented out. Is it possible that there's something else wrong?
Reply With Quote
  #9  
Old 7th November 2011, 13:43
blainarm387 blainarm387 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
 
Default

OK, I've found the problem.

Basically, I'm using this service under a two-week trial period right now. After doing a little digging, I figured out that they block port 25 during the trial period. Once I'm a paying customer, the restriction will be lifted.

A big thank-you to Jan and Falco for all your help. As they say over here, どうもありがとうございました。色々お世話になりました。m(_ _)m
Reply With Quote
Reply

Bookmarks

Tags
dovecot, error, mail, posfix, server

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Email Working ISPConfig3 Squirrelmail and Courier etc Ian Wilson Installation/Configuration 17 19th June 2013 22:58
Postfix/courier/Centos 6 cant send email to external email servers maxtorzito Installation/Configuration 14 7th October 2011 10:56
SquirrelMail login not working glenneh Installation/Configuration 13 9th April 2011 20:01
dovecot: lda: Fatal: Unknown user dpicella Installation/Configuration 1 22nd August 2010 02:59
Sending emails with custom FROM email address merisor Installation/Configuration 4 8th February 2010 16:27


All times are GMT +2. The time now is 22:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.