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!

relay anon1234@mydomain.com to real user's email address 1

Status
Not open for further replies.

storemike

Programmer
Aug 7, 2004
10
US
I've been asked by a client to enable their website (a classifieds site) to allow email to get sent to anon1234@mydomain.com, for example, and get forward to the REAL email address of the person who placed the ad, biggus@yahoo.com, for example. Can anyone point me in the right direction? I poked around a bit, but am not sure if it would be a forward or a relay. This will be my first attempt to configure sendmail, by the way. Not sure which version of sendmail I'll have, as the client has not yet decided on a hosting service, but the OS is RedHat.

Thanks,
StoreMike (that's Big Mike in Danish, in case you were wondering)
 
edit /etc/aliases. The format should be self explanatory, but you'll want to add lines as follows:

<alias>: <real email address>

or to use the example you provided,

anon1234: biggus@yahoo.com

then run /usr/bin/newaliases to update the aliases database.

It should be trivial to automate this (whatever script inserts ads for you can be changed to append the appropriate addresses to /etc/aliases, then run newaliases.) You should take care that the anon address you generate is unique, and you also might want to go in periodically and clean out the no longer used anon addresses.
 
Thanks. That's the same solution I was given at a different forum, so it must be right. And it looks soooo easy. I was afraid it was going to be very difficult. Thanks also for putting in the format (I hadn't had a chance to look at the alias man file yet).

Thanks again,
StoreMike
 
jkupski,

OK...I've been busy on other things and have just now gotten back to this. I had to chmod the aliases file to allow PHP to write to it, but I wasn't able to chmod newaliases so it can be called from a web process. No biggie, I'll just have PHP write to a tmp file somewhere and have cron check it every hour, updating the aliases file and kicking off newaliases if needed.

Thanks for the help,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top