On 2023-04-11 Gilbert Detillieux wrote:
You could probably use sendmail's "-t" option, to resend to all recipients shown in the mail headers. Or, if there's just the one recipient, you can always just explicitly supply them as a command line argument.
If Kevin means the path named is a text file in mbox format containing multiple emails then sendmail will not work. It will just (at best) send the first email in the mbox.
You might have to split the mbox file into multiple files (I'd do a perl -ne oneliner), then use whatever to resend each email individually. Just plain "mail" can be useful for some things; as can formail if you need to manipulate headers.
If there's not too many emails, you can always mutt -f the mbox file and use "b" to "bounce" the emails to the real recipient. Put the destination email address in your X cut buffer and just hit shift-insert after b. Heck, put the entire "b the@email.com enter" into a nano cut buffer and hit shift-insert X times to go through the whole thing. Might be faster than figuring out the command lines (though not as satisfying).