tags:

views:

295

answers:

4

I'm trying to generate custom e-mail addresses that get forwarded to a catch-all. I'm wondering how postfix would need to be configured to handle these types of e-mails

[email protected]

A: 

They're most likely piping a wildcard e-mail address into a script.

ceejayoz
A catch-all e-mail address? Wouldn't that be a total spam magnet?
No. See comment on your answer.
ceejayoz
A: 

A catch-all e-mail address? Wouldn't that be a total spam magnet?

Nope - just discard anything that doesn't fit your secret e-mail format. In the example given, anything that didn't have the format dropbox@[randomID].[username].highrisehq.com could be ignored.
ceejayoz
+1  A: 

I do believe that it is not totally a smtp server level thing. Like the mails where the ticket id is in the subject line and you have to keep that there, there would mostly be another application that would be checking TO address, doing a database lookup and then doing something useful.

I haven't signed up for highrise,but I imagine that the dropbox address, given in the sample as "[email protected]",the 12345678 part would be a randomly generated but unique number (means that they will not be sequentially generated, like 0000001,0000002, ... but like 28902734, 1029383, ...) and connected to your account. This way if you mistype that part, the chances of it landing up in the wrong account are lowered, and mostly the mail would bounce back. All the mails sent to the dropbox address are added that members account, in that sense, the dropbox email address is not to be made public. The dropbox address would not be easy to remember, but it is not meant to be. This lends more credence to the theory that there is a separate application which processes the mails and files them in the correct account.

kinjal
A: 

You can do all sorts of fancy stuff with Postfix. Notably 2.2 and up have a bit more power and better syntax when it comes to building queries. Here's an example of something I've used to determine if the email address, in this case [email protected], meet the criteria in order to be allowed to hit the script.

mail01 # cat /etc/postfix/mysql_virtual_alias_maps.cf

user = email_api
password = email_api_pass

hosts = dbslave_vip
dbname = the_db

query = SELECT 'local_user@localhost' FROM u_user WHERE login_name = substring_index( '%s ' , '+', 1 ) AND pin = substring_index(substring_index( '%s ' , '@', 1), '+', -1) limit 1;