Wildcards in an email address with qmail?

Tag: qmail Author: hishop524312144 Date: 2009-12-07

I'm trying to set up an email address in qmail such that a unique identifier can be passed as part of the email address.

For example:

[email protected], [email protected], [email protected] would all go to the 'reply' user and be sent to the same shell script. Currently, email sent to [email protected] goes to the script and I pass the unique id in the subject or message body. Would be grateful for any suggestions. Thanks!

Other Answer1

In a default qmail setup, you can do exactly what you suggest... anything following a dash is ignored for delivery purposes, so [email protected] will be processed by the .qmail-reply file, where you would presumably send the mail to your script and look at the address to obtain the identifier.

We use this for bounce tracking - if the email is to [email protected], and the sender is [email protected], then the from address is written this way:

[email protected]

And a script flags the address as no good.

I screwed this up a bit - I guess I'm rusty on qmail. The alias thing doesn't work by default as I stated above. To support extensions for [email protected], you need a .qmail-default file in ~bounce.

See the "extension addresses" (section 4.1.5) on LWQ: http://www.lifewithqmail.org/lwq.html


I'm trying to do pretty much the same thing. The problem is that email sent to [email protected] fails with a 550 mailbox not found error. Email sent to [email protected] works fine. I have tried to set up the reply address both as a user (/var/qmail/mailnames/mydomain.com/reply/.qmail) and as an alias (/var/qmail/alias/.qmail-reply) Is there some trick to getting qmail to ignore the address portion between the dash and the @?
Please see my edit - I was missing a step for the catch-alls to work.
Thanks Matt! I've reread LWQ section 4.1.5 so many times over the past few days that I'm starting to see it in my sleep! I can't even get a simple (non wildcard -default) extension to work and I'm beginning to suspect that this is a Plesk related problem. I've gone to the parallels support forum for help to see if they have any advice.