marlam / mpop

POP3 client
https://marlam.de/mpop
GNU General Public License v3.0
13 stars 1 forks source link

feature request: transform email #12

Open michaelcadilhac opened 1 year ago

michaelcadilhac commented 1 year ago

It would be nice if mpop could, on the fly, transform (headers of) emails. Something like a transform prog option that runs prog with the email on stdin, and uses the stdout as the transformed email.

Rationale: I'm fetching emails from an Outlook server, and storing them on a private server (maildir). Gmail is then accessing my private server and fetching these. Problematically, Outlook adds "Received" headers, and Gmail complains that Outlook is not a permitted sender for whichever address the email originated from. I'd like to "sanitize" the email by flushing the "Received" headers from Outlook.

marlam commented 1 year ago

You can do that with delivery mda /path/to/my-script. The script reads the mail, optionally transforms it in some way, and then puts it into a maildir or mbox file (or uses a program such as procmail to do that last step).

michaelcadilhac commented 1 year ago

Aah, of course! Thanks Martin. This is not exactly the same, since I have to rewire the maildir/mbox/exchange with a different tool rather than just use mpop, but this does work indeed. Feel free to close this feature request if you think that it'd be redundant.

marlam commented 1 year ago

I agree that it would be nice to have a transform or process command that filters the mail before it goes to the delivery stage. I'll keep this issue open as a reminder for later.