From: Piotr Koper (no email)
Date: Sun Aug 01 2004 - 14:09:31 EDT
On Sun, Aug 01, 2004 at 09:45:51AM +0200, Piotr Koper wrote:
>
> How can I redirect all bounce (any errors/warings) messages to one
> user so as to edit them within PERL script.
>
> Is there any other way to connect perl script to postfix, to get
> all the bounce messages redirected?
>
> Maybe some patches are needed?
>
I've written a patch for Postfix 2.1.3 to fit my needs:
--- bounce.c.orig 2004-08-01 16:37:08.000000000 +0200
+++ bounce.c 2004-08-01 17:01:57.000000000 +0200
@@ -251,6 +251,7 @@
msg_warn("malformed request");
return (-1);
}
+ vstring_strcat (sender, "@bounce"");
if (mail_queue_name_ok(STR(queue_name)) == 0) {
msg_warn("malformed queue name: %s", printable(STR(queue_name), '?'));
return (-1);
@@ -300,6 +301,7 @@
msg_warn("malformed request");
return (-1);
}
+ vstring_strcat (sender, "@bounce"");
if (mail_queue_name_ok(STR(queue_name)) == 0) {
msg_warn("malformed queue name: %s", printable(STR(queue_name), '?'));
return (-1);
@@ -367,6 +369,7 @@
msg_warn("malformed request");
return (-1);
}
+ vstring_strcat (sender, "@bounce"");
if (strcmp(service_name, MAIL_SERVICE_BOUNCE) != 0) {
msg_warn("wrong service name \"%s\" for one-recipient bouncing",
service_name);
+ virtual alias (@bounce.some.domain -> )
+ local alias ( -> "/path/to/script")
In result the ``To:'' header looks like: To: @bounce.some.domain)
This works fine but is there any other way to do this job? (by postfix configuration?)
Cheers,
Peter
-- For some reason, cows all seem to face the same way when standing in a field (honest - you look!). I used to believe that this was because they all pointed to magnetic north. Amanda (from animals : general) <url:http://www.iusedtobelieve.com> I use to think sheep shrank when it rained. Anon (from animals : general) <url:http://www.iusedtobelieve.com>
|
|
|