whoisjohngalt Posted April 2, 2004 Posted April 2, 2004 Comments, suggestions, questions welcome. >#!/usr/bin/perl # Account name assigned to you by TCH. # i.e., who do you log in to CPanel with? $accountname = "<accountname>"; # Domain name used for e-mail $domainname = "<domain.name>"; # Mail account this is active for # NOT the entire e-mail address. Just # the section before the '@' sign. $mailuser = "<mailuser>"; # Location of your default mail target $target="inbox"; # Read in from standard input and check each # of our regular expressions. Set targets # accordingly. while(<STDIN>) { if($_ =~ m/^Subject:.*foo/) { $target="foo"; } elsif($_ =~ m/^From:.*badguy/) { $target="badguy"; } elsif($_ =~ m/^To:.*somelist/) { $target="somelist"; } $buffer .= $_; } # Location of your main mail folder $prefix="/home/".$accountname."/mail/".$domainname."/".$mailuser."/"; # Open our target, append our buffer to it, and close it open(MAILFILE, ">>".$prefix.$target); print MAILFILE $buffer; close(MAILFILE); Quote
bwh1248 Posted August 21, 2006 Posted August 21, 2006 Hello, I found your filter script and was thinking about giving it a try. But I wanted to see if you were still using it and how it has worked out for you over the last 2 years. I don't want to spend time trying to implement it if you have found problems with it over time. Thanks... Brian Quote
TCH-Bruce Posted August 21, 2006 Posted August 21, 2006 Welcome to the forums Brian. This was the last post added by this user. You may want to review one of the other threads discussing this. It too is very old. Quote
bwh1248 Posted August 21, 2006 Posted August 21, 2006 Bruce, Thanks for the reply. I noticed this user hasn't been active since Jan. '06, but I was hoping they may still be lurking around someplace and could give me an update on their experiences with this script. I did review the only other thread I saw this script discussed in, but as you said, that thread was very old also. Has there been any change in TCH's policy regarding more advanced server-side e-mail filtering tools such as ProcMail or Sieve? I don't necessarily even want true support for these other tools, just the ability to use them "at my own risk". I know you can setup basic forwards and filters in cPanel, but unfortunately, those aren't quite doing what I want to do. What I really need to do is filter out Spam to a junk folder, but just for selected e-mail accounts, not all of them. And the filters in cPanel (including the automatic one you can setup in the SpamAssassin configuration screen) apply to all accounts in the domain from what I can tell. Any help in figuring out an efficient way to do that on the server would be appreciated. Thanks... Brian Quote
TCH-Bruce Posted August 21, 2006 Posted August 21, 2006 The policy has not changed. TCH uses cPanel and if they ever decide to include something like that I'm sure TCH would offer it after testing it to be sure it worked as advertised. Quote
bwh1248 Posted August 21, 2006 Posted August 21, 2006 I have to say that I'm rather surprised that this type of functionality isn't provided in any supported way on TCH. It would be very useful functionality for users and something that you guys really should consider supporting, even if cPanel doesn't directly support ProcMail or Sieve. Please note, I'm not talking about the products, I'm talking about the functionality. I don't care about a particular product or way or doing something, just that I can accomplish the desired goal (in this case, advanced server-side e-mail filtering). If you could please mention this to the "higher ups" for consideration. Thanks... Brian Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.