1

there are some bounce mails in the /var/spool/mail/USER directory that failed to send. Now the customer receives all of those mails from us because he does not have direct access to them.

I can forward one by one with mutt, but there are so many of them. Is there any shortcut to ...

  • ... send all mails as attachment to the customer?
  • ... forward all mails with their attachments in a tricky script?

This does not seem unusual so I hope someone knows the solution.

Cheers!

LeMike
  • 179
  • 1
  • 8

1 Answers1

3

Use something like:

formail -i "To: user@example.com" -s sendmail -t < /var/spool/mail/USER

formail is usually included with procmail. This will add a new To: header while replacing any old To: header with Old-To:. sendmail -t is executed for each message found in the standard input.

wurtel
  • 3,864
  • 12
  • 15