LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-20-2011, 08:02 PM   #1
kitek
Member
 
Registered: Apr 2005
Posts: 252

Rep: Reputation: 15
Problems with Postfix accepting outside mail.


CentOS 5.6 fresh install of Virtualmin for web hosting virtual sites. You can email out just find. You can also use a pop3/IMAP client and the server can accept email. If you telnet to port 25, you can send email to. But if you just open up a new email using gmail for example and send an email to a valid receipt on the server. It never appears and so far nothing even has come back. I have made sure in postfix that it is listening on all interfaces and that $mydestination is set. Any ideas why it isn't accepting email from external sources? My ISP isn't blocking, iptables is disabled. When using pingability.com it says

Error There was a problem while talking with the mail server. Got 'ConnectException: Connection refused' You can telnet to is like I said and send email to a user on the server that way.
 
Old 05-20-2011, 08:35 PM   #2
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
I work for an ISP and we just blocked port 25 due to machines being exploited with trojans/viruses and they turn into spambots.

You may want to double check to be sure.

You are running Postfix/dovecot correct?

www.mxtoolbox.com
has tools to check as well

Do you have mx records for your domain, if not you need to setup MX records (mail exchanger) if it is your server in bind. Once set up you should be able to issue the commands like dig.

dig mx yourdomain.com

;; ANSWER SECTION:
youdomain.com 1800 IN MX 10 name.yourmailserver.com

nslookup -q=mx yourdomain.com

yourdomain mail exchanger = 10 name.yourmailserver.com

10 is the weight if you are just running your 1 server you only need one entry

if you need help with a zone file I can assist with bind.

do you have your dns setup?

can you telnet name.yourmailserver.com 25
helo servername.com
ect..

telnet name.yourmailserver.com 143 (imap)

01 login username password
02 list
03 select inbox
04 logout

Last edited by rhbegin; 05-20-2011 at 08:50 PM. Reason: mx
 
Old 05-20-2011, 08:41 PM   #3
kitek
Member
 
Registered: Apr 2005
Posts: 252

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rhbegin View Post
Do you have mx records for your domain?

dig mx yourdomain.com

;; ANSWER SECTION:
youdomain.com 1800 IN MX 10 name.youdomain.com

ect..

do you have your dns setup?
Yes I have my own servers. They are setup in a Slave Cluster.

Code:
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> mx domain.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19820
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;domain.com. IN    MX

;; ANSWER SECTION:
domain.com. 38400 IN MX    5 mail.domain.com.

;; AUTHORITY SECTION:
domain.com. 38400 IN NS    ns2.domain.net.
domain.com. 38400 IN NS    ns3.domain.net.
domain.com. 38400 IN NS    ns4.domain.net.
domain.com. 38400 IN NS    ns1.domain.net.

;; ADDITIONAL SECTION:
mail.domain.com. 38400 IN A xxx.xxx.xxx.xxx
ns1.domain.net.     16181   IN      A      xxx.xxx.xxx.xxx
ns2.domain.net.     19039   IN      A      xxx.xxx.xxx.xxx
ns3.domain.net.     16181   IN      A      xxx.xxx.xxx.xxx

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri May 20 20:37:21 2011
;; MSG SIZE  rcvd: 220
 
Old 05-20-2011, 09:04 PM   #4
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
what are your results from www.mxtoolbox.com ?

does it give back the correct responses?

also there is a diag tab as well

post the results

thanks

Last edited by rhbegin; 05-20-2011 at 09:07 PM.
 
Old 05-20-2011, 09:21 PM   #5
kitek
Member
 
Registered: Apr 2005
Posts: 252

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rhbegin View Post
what are your results from www.mxtoolbox.com ?

does it give back the correct responses?

also there is a diag tab as well

post the results

thanks
220 host3.xxx.xxx.xxx.xxx.net ESMTP Postfix

OK - xxx.xxx.xxx.xxx resolves to host3.xxx.xxx.xxx.xxx.net
OK - Reverse DNS matches SMTP Banner
0 seconds - Good on Connection time
Not an open relay.
0.234 seconds - Good on Transaction time

Session Transcript:
HELO please-read-policy.mxtoolbox.com
250 host3.xxx.xxx.xxx.xx.net [16 ms]
MAIL FROM: <supertool@mxtoolbox.com>
250 2.1.0 Ok [31 ms]
RCPT TO: <test@example.com>
554 5.7.1 <test@example.com>: Relay access denied [16 ms]
QUIT
221 2.0.0 Bye [31 ms]
dns lookup ns lookup mx lookup whois lookup

Reported by mxtoolbox.com on Friday, May 20, 2011 at 9:18:34 PM (GMT-5) (History)

It must be somewhere else.
 
Old 05-20-2011, 09:24 PM   #6
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
That looks perfect to me, dns/rnds response time is great.

Not an open-relay all great.


What do your logs say, open up a console and send some test emails to google/yahoo and other domains.

I would be curious to see the transaction leaving the server.

Your isp is not blocking 25, going out from your server or do you have a static ip?

Do you have wireshark installed on your server, it may not be a bad idea to see the traffic.

If you have X windows installed, you can install gnome-wireshark for the graphical frontend.

Log in with -X @ server

Last edited by rhbegin; 05-20-2011 at 09:27 PM. Reason: wireshark
 
Old 05-20-2011, 09:31 PM   #7
kitek
Member
 
Registered: Apr 2005
Posts: 252

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rhbegin View Post
That looks perfect to me, dns/rnds response time is great.

Not an open-relay all great.


What do your logs say, open up a console and send some test emails to google/yahoo and other domains.

I would be curious to see the transaction leaving the server.

Your isp is not blocking 25, going out from your server or do you have a static ip?

Do you have wireshark installed on your server, it may not be a bad idea to see the traffic.

If you have X windows installed, you can install gnome-wireshark for the graphical frontend.

Log in with -X @ server
It sends out email great from all the virtual sites. Now I haven't used wireshark before. I will have to check and see what that is. The logs aren't giving me any others either. This is a new release of the virtualmin GPL. I wonder if there is something going on in the packages. I can telnet in send and email send ehlo There is got to be something that must be right in my face that I am not seeing.
 
Old 05-20-2011, 10:08 PM   #8
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
I would recommend install the yum -y groupinstall "X Window System" and then running and installing wireshark & gnome-wireshark.

It will bring the tool and click on interface and it will show all of the traffic.

Tons of options, but this will help shed some light I think.

Wireshark has saved a lot of time at work on things that were blamed on a 'server' and it was related to a network problem.
 
Old 05-20-2011, 10:11 PM   #9
kitek
Member
 
Registered: Apr 2005
Posts: 252

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rhbegin View Post
I would recommend install the yum -y groupinstall "X Window System" and then running and installing wireshark & gnome-wireshark.

It will bring the tool and click on interface and it will show all of the traffic.

Tons of options, but this will help shed some light I think.

Wireshark has saved a lot of time at work on things that were blamed on a 'server' and it was related to a network problem.
awsome thanks. I installed it on my windows machine and I see. Very nice. You could do some damage with this too. Thanks for the help. I will post what I find. I searched hours before I posted about it. A lot of folks asking on virtualmins site without answers.
 
Old 05-21-2011, 07:09 AM   #10
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 269

Rep: Reputation: 54
Quote:
Originally Posted by kitek View Post
awsome thanks. I installed it on my windows machine and I see. Very nice. You could do some damage with this too. Thanks for the help. I will post what I find. I searched hours before I posted about it. A lot of folks asking on virtualmins site without answers.
Before going that route have you tried checking the logs on your mail server while trying to send a mail? You should do something like:

Code:
tail -f /var/log/maillog
And then go to some external account (Yahoo, Gmail, etc.) and try to send a mail to yourself. You should see new log entries flow in letting you know a remote server connected with mail for some user. You will then either see a delivery message or a failure message, either way it will help track down the problem. If you see no log entries at all that means something is blocking SMTP traffic before it hits your server, but since you were able to test externally and the results matched your expected domain that is not likely to be an issue.
 
Old 05-21-2011, 09:34 AM   #11
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Checking the logs as ComputerErik suggests will tell you the next steps to take. If it says that your messages are getting delivered, but you are not seeing them appear you need to investigate the delivery means. Postfix has a pretty complex delivery system, governed by the daemons in master.cf. It supports both mailbox and maildir formats, along with delivery to shell account holders and virtual users. It's default behavior is to deliver to account holders in the their account mailbox, in which case mail would probably not (unless you specifically told it to look there) appear in your POP/IMAP system.
 
Old 05-21-2011, 11:50 AM   #12
kitek
Member
 
Registered: Apr 2005
Posts: 252

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Noway2 View Post
Checking the logs as ComputerErik suggests will tell you the next steps to take. If it says that your messages are getting delivered, but you are not seeing them appear you need to investigate the delivery means. Postfix has a pretty complex delivery system, governed by the daemons in master.cf. It supports both mailbox and maildir formats, along with delivery to shell account holders and virtual users. It's default behavior is to deliver to account holders in the their account mailbox, in which case mail would probably not (unless you specifically told it to look there) appear in your POP/IMAP system.
When I monitor it, It would look like it is a firewall issue. But, when doing an external test tools, they look great. I think I a going to relax a little blaming it on the server. I am going to end up have the configuration so messed up it will be relaying email the BFE then I will be up crude creek lol. Just a joke. Although this is a high end ISP and they have repeatedly said they are not block port 25 something in NAT must being dropping it possibly in the modem. I need to try and monitor the modem's wan port to see traffic or whats going on there. Unfortunately my gateway doesn't have SNMP capabilities which I can't imagine why it doesn't. I will report back on my findings.
 
Old 05-23-2011, 07:38 AM   #13
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
I would be curious to know what you find, diagnosing email is complicated and with email it is always something.
 
Old 05-23-2011, 11:11 AM   #14
kitek
Member
 
Registered: Apr 2005
Posts: 252

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rhbegin View Post
I would be curious to know what you find, diagnosing email is complicated and with email it is always something.
I sure will. I am keeping notes as to what I am doing. I am thinking about just doing to obvious and re-install all the packages and see what happens.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Postfix not accepting parameters mansoorsherazi Linux - Newbie 3 03-08-2011 09:56 AM
Postfix still accepting non FQDN PcPixel Linux - Server 3 11-21-2007 08:22 PM
Postfix smtp not accepting connections Spleenie Linux - Software 0 01-23-2005 05:04 AM
Postfix mail server not accepting incoming mail from the external interface rexmundi Linux - Networking 7 12-22-2003 03:41 PM
Mail Problems using Postfix kastegir Linux - Networking 12 10-09-2003 04:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration