LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-21-2013, 06:50 PM   #1
Laertiades
Member
 
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 57

Rep: Reputation: Disabled
how do I test my mail server's ability to receive email


I have a domain: mydomain.com. I want to receive email to my home server at webmaster@mydomain.com. I followed this tutorial which had me install postfix, dovecot, procmail, spamassassin, and postgrey. The daemons are up and running. I can send mail with php scripts. nmap shows port 25 open. I am convinced the MX record of mydomain.com points to my external ip address. But when I send emails to webmaster@mydomain.com I see no evidence of them.

My questions are: Where would the email be? And, if they are supposed to be in /home/webmaster/Maildir, given the fact that they are not, how would I go about troubleshooting?

Any help, or enlightenment would be appreciated.

Last edited by Laertiades; 01-21-2013 at 06:53 PM. Reason: additional info
 
Old 01-21-2013, 07:35 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,226

Rep: Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022
You'll need to start at the beginning and check the log files on the sending machine eg /var/log/messages, /var/log/maillog and so on.
That should tell you if it sent ok.
If so, then start checking the receiver in a similar manner.
You may find spamassassin, and postgrey are set too aggressive and dumped your test email
 
1 members found this post helpful.
Old 01-21-2013, 07:58 PM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,919

Rep: Reputation: Disabled
Quote:
Originally Posted by Laertiades View Post
I am convinced the MX record of mydomain.com points to my external ip address.
Just in case you mean this literally: An MX record must never point directly to an IP address. It must point to a name registered as an A record (it can't point to a CNAME either), which in turn must point to the IP address of the responsible mail server.

You can test this in several ways:

- you could monitor incoming traffic to port 25 with tcpdump (tcpdump -v -i eth0 tcp port 25 should do the trick)
- use nc (netcat) or telnet to connect to port 25 on the mail server from an outside host and send SMTP commands (HELO, MAIL, RCPT and DATA)
- use one of the many relay testing services on the Internet (they tell you if your server is reachable, but won't test MX records)
- monitor the logs in real time with tail -f while you're sending mail using an outside host or a web based service
 
1 members found this post helpful.
Old 01-21-2013, 08:54 PM   #4
Laertiades
Member
 
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 57

Original Poster
Rep: Reputation: Disabled
thanks for replies

Thank you Chrism01 and Ser Olmy for your help. I will make this quick response and then pursue your suggestions further.

I am trying to use a CNAME. Not by choice. I am trying to host multiple domains on my home server which has a dynamic ip. All I could get to work was to have a no-ip domain name to which I point the CNAME of my domain at 1and1 and then use the nginx virtual domain feature. It seems to be working, though: before I set up the mail server I sent an email to webmaster@mydomain.com and received this message in return from my host gateway:

<webmaster@sticky.no-ip.org>: connect to
sticky.no-ip.org[my.ip.addr.ess]:25: Connection timed out

The ip address was right. Now that I have the server installed I havn't received this return notice in response to my most recent email.

There don't seem to be any log files which concern mail on the server. I have been sending my test emails from FastMail. I will try disabling spamassassin and postgrey. tcpdump isn't a command on my system, I assume I will have to install it. I can telnet into port 25 from my workstation, though I don't know what to type after I am in to test anything. I will investigate that further.

So, thank you again. I appreciate your help. If you have any more insights I am all ears. I think I might already have enough to take me to the next level, though, and you have my gratitude.

correction: I did just get a failure message from my most recent email although this time the message is from my own server I guess:

This is the mail system at host www.mydomain.com.

####################################################################
# THIS IS A WARNING ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. #
####################################################################

Your message could not be delivered for more than 4 hour(s).
It will be retried until it is 1 day(s) old.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<webmaster@localhost> (expanded from <webmaster@mydomain.com>):
temporary failure. Command output: pipe: fatal: pipe_command: execvp
/usr/bin/perlbin/vendor/spamc: No such file or directory

There are also some attachments. I will look into this.

Last edited by Laertiades; 01-21-2013 at 09:05 PM. Reason: update info
 
Old 01-21-2013, 09:10 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,919

Rep: Reputation: Disabled
Quote:
Originally Posted by Laertiades View Post
I am trying to use a CNAME. Not by choice. I am trying to host multiple domains on my home server which has a dynamic ip. All I could get to work was to have a no-ip domain name to which I point the CNAME of my domain at 1and1 and then use the nginx virtual domain feature.
You can point the MX record directly at the no-ip A record. No need to use a CNAME.

Having CNAMEs or IP addresses in MX records will work... sometimes. It all depends on the sending MTA; some stick to the RFCs and will refuse to deliver mails, while others are more forgiving. You really don't want your mail to depend on random quirks in various MTAs.

Quote:
Originally Posted by Laertiades View Post
It seems to be working, though: before I set up the mail server I sent an email to webmaster@mydomain.com and received this message in return from my host gateway:

<webmaster@sticky.no-ip.org>: connect to
sticky.no-ip.org[my.ip.addr.ess]:25: Connection timed out
This could be an issue with your firewall or router, but it's also common practice for ISPs to block inbound traffic to DSL customers on port 25.

Since a TCP connection couldn't be established, you won't see anything in your logs. Double check router/firewall settings and experiment with other ports. You can check for open ports using one of the many port probing services on the Internet, such as GRC's ShieldsUP! If port 25 turns out to be the only port you can't connect to from the outside, it's likely that your ISP is to blame.
 
1 members found this post helpful.
Old 01-21-2013, 09:45 PM   #6
Laertiades
Member
 
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 57

Original Poster
Rep: Reputation: Disabled
Thank you Ser

Thank you for your continued help Ser Olmy. I intend to look into your suggestions and ideas first thing tomorrow (brain is tired.) I will just say at this point that my domain is using a CNAME because if I just forward the domain to no-ip then I just get the nginx welcome page at my server (I am speaking of HTTP requests on 80). The virtual domain doesn't get used. I can't us the A record because it only takes an ip address (and mine changes). And I can't use any DNS server (that I know of). The people at 1and1 told me that I can't modify my email settings if I use a CNAME. But I will look into it further.

You have given me a lot to work on and I suspect that your help will prove effective. In any case you have my sincere gratitude for your time and effort.
 
Old 01-22-2013, 12:39 AM   #7
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,060

Rep: Reputation: 295Reputation: 295Reputation: 295
One other thing to do (if you have a shell account on a machine external to your LAN) is to telnet to port 25 on your machine and input SMTP commands directly (e.g. enter the command "telnet your.host.name 25"). If you don't speak SMTP, this page shows a basic sequence of SMTP commands required to transmit an e-mail. Note in particular any error messages in attempting to connect or send data through your SMTP server.
 
1 members found this post helpful.
Old 01-22-2013, 08:27 AM   #8
Laertiades
Member
 
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 57

Original Poster
Rep: Reputation: Disabled
Telnet problems

Thank you btmiller. I am not able to telnet external to LAN but I did so from within and I think the session shed some light:

[laertiades@Athens ~]$ telnet Sparta 25
Trying 192.168.1.118...
Connected to Sparta.
Escape character is '^]'.
220 www.mydomain.com ESMTP
HELO local.domain.name
250 www.mydomain.com
MAIL FROM: myactual@emailaddress.com
250 2.1.0 Ok
RCPT TO: webmaster@mydomain.com
451 4.3.5 Server configuration problem
RCPT TO: webmaster@localhost
451 4.3.5 Server configuration problem

I am still unable to find an error log for postfix. I did however get the following from systemctl status postfix:

Jan 22 06:10:40 Sparta postfix/smtpd[16623]: warning: connect to 127.0.0.1:10030: Connection refused
Jan 22 06:10:40 Sparta postfix/smtpd[16623]: warning: problem talking to server 127.0.0.1:10030: Connection refused

I found the following line in /etc/postfix/main.cf:

smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
check_policy_service inet:127.0.0.1:10030

It seems that I am honing in on the issue (or rather you guys are) but I am still at a loss. I might mention that I have stopped iptables, spamassassin, and postgrey. Much thanks to all.
 
Old 01-22-2013, 10:33 AM   #9
Laertiades
Member
 
Registered: Jul 2012
Location: Pacific Northwest
Distribution: Arch
Posts: 57

Original Poster
Rep: Reputation: Disabled
Problem solved

I fixed the problem and this might be helpful for other people using the tutorial: "A Simple Mailserver on Arch Linux" at http://www.gelens.org/archlinux-mailserver/

in /etc/postfix/master.cf I had to change the file location:
/usr/bin/perlbin/vendor/spamc
to:
/usr/bin/vendor_perl/spamc

I also had to have postgrey up and running because it had to make a connection on port 10030.

I also had to add the following line to /etc/dovecot/dovecot.conf:
listen = *
Something having to do with ipv6 (even though my server has ipv6 disabled per kernal option???)

Thank you so much, everyone, for you time and help. After several frustrating days I feel much lighter.
 
  


Reply

Tags
dovecot, email, mailserver, postfix


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Zimbra email server could int able to receive mail from outside network arun5002 Linux - Server 2 11-11-2011 12:36 AM
Mail Server with : Postfix,dovecot. (Can send email, but can't receive email from internet mail) cparapat Linux - Server 1 08-16-2010 12:57 AM
Would like to set up a mail server on Suse sles 11 to send and receive mail tiburondelcaribe Linux - Newbie 2 09-11-2009 11:30 AM
how to receive mail in evolution email by using sendmails configuration banner Linux - Newbie 0 07-04-2005 12:50 AM
cannot receive email from mail server installed with postfix charles168 Linux - Software 4 08-15-2003 02:06 PM


All times are GMT -5. The time now is 02:44 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration