Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Linux Mail system : I want to route a particular users mail to POP3 account in ISP

Posted on 2003-04-01
Medium Priority
Last Modified: 2010-04-20
I have a linux mail server. Domain is  "mydomain.com" . We have purchased a pop3 account from ISP and the email address will be "user@mydomain.com" So locally we have same domain and also at ISP side we have same domain name. Now the problem is  - when the user goes out of station he will access his mails directly from ISP mailbox. So he will get all the external mails. But whatever mails sent from our office to that user "user@mydomain.com" that mails will be droped locally to our linux box. The case is that we have same domain names on both the sides. so whenever the local linux box get the mail from local users to  "mydomain.com" it assumes that the local linux box is "mydomain.com" so it will drop the mails locally. So anyone can help me out regarding this

Question by:krasquinha
LVL 17

Expert Comment

ID: 8244924
The problem is that the local machine is set up to handle the e-mails for the domain as well. You should be able to fix this by doing either of the following:
Don't run DNS on the local machine, instead use the ISP DNS servers. Your domain has a zone file located somewhere, and in that zone file is the authorative MX record. Your local machine should use the same version as the rest of the world. You could also still ellect to run a DNS server on the local machine, but then make sure that the zone file is configured to point the MX to the ISP and not locally. You should also make sure that your /etc/mail/local-host-names file do not contain your domain name, but if you use your ISP DNS serices instead, you houldn't have this problem.

Author Comment

ID: 8246300
i have not configured a DNS server on that machine i am using sendmail and fetchmail (Redhat 7.1) In local-host-names i have given "mydomain.com" I want all local mails to be routed locally ..only for one user i want to forward it to his roaming POP3 id . (Problem is on both the mail servers the local and ISP we have same user aliases)

Expert Comment

ID: 8248299

Since you run fetchmail on your linux box that downloads all the email from your ISP you need to either have him dial into your local network to collect his email, or have the ISP seperate out his account from being bundled together, yet still have fetchmail collect them all, that way he will be able to read email remotely and at work.

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Expert Comment

ID: 8252429
Maybe a solution is "remote" users to open pop3 to your ISP AND your mail server, check mails on both places.

Expert Comment

ID: 8741055
I think the hole problem is to use the same name.
If you're have pernament connection, with fix ip you have different choises.
I think the best is to not have pop3 by isp, have a mail server on firewall or have nat to the server inside on pop3, and smtp port, only have mail relay enabled by isp. (mail mx with higher number for ISP relay and lower for your server). Check the current setting by using host -a mydomain.com
I suggest to install some webmail too (like Ilohamail more secure , Openwebmail less secure).
You can have only an realy mail server for more security reason to get mail on firewall, give mx record for firewall and the mydomain.com +ip in the host file on the firewall, and enable relay to mydomain.com. It will than forward all mail to the mailserver inside.
for example:
xxx.hu.                 86400   IN      MX      20 relay.datanet.hu.
xxx.hu.                 86400   IN      MX      5 mail.yyyy.hu.
xxx.hu.                 86400   IN      MX      10 xxxisdn.dialin.datanet.hu.

mail.xxx.hu is the mailrelay server wich have mail relay enabled to xxx.hu and than it has a host entry for xxx.hu in the hosts file (local ip). (so they can only check mail internaly and the internal server is secured and could be other like Lotus Domino:)

If you have not pernament access or fix ip you have to use always the ISP-s pop3 server as mail server.

Other solution is to play with hosts file, or use for example usertable usersdb (sendmail) or canonical (postfix) to redirect mail.

I have to know if pernament access, and what you're want.
Do you want, the people can get all mail from outside? None from outside etc...?
Witch mailserver? postfix, sendmail, etc...

Expert Comment

ID: 9087563
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
LVL 12

Expert Comment

ID: 9271858
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is to:

Be PAQ'd/Points No Refunded

Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Accepted Solution

AnnieMod earned 0 total points
ID: 9349871
Per recommendation.

Community Support Moderator

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

577 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