> 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 -- Viktor.