View Full Version : Redirect Email for a hosted domain
swamprat
10th January 2008, 00:11
Hello,
I'm using Centos5.
I host a domain but the users of that domain don't want email on my server, they would like to have all email for all their users forwarded to their AOL account such as.
info@xyz ---> abc@aol.com
sales@xyz ---> abc@aol.com
I'm using postfix.
I'm a newbie and would need some step by step help in getting this done.
Thanks
volksman
10th January 2008, 01:14
Depends on how you setup postfix. Can you dump your main.cf and post it here? Or describe your setup a little better...IE did you use a Howto from Howtoforge or did you build it from another document?
c0mputernick
12th January 2008, 15:56
just in case you did follow something on here at howtoforge have a look at this table at http://www.howtoforge.com/virtual_postfix_mysql_quota_courier_p5 it shows you how to configure that with phpmyadmin, but we have to know how you setup your system. the table is about half way down the page.
HTH
Nick
swamprat
13th January 2008, 15:59
Thanks all for your replies.
Below is my main.cf as requested. A few words of clarification first as this might help.
I'm a newbie. The domains (url's) that I host such as xyz.com don't actually exist on my machine where postfix resides. xyz and several others are MS/Front Page web sites hosted on a server behind my firewall with a internal IP of 192.168.xxx.xx.
The fellow who set this up created virtual domains for these domains which some how point to the correct web site on the W3K box. Some when some one requests the page for xyz.com with an external IP of 216.254.xxx.xx it is found and the page is served up from the W3K box.
So the external IP/URL somehow resolves to the proper local address (192...) on the W3K box.
What the person who owns the xyz.com domain wants is to have all email which is directed to his web site not to reside in mail boxes on my local machine, he wants them forwarded to his AOL account...that's it. I don't have any idea if this can be done but if it can please give me a hand.
Thanks...main.cf and virtual are listed below. I was trying this out with a few changes but I didn't get it to work.
This set up is Postfix and Dovecot.
My entries in these files are attached.
c0mputernick
14th January 2008, 15:24
I cant really help you with your postfix problems, but i can tell you how your mail/web requests are handled.
Its all in the router/firewall you have running on your network. When it gets a request for port 80(web traffic) it knows to forward the request to your local ip address for your w2k3 box. When you get email (port 25, 143, 110 etc) it should also know to forward the incoming packets to your mail server.
it sounds like all that is already setup, you just need to tell postfix to forward some mail to another email address.
but have a look at this and see if it helps:
http://www.postfix.org/VIRTUAL_README.html#forwarding
falko
14th January 2008, 16:54
Please run
postmap /etc/postfix/virtual
/etc/init.d/postfix restart
c0mputernick
14th January 2008, 18:33
what happens when you add this to your virtual file:
user@realdomain.com user@aol.com
and then run the above commands from falko?
swamprat
14th January 2008, 22:49
Hello all,
I ran falko's commands...nothing happened.
The real domain being hosted on this box has real mail boxes for real people so this wouldn't work.
Of interest. Some processes on this machine produce email for a number of reasons...some errors, some information etc. They are all forwarded to root and to my yahoo account and this works but of more interest is Once when I sent a message to info@sunsethandcarwash.com it found itself in my yahoo mail box.
Here is a message when trying to send a kmail message from my account to info@sunsethandcarwash.com
Sending failed:
Message sending failed since the following recipients were rejected by the server: dan@sunsethandcarwash.com (The server responded: "5.1.1 : Recipient address rejected: User unknown in local recipient table")
The message will stay in the 'outbox' folder until you either fix the problem (e.g. a broken address) or remove the message from the 'outbox' folder.
The following transport protocol was used: rifkinho
Do you want me to continue sending the remaining messages?
rmccain
14th January 2008, 23:28
Have you looked at the nameserver that resolves these sites?
I use EditDNS for my nameservers, and it is pretty easy to add entries like:
userdomain.tld NS ns.newhost.tld so you can switch an entire domain without having to go to a registrar.
An entry like userdomain.tld MX 5 user.mail.newhost.tld may be able to switch all the mail to a different location than the web sites. (never tried this one but it might work?)
Otherwise, If you want a specific user to get the mail look at the VirtUserTable in your MTA and add an entry like
@userdomain.tld user@cnewhost.tld
swamprat
14th January 2008, 23:52
Nothing in VirtUserTable
rmccain
15th January 2008, 04:14
Does that mean that nothing has been entered in the virtusertable or that you can make no changes there?
If you don't see anything in virtusertable, what you are looking for may be in the aliases file. Items in aliases are much more likely to be globals. For example: Your mail person might have a local account on the server with a name like firstlast.
Looking in aliases you may find a line under remote users that reads:
firstlast user@aol.com
So any usernames (like postmaster, root, etc) or entire domains (like @domain.tld) in the virtusertable that map to firstlast will then be sent to user@aol.com.
volksman
15th January 2008, 14:21
Yep...As per above check /etc/aliases....a good clue will be your yahoo account may be mapped in there....if you change the aliases file then you will need to run 'newaliases' when done (and I think even a postfix restart) for them to take effect.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.