Mail routing

Posted on 2001-06-14
Last Modified: 2010-03-18
I'm trying to setup a linux machine as mail server and at this point the internal mail service it's already working, but when i try to send an message out of my  company domain, it just don't go out. It could be a network configuration problem or a mail service configration problem? The rest of the services (internet browsing, telnet, ftp, etc.) are working fine (nternal and external). I check the routing table and it seem to be fine. The linux server it's behind a Microsoft Proxy server. Thank you.
Question by:pitagoras
  • 2

Expert Comment

ID: 6193985
Most probably it seems a network configuration problem. I am not sure about Microsoft proxy server, but I guess it doesnt allow to connect to the netowrk directly. You can verify using ping.

# ping

If you get the reply then you are okay with your network configuration. You need to then check your mail configuration. Most probable reason will be the Relaying. Enter the machine's IP you are sending mail from in the /etc/mail/access file. HTH

-- tknayak

Accepted Solution

vsamtani earned 75 total points
ID: 6194737
I'm assuming that you are talking about emails sent to the linux box from other machines, using programs like Outlook (Express), Netscape and/or Eudora. But emails sent to someone within your domain (ie, someone who has a pop3/imap account on your linux box) get delivered fine.

If this is the problem, then sendmail is not relaying. This is its default behaviour (for recent versions anyway) and is designed to stop spam being sent through your server. What you need to do is to enable relaying for your own network while making sure that it remains disabled for the rest of the world.

First, check your file. This is likely to be in either /etc or /etc/mail. Look for a line


If it's there, so far so good. (It should be by default). Now look for a file /etc/mail/access, and if you have it, open it in your favourite text editor.

It should contain the following lines:

# by default we allow relaying from localhost...
localhost.localdomain           RELAY
localhost                       RELAY                       RELAY

You need to add some entries to allow hosts on your network to relay as well. Now, if the email clients that are to be allowed to send mail through your linux box are all on a single ip network, it's very easy. For example, if they are all on 192.168.0.x, then you would add in:

192.168.0                       RELAY

(note that it is a TAB separating the two values, not just spaces). This tells sendmail that it can relay mail from any machine with an ip address beginning 192.168.0

You can put in as many of these lines as you like to specify ip addresses or parts of ip addresses. Have a look at the sendmail site ( for more info on this.



Author Comment

ID: 6207572
When i try to ping i got the "Destination host unreachable" error. I made some changes in the route table and the i just get the "timeout" error; anyway the mail didn't go out. By the other side i'm using Postfix as mail server, it have the same relay issues than Sendmail?


Author Comment

ID: 6225715
Thank you.


Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question