LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-18-2012, 06:52 AM   #1
badger_fruit
Member
 
Registered: Dec 2008
Posts: 43

Rep: Reputation: 1
Unable to send email to own domain


I'm sorry if that's not a very descriptive title, let me try to explain in more detail and perhaps someone can help me figure out what the problem is and of course, resolve the issue!

We have an OpenSuse server which can happily send out emails using /usr/bin/mail to external addresses - for example @hotmail.com or @gmail.com. The problem comes when we try to send to our own domain (for this thread, I will call it @home.com).

The computers / network is configured like so:-

DNS Server 192.168.1.1
Suse box 192.168.1.5
Exchange server 192.168.1.10

We thought that because mails were going "out" OK that we needed to edit the /etc/hosts on the Suse box to include:

192.168.1.10 home.com
192.168.1.10 mail.home.com

By performing a PING/Traceroute/Telnet onto mail.home.com, we get replies from 192.168.1.10 as expected.

Now, I'm not a mail expert by any long shot but I wonder if someone's come across this before and can help us find a solution to why /usr/sbin/mail refuses to send to me@home.com (which is a valid address as I am getting emails OK from everyone else!)

Thanks for reading, hope someone can help us find a solution!!
 
Old 10-18-2012, 10:02 AM   #2
EODSteven
Member
 
Registered: Oct 2012
Location: Manchester, Tn
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196

Rep: Reputation: 3
Just a guess, since there are no other replies, but I would assume you would have to have a mail server program set up to process internal mail...Make sense? Let me know if that helped.
 
Old 10-18-2012, 10:06 AM   #3
badger_fruit
Member
 
Registered: Dec 2008
Posts: 43

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by EODSteven View Post
Just a guess, since there are no other replies, but I would assume you would have to have a mail server program set up to process internal mail...Make sense? Let me know if that helped.
Hi
Thanks for the reply; yes, we have Microsoft Exchange to process emails here. I did mention that on my original post:-

"Exchange server 192.168.1.10"

Sorry if it wasn't clear enough.
 
Old 10-18-2012, 10:06 AM   #4
EODSteven
Member
 
Registered: Oct 2012
Location: Manchester, Tn
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196

Rep: Reputation: 3
I found this that a previous user said fixed there problem same as yours...

I had done what you suggested and it didn't seem to help but then I uncommented the mynetworks = and added my network range and everything seems to be working now. Thanks for your help though. The SUSE postfix config file is a little wierd with a lot of the config at the very end of the file. Here was my working main.cf file. Hope this might help if anyone else has problems.

Code:
 queue_directory = /var/spool/postfix
 command_directory = /usr/sbin
 daemon_directory = /usr/lib/postfix
 mail_owner = postfix
 unknown_local_recipient_reject_code = 550
 mynetworks = 10.10.10.0/24, 127.0.0.0/8
 debug_peer_level = 2
 debugger_command =
 PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
 xxgdb $daemon_directory/$process_name $process_id & sleep 5
 sendmail_path = /usr/sbin/sendmail
 newaliases_path = /usr/bin/newaliases
 mailq_path = /usr/bin/mailq
 setgid_group = maildrop
 html_directory = /usr/share/doc/packages/postfix/html
 manpage_directory = /usr/share/man
 sample_directory = /usr/share/doc/packages/postfix/samples
 
readme_directory = /usr/share/doc/packages/postfix/README_FILES
 inet_protocols = all
 biff = no
 mail_spool_directory = /var/mail
 canonical_maps = hash:/etc/postfix/canonical
 virtual_maps = hash:/etc/postfix/virtual
 relocated_maps = hash:/etc/postfix/relocated
 transport_maps = hash:/etc/postfix/transport
 sender_canonical_maps = hash:/etc/postfix/sender_canonical
 masquerade_exceptions = root
 masquerade_classes = envelope_sender, header_sender, header_recipient
 myhostname = mail.example.com
 mydomain = example.com
 program_directory = /usr/lib/postfix
 inet_interfaces = all
 masquerade_domains = 
mydestination = $myhostname, $mydomain, localhost.$mydomain
 defer_transports = 
disable_dns_lookups = no
 relayhost = 
mailbox_command = 
mailbox_transport = 
strict_8bitmime = no
 disable_mime_output_conversion = no
 smtpd_sender_restrictions = hash:/etc/postfix/access
 smtpd_client_restrictions = 
smtpd_helo_required = no
 smtpd_helo_restrictions = 
strict_rfc821_envelopes = no
 smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
 smtp_sasl_auth_enable = no
 smtpd_sasl_auth_enable = no
 smtpd_use_tls = no
 smtp_use_tls = no
 alias_maps = hash:/etc/aliases
 mailbox_size_limit = 0
 message_size_limit = 10240000
 
Old 10-18-2012, 10:28 AM   #5
badger_fruit
Member
 
Registered: Dec 2008
Posts: 43

Original Poster
Rep: Reputation: 1
Hmm, I added an appropriate line into /usr/lib/postfix/main.cf and restarted postfix but it doesn't seem to have made any difference
 
Old 10-18-2012, 10:32 AM   #6
EODSteven
Member
 
Registered: Oct 2012
Location: Manchester, Tn
Distribution: Ubuntu 14.04, Windows 8, Windows Server 2012. Ubuntu Server 14.04
Posts: 196

Rep: Reputation: 3
There was another section to that post that I omitted cause the user said it didn't help...maybe it did...Here it is....

Quote:
Originally Posted by ViewTopia View Post
yes, you need to tell postfix to listen on more then just localhost.

edit your main.cf, you most likely have something like this

Code:
#inet_interfaces = all
inet_interfaces = localhost
Switch the line thats commented, the do postfix reload and you should be set.
 
Old 10-18-2012, 11:29 AM   #7
badger_fruit
Member
 
Registered: Dec 2008
Posts: 43

Original Poster
Rep: Reputation: 1
Hi
Thanks for the quick reply; My /usr/lib/postfix/main.cf was:-

#inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost


Changing it to

inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost


and restarting the service, has made no difference ... other than seemingly stopping emails going out to hotmail and gmail now

Please bear in mind that the Nagios / Suse machine is NOT my main company webserver, all our emails go through Microsoft Exchange which is on a different server - I mention this because right above the setting is a comment which reads:-

# RECEIVING MAIL
# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on.


This system does not receive email.
 
Old 10-18-2012, 11:43 AM   #8
badger_fruit
Member
 
Registered: Dec 2008
Posts: 43

Original Poster
Rep: Reputation: 1
I have now rolled back both suggested changes to my main.cf file as I don't think that they're making any difference.

If it helps an nslookup returns with the external address:-
app-live-003:~ # nslookup mail.home.com
Server: 192.168.1.1
Address: 192.168.1.1#53

Non-authoritative answer:
Name: mail.home.com
Address: 94.194.xxx.xxx


However, a PING returns:-
app-live-003:~ # ping mail.home.com
PING mail.home.com (192.168.1.10) 56(84) bytes of data.
64 bytes from home.com (192.168.1.10): icmp_seq=1 ttl=128 time=0.535 ms
64 bytes from home.com (192.168.1.10): icmp_seq=2 ttl=128 time=0.256 ms
64 bytes from home.com (192.168.1.10): icmp_seq=3 ttl=128 time=0.268 ms
64 bytes from home.com (192.168.1.10): icmp_seq=4 ttl=128 time=0.251 ms
64 bytes from home.com (192.168.1.10): icmp_seq=5 ttl=128 time=0.254 ms
^C
--- mail.home.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.251/0.312/0.535/0.113 ms
app-live-003:~ #


I have looked in my /var/spool/mail/suse_user and I can see the following on the delivery failures:-

<recipient@home.com>: delivery temporarily suspended: connect to
mail.home.com[94.194.xxx.xxx]:25: Connection timed out


Something somewhere is still telling the box that mail.home.com is out on the internet when it's not, it's on the local network.
 
Old 10-21-2012, 09:53 AM   #9
DutchGeek
Member
 
Registered: Sep 2006
Distribution: SuSE, Slackware
Posts: 55

Rep: Reputation: 4
I am no expert in mailing systems, but here is my understanding:

-when you ping mail.home.com or home.com the IPs are resolved correctly
-when you resolve it using your DNS server, you get the wrong IPs
-your mail daemon can resolve internet addresses, but when it comes to mail.home.com or home.com it treats it as an internet address (and resolves it using the internet top DNS servers) rather than something on your network.

maybe it is something wrong with your DNS server?

if it is then you can modify /etc/named.conf and /var/lib/named or where ever the zone files are. Maybe you're gonna need to read RFCs 1033 and 1034.

Cheers
 
Old 10-22-2012, 05:43 AM   #10
badger_fruit
Member
 
Registered: Dec 2008
Posts: 43

Original Poster
Rep: Reputation: 1
Hello to everyone who tried to help
I never did get to the bottom of why it wasn't working but I found a work-around which is just as good and that is to:-

Add an entry to "myhome.local" in my /etc/hosts file
Change the email target address to me@myhome.local.

It now works, thanks for reading and I hope this work-around may be useful to someone else!
 
  


Reply


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
Unable to send the mail to particular domain pradeep.kumar Linux - General 3 06-28-2012 09:28 AM
what are the things i need to send/rcv email to internet with user@domain.org? kublador Linux - Newbie 4 06-26-2006 05:12 AM
qmail wont send email to addresses not in my domain robmainella Linux - Software 2 02-02-2004 06:37 PM
cant send email (using sendmail) to newly added domain user sirjosi Linux - Newbie 0 10-22-2003 02:12 AM
how to refuse to send email to some domain with sendmail? lzyking Linux - Software 3 09-16-2003 09:21 AM


All times are GMT -5. The time now is 01:22 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration