[svlug] Aliased emails ala craigslist?

Skip Evans skip at bigskypenguin.com
Thu Apr 27 18:49:11 PDT 2006

Thanks, Seth!

This makes a lot of sense, and I think I would go 
the route of writing the PHP script as the handler 
rather than trying to make Postfix query an 
address translation database, mostly because these 
posts are going to created on the fly by site 
visitors, and it seems I could handle the storage 
and query, etc, in a PHP script for a little more 
control and transparency on my end... at least 
that is what I'm thinking at present.

Thanks again! SVLUG is the best, truly life savers!!!


Seth David Schoen wrote:
> To underscore the point that I didn't test my handler code, it has
> an unbalanced quote.  It won't run at all.
> So, write your own handler that parses the message fed to it on
> standard input, extracts the necessary information from the
> headers, and forwards the body to the proper recipient.  And call
> that handler from the MDA.
> For example, one way of setting up a wildcard delivery using Postfix
> is 
> # in /etc/postfix/main.cf
> virtual_alias_domains = grumblenet.net
> virtual_alias_maps = hash:/etc/postfix/virtual
> # in /etc/postfix/virtual (run postmap virtual after changing)
> @grumblenet.net	mumble
> # in /etc/aliases (run newaliases after changing)
> mumble: |/usr/local/bin/grumble-handler
> The result of all of this is that if you send any mail to any
> address at grumblenet.net, it will get fed to the standard input
> of the process /usr/local/bin/grumble-handler.  That program
> could then parse the message to figure out whom to forward the
> mail to, by looking up the receipient in a database.
> There is also a way to make Postfix directly query an address
> translation database, which could imply that you wouldn't even
> need to write a grumble-handler at all -- you could just tell
> Postfix to use the database and then forward the mail to the
> appropriate party.  (I think you could just use a database as
> the target of virtual_alias_maps; consult the documentation.)
> There are drawbacks to this.  For example, it might result in
> people who send mail to aliases seeing bounces directly if
> there are any delivery problems at the recipient's end.  Someone
> might write to foo-12387197 at grumblenet.net and then get a bounce
> from john.public at mumblecom.com indicating that John Public's
> mailbox was full.  Then the sender would know John Public's
> identity.  That would seem to argue for generating your own
> message containing the contents of the message you want to forward.

Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701

More information about the svlug mailing list