On 4 March 2017 at 17:55, Viktor Dukhovni <postfix-us...@dukhovni.org> wrote:
>
>> On Mar 4, 2017, at 9:56 AM, Dominic Raferd <domi...@timedicer.co.uk> wrote:
>>
>> I have a similar situation. I wrote a script which spots the relevant
>> bounce message in the mail log, from this it extracts the queue-id and
>> uses this to identify the copy of the original email saved in the
>> temporary local mailbox (which saves all mails passing through the
>> server). It extracts this email from there and forwards it as an
>> attachment to the relevant person using s-nail, with an explanatory
>> cover message. The same approach might work for you.
>
> This is much too complex.  To attach email message to another message,
> just pipe it through the shell script below my signature.  This can
> be used as part of a pipe(8) transport with the output submitted via
> sendmail(1) for delivery.
>
> --
>         Viktor.
>
> #! /bin/sh
>
> sender=postmaster
> rcpt=lu...@example.com
>
> cat <<EOF
> From: $sender
> To: $rcpt
> Subject: Encapsulated bounce for your perusal
> MIME-Version: 1.0
> Content-Type: message/rfc822
>
> EOF
> cat

That gets round the s-nail dependency (the final step in my script),
so thank you, but in my case (not so sure about OP) I need to recover,
and send on as encapsulated, the original email that has just been
bounced by the onward server, not the bounce message itself. Apart
from your change to this final step, is there a much easier approach
than mine in this situation?

Reply via email to