Through some misconfiguration I've a lot of emails in /var/mail/root and /var/mail/www-data
How can I "loop" over these files and send each mail another time?
emaileximgreploggingsendmail
Through some misconfiguration I've a lot of emails in /var/mail/root and /var/mail/www-data
How can I "loop" over these files and send each mail another time?
Best Answer
formail, part of procmail (and probably already available on your system) can take a mailbox, split it up into messages, and then run a command on each one. From the man page:
So you can do what I think you want like this: