Link to home
Start Free TrialLog in
Avatar of krasquinha
krasquinha

asked on

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

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

Thanks
Kiran
Avatar of psimation
psimation
Flag of South Africa image

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.
Avatar of krasquinha
krasquinha

ASKER

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)

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.

-Jason
Maybe a solution is "remote" users to open pop3 to your ISP AND your mail server, check mails on both places.
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...
krasquinha:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
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.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Paul
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of AnnieMod
AnnieMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial