2

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:

reply-123@example.com, reply-345@example.com, reply-99999@example.com would all go to the 'reply' user and be sent to the same shell script. Currently, email sent to reply@example.com goes to the script and I pass the unique id in the subject or message body. Would be grateful for any suggestions. Thanks!

Art
  • 119
  • 1
  • 6

1 Answers1

2

In a default qmail setup, you can do exactly what you suggest... anything following a dash is ignored for delivery purposes, so reply-anything@example.com 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 xyz@example.com, and the sender is bounce@sender.com, then the from address is written this way:

bounce-xyz=example.com@sender.com

And a script flags the address as no good.

EDIT:
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 bounce@sender.com, you need a .qmail-default file in ~bounce.

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

Matt
  • 2,720
  • 1
  • 15
  • 9
  • I'm trying to do pretty much the same thing. The problem is that email sent to reply-xyz@example.com fails with a 550 mailbox not found error. Email sent to reply@example.com 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 @? – Art Dec 23 '09 at 19:44
  • Please see my edit - I was missing a step for the catch-alls to work. – Matt Dec 23 '09 at 21:34
  • 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. – Art Dec 24 '09 at 16:05