Koozali.org: home of the SME Server

Forward emails containing particular text

Offline JohnG

  • ****
  • 89
  • +0/-0
Forward emails containing particular text
« on: December 27, 2012, 11:49:16 PM »
What is the best way to forward/copy emails that contain certain text strings to another local email account? Ideally I'd like to do this on the server rather than using rules on each client.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Forward emails containing particular text
« Reply #1 on: December 28, 2012, 09:06:14 AM »
JohnG

Configure the .qmail file(s) for that user, in /home/e-smith/files/users/username
(replace username with the actual user name)

Alternatively
see
http://www.dungog.net/wiki/Usermanager
and
http://www.dungog.net/wiki/Dungog-email
and install the usermanager (smeserver-userpanel) & mailsorting (smeserver-mailsorting) contribs & configure procmail or mailsorting with the GUI user manager panel, when logged in as the user to https://yourdomain/user-manager
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline JohnG

  • ****
  • 89
  • +0/-0
Re: Forward emails containing particular text
« Reply #2 on: December 28, 2012, 04:33:08 PM »
Thanks for the quick response!

I had already installed the usermanager/mailsorting contribs hoping they would do the trick. From what I can tell, it only looks at the email address, header, subject, or the size, not the actual email body.

I think configuring the individual .qmail files seems like it's too late since I'm looking to examine the emails as they come in.

For example, ideally I'm looking for something like our maillog that examines all emails for "projectx" and forwards them all to a "projectx" user, regardless for who sent it. Can the contribs and/or .qmail files do that or do I need something else?

Thanks in advance.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Forward emails containing particular text
« Reply #3 on: December 28, 2012, 04:50:40 PM »
JohnG

procmail
www.procmail.org

Here is one example of many to filter on body content, see
http://lipas.uwasa.fi/~ts/info/proctips.html#setvar
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.