Postfix - Ubuntu 10.04 - SQL - Forwarding question

I have the MTA setup with Postfix / Dovecot thru SQL db on Ubuntu 10.04 working fine. My question is how or if this can be done.

Situation for the site i am building is simple posts small ads. The ad would get an email to send responses to so if users email placing the ad is something@somewhere.com the ad gets an email to reply to as ad123@site.com which would get forwarded to something@somewhere.com. In theory keeping the users actual email "cloaked". All emails get sent to the site then forwarded off to the individual ad owners.

I am new to server setup / control / building and Postfix is new to me so i am not sure where to begin other than to ask if it is even possible. The process would be automated, nothing manual as i have seen from my own searching where you manually edit the config file for forwarding.

Thanks

Dave

4 Replies

I'm not sure if I understand correctly but I think you're wanting to change the envelope, are you wanting postfix to do this or do it via some sort of script?

If it's a script putting -r <newaddres@domain.com> will change the envelope, if you want postfix, I suggest checking the postfix man page for envelope.

Im not sure honestly.

Try to explain in better detail. my site has contact@site.com simple basic. In database "mail"."domains" there is site.com and in "user".mail" there is contact@site.com pretty self explanatory.

Think of cragislist (simple example i could think of) when you post you ad you register using your home real email address yet your ad will say reply to ad123456@cragigslist.com so it hides your real email yet when some responds to your ad they click on the ad123456@craigslist.com email address, up opens your email client (Outlook, Thunderbird….) you send your email yet it gets delivered to the real email of the owner of the ad.

I thought that the "forwardings" table in the database i could simply pop in the real email me@somewhere.com and forwardaddress to ad159753@site.com. So on the ad when people reply to ad_159753 the database would say look take the email being sent to 159753 and simply forward it along to me@somewhere.com.

Not sure what you mean by envelope…new to this so its a battle.

Thanks

Dave

I think you can accomplish this by setting up your aliasmaps to use MySQL for the aliases table. See more at the MYSQLREADME and the mysql_table man page in the Postfix documentation. Forget the part about building Postfix with MySQL support - on Ubuntu you just need to make sure that the postfix-mysql package is installed.

Of course, you will need to somehow maintain the database table that does the mapping of one address to another.

Thanks for the links. Will give them a read and see how it goes.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct