LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-22-2018, 10:36 AM   #1
rs232
Member
 
Registered: Oct 2005
Posts: 51

Rep: Reputation: 0
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

Last edited by rs232; 01-23-2018 at 04:13 AM.
 
Old 01-23-2018, 01:56 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,733

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix - how do I drop emails from external sources to a specific address. tandeejay Linux - Software 1 07-29-2016 02:01 AM
Redirect / forward mail to another user from specific address. nishith Linux - Server 1 06-30-2009 01:59 PM
run a shell script/cronjob when any email arrive to specific email address ikillu Linux - General 3 05-30-2009 08:18 AM
Any email clients which can encrypt and then forward emails based on a rule/filter? curtisa Linux - Software 1 02-01-2009 08:03 AM
How to Forwarding all old emails to a new email address tvn Linux - Software 1 12-04-2004 07:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration