LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   forward emails (in a specific folder) to a set email address (https://www.linuxquestions.org/questions/linux-general-1/forward-emails-in-a-specific-folder-to-a-set-email-address-4175622159/)

rs232 01-22-2018 10:36 AM

forward emails (in a specific folder) to a set email address
 
Here it goes:

my antispam software (ASSP) accepts spam reports when emails are sent to and admin mailbox e.g. spam@mydomain

I currently have instructed the users to save spam emails into their personal Spam email folder.
Is there any smart way to forward emails spotted into that personal Spam folder to spam@mydomain?
The message must be forwarded in attachment in .zip format.

I suppose procmail should do but not sure on the syntax to forward emails on a source folder basis.

Thanks

scasey 01-23-2018 01:56 PM

Which method is being used to store email? That is, mbox or Maildir?

On a Maildir system, the root user could just cp the messages from the user's folder (~user/Spam/new/ or cur/) to the spam@ folder...or mv them and chown them to the spam@ user. No forwarding or compressing required. I've no clue how (or if) it's possible to manipulate email messages that way in an mbox storage scheme.

In
Code:

man procmail
I find an entry in the NOTES section beginning with
Quote:

Procmail can also be invoked to postprocess an already filled system mailbox
that includes a script for (maybe) doing what you've asked about.

Oh.
Code:

man procmailrc
for details on procmail recipes.


All times are GMT -5. The time now is 08:59 AM.