Re: [Exim] Failure/Bounce messages in Exim 3.36

Top Page
Delete this message
Reply to this message
Author: Paul Miles
Date:  
To: exim-users
Subject: Re: [Exim] Failure/Bounce messages in Exim 3.36
Hi.

I've found a workaround for this, which I thought others might be interested
in.

It seems to work in our environment although its certainly not elegant.

Just re-cap, when exim sends a bounce message, it embeds the original
message inside the bounce message, which makes attachment retrieval
frustratingly time consuming.
(Original problem at bottom of mail)

The work around is as follows :

exim config changes
===============
return_size_limit = 0
message_size = 0
errors_copy = postmaster-error@???

email aliases
========
I've created the new email alias, postmaster-error@??? as follows :

postmaster-error: |/usr/local/bin/sendto.pl

Quick script
========
I've written the following very nasty perl script that parses error messages
sent to postmaster-error@???, and then sends them onto
postmaster@??? as an attachment.

#!/usr/bin/perl

use strict;

my $body = 0;

my $pid = $$;
my $filename = "/tmp/OriginalMessage.$pid.eml";
my $header_file = "/tmp/Header.$pid.eml";

open (inf, ">$filename") or die "unable to open $filename";
open (header, ">$header_file") or die "unable to open $header_file";

my $expect_blank = 0;

while (<>)
{
  if (($body) && (!$expect_blank))
  {
    print inf $_;
  }


  if ((!$body) &&
      ($_ =~ /^------ This is a copy of the message, including all the
headers. ------$/))
  {
    $body = 1;



    $expect_blank = 1;


  } else {
    print header $_;
  }


  if (($expect_blank) && ($_ =~ /^\n$/))
  {
    $expect_blank = 0;
  }


}

close inf;
close header;

`/usr/local/bin/juen -A -m postmaster\@mydomain.com -s "Failure Message -
Original mail attached" $header_file $filename`;

unlink $filename;
unlink $header_file;

External programs
============

I use a program called juju to send it as an attachment.
(http://hottemax.uni-muenster.de/~grover/juju.html)

It all seems to work, just! :-)

If you can think of any improvements then please let me know.

Kind regards,

Paul.



----- Original Message -----
From: "Philip Hazel" <ph10@???>
To: "Paul Miles" <paul.miles@???>
Cc: <exim-users@???>
Sent: Wednesday, October 09, 2002 4:10 PM
Subject: Re: [Exim] Failure/Bounce messages in Exim 3.36


> On Wed, 9 Oct 2002, Paul Miles wrote:
>
> > At the moment I have a small problem in that when a message legitimately
> > bounces (for what ever reason), I have of the original message included

in
> > the failure message. At the moment it embeds the message, and quite

often
> > truncates them.
> >
> > I would like to recieve a failure message with an attachment containing

the
> > original message in its entirity. I've looked through the Exim

documentation
> > and nothing like this has jumped out at me yet. IS it possible to do?
>
> I'm afraid not.
>
> (1) You can stop the truncation by setting return_size_limit.
>
> (2) Somewhere, buried on my work/wish list, is an item for generating
>     bounces using attachments, but I'm afraid it has never got anywhere
>     near the top of the list. It has to be optional, because there are
>     plenty of people who do not want it.

>
>
> --
> Philip Hazel            University of Cambridge Computing Service,
> ph10@???      Cambridge, England. Phone: +44 1223 334714.

>
>