On 09/11/2013 11:49 AM, Brent Gardner wrote:
List-

I need to alter the subject in all messages sent to a specific address
hosted on my toaster then forward to another address owned by us a
different system.

Let's say my toaster is authoritative for example.com.  For every
message sent to [email protected], I want to alter the subject, adding
something like '[ticket#]' then forward to [email protected].

To recipients of the forwarded message, it will appear that the message
was sent by the original sender.

So far I've tried to handle this with a script and entries in
/home/vpopmail/domains/example.com/foo/.qmail.  Here's the contents of
the .qmail file:

     |/home/vpopmail/scripts/munge.pl
     &[email protected]


This works somewhat.  The script looks at each line on input from stdin
and spits it back out on stdout unless it starts with 'Subject:' in
which case it alters the lines as desired before outputting.  I can see
in debug output that the script executes and alters the subject as
desired.  Unexpectedly, I also see the output of the script in
/var/log/qmail/send/current.  The message is then forwarded as desired
but the message received by [email protected] does not include the
changes to the subject.

I suspect that I misunderstand the capabilities of piping to a script.

Am I close?

Is there some other tool I can use?


Regards,


Brent Gardner


---------------------------------------------------------------------

Each line in the .qmail file corresponds to a copy of the email. The first line is sending a copy to your script, which is sending it to stdout which subsequently goes to the log as you've found. The 2nd line sends another copy to the email address you specified. So it's doing what it's supposed to. :(

So the problem is, how to get your script to deliver to a given address. I think if you put something like this in .qmail, it might work:
|/home/vpopmail/scripts/munge.pl | qmail-inject [email protected]

Another option might be to use maildrop, but I would discourage that at this point in time. I expect maildrop will become obsolete at the time (perhaps next year) when QMT adopts use of dovecot's "deliver" LDA along with pigeonhole (sieve) filtering. Server-side message filtering that's controllable by users - now there's a cool feature! :)

--
-Eric 'shubes'


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to