Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forward email to specific host

Status
Not open for further replies.

b4mule

Technical User
Aug 27, 2002
28
AU
I have a RH 7.2 linux box that fetches my mail from my external email provider and distributes it into my local network (the LAN has no internet connection avaliable). All local email is also sorted on this machine. There are a few cases where I need to send the local mail back out to a mail box that resides on our external email providers server.... This is hard to explain....

The external email server (that I have no control over):
mail.mycompany.net

Email addresses served @ mycompany.net
user1@mycompany.net
user2@mycompany.net
........
.....
...
.

I use fetchmail to get the email and put in into our local email boxes. There is no MX record or anything that points at my server.

My RH machine masqurades as the server for mycompany.net for email that is inetrnal to my LAN and anything thats going out. I am using sendmail and pop3.

The problem is user23@mycompany.net is not on the LAN and wants to get mail directly from mail.mycompany.net which is fine. I dont fetch user23's mail. But from the LAN I cant send a mail to user23@mycompany.net.

What I would like to do is get Procmail or Sendmail to send/forward the mail for user23@mycompany.net to there account on mail.mycompany.net.

Is there any way to do this or something else that would fix this problem without it being messy for my users?
 
what about using a .forward file in your pain in the -- er, I mean user's directory? It will forward all his incoming mail to the mbox specified. Alternatively, I'm sure you could do something with the /etc/aliases file, making an alias for mail you don't want forwarded, and one for messages you do.
 
How did you get your fetchmail to distribute the mail among your local users?? I am still stuck on this. I can send locally, but not from fetchmail!

Thanx a bunch

john@lantexco.com
 
I made a user 'fetchmaster' with a .fetchmailrc file in its home directory. The file looks something like this:

poll mail.myexternalmailserver.net
with proto POP3
user 'user1@myexternalmailserver.net' there
with pass 'somepassword'
is 'user1' here

user 'user2@myexternalmailserver.net' there
with pass 'someotherpassword'
is 'user2' here

......
.....
..

I run fetchmail using the command:

fetchmail -f /home/fetchmaster/.fetchmailrc -d 300

I dont have the service run auto at startup cause Im still playing with things and have not got around to it yet.

But this will tell fetchmail to run every 5 mins ( -d 300 ) and use the specified rc file ( -f /home/fetchmaster/.fetchmailrc ).

The file will poll the external mail server where my accounts are kept using pop3:

poll mail.externalmailserver.net
with proto POP3

fetching the mail from the users mail boxes using the passwords that have been setup for the external boxes:

user 'user1@myexternalmailserver.net' there
with pass 'somepassword'

and then put it into the users local mail box:

is 'user1' here

then just do the same thing for the other users, if they use different mail servers just use 'poll' and 'with proto' again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top