Regex for archiving rules and port bug
Hi, I m new on piler, i installed it last week. I think it was a bug , when i tried to make piler works on port 10030 (for example) it doesn't work. Piler start correctly but i can't connect to the port. I solved my problem in using port 30.
My problem now is to use regex for archiving rules. I don't want archive message where subject start with "Lu :" i have test with ^Lu : , #^Lu :# , subject: Lu : . But it wont works.
Sorry for my english .
Comments (10)
-
repo owner -
reporter For the port 25 i already have postfix, it's the same server. Piler work fine on port 30.
For my regex this is one header for example :
Return-Path: xxx@xxx.fr Delivered-To: xxx@xxx.fr Received: from localhost (localhost [127.0.0.1]) by xxx.xxx.fr (Postfix) with ESMTP id D9196180A5 for xxx@xxx.fr; Thu, 4 Jul 2013 19:45:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at xxx.xxx.fr Received: from xxx.xxx.fr ([127.0.0.1]) by localhost (xxx.xxx.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N0tzXouehVBW for xxx@xxx.fr; Thu, 4 Jul 2013 19:45:44 +0200 (CEST) Received: from H00T0 (unknown [192.168.100.192]) (Authenticated sender: xxx@xxx.fr) by xxx.xxx.fr (Postfix) with ESMTPSA id A3796180A4 for xxx@xxx.fr; Thu, 4 Jul 2013 19:45:44 +0200 (CEST) From: "xxx" xxx@xxx.fr To: "xxx" xxx@xxx.fr In-Reply-To: <!&!AAAAAAAAAAAYAAAAAAAAAGymmS4XB/NBk0wwABPpsCOigQAAEAAAAEL7qbBRw4BAuJtP1FrDd4kBAAAAAA==@xxx.fr> Subject: =?Windows-1252?Q?Lu=A0:_t?= Date: Thu, 4 Jul 2013 19:42:09 +0200 Message-ID: 009e01ce78dd$cf26dfe0$6d749fa0$@fr MIME-Version: 1.0 Content-Type: multipart/report; boundary="----=_NextPart_000_009F_01CE78EE.92AFAFE0"; report-type=disposition-notification X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac543ax61YXGj+I7SguB6jxZwyhOJwAAAUGG
Thank you.
-
repo owner OK, thanks. There's a program called pilertest in the source directory. make install doesn't put it to /usr/local/bin directory, but still you can use it.
I created a rule on the gui page (administration / archiving rules):
Subject: ^Lu
Now you can test it by running pilertest, eg. ./pilertest /path/to/message.txt
After setting the rule on my test machine I got the following:
locale: hu_HU build: 817 parsing... post parsing... message-id: 009e01ce78dd$cf26dfe0$6d749fa0$@fr from: xxx xxx@xxx.fr xxx xxx fr (xxx.fr) to: xxx xxx@xxx.fr xxx xxx fr (xxx.fr ) reference: subject: Lu : t body: ED treatment PILL S Low prices for popular DRUG S PILL S Wide choice Men ED Pills - Viagra Cialis Levitra at big saving D RUGS PILL S FR OOGO O Buy ED pills here __URL__feelingzXru * sent: 1372959729, delivered-date: 0 hdr len: 1132 body digest: 247ff4756f454f35eaa2ef76709d8f99d3efc84fc602b0590fcdf5c80e5b0f5e rules check: from=,to=,subject=^Lu,size>0,att.type=,att.size>0,spam=-1 retention period: 1593887500 attachments: direction: 0 spam: 0 locale: hu_HU build: 817 parsing... post parsing... message-id: 009e01ce78dd$cf26dfe0$6d749fa0$@fr from: xxx xxx@xxx.fr xxx xxx fr (xxx.fr) to: xxx xxx@xxx.fr xxx xxx fr (xxx.fr )* reference: subject: Lu : t body: *blah-blah... * sent: 1372959729, delivered-date: 0 hdr len: 1132 body digest: 247ff4756f454f35eaa2ef76709d8f99d3efc84fc602b0590fcdf5c80e5b0f5e rules check: from=,to=,subject=^Lu,size>0,att.type=,att.size>0,spam=-1 retention period: 1593887500 attachments: direction: 0 spam: 0
Notice the "rule" line. If there's a hit in the archiving rules chain, then it displays it. So please tune your rule until you get a hit. Then it's important to reload the piler daemon to make it re-read the rules.
You may do it by methods:
#1: send a HUP signal tocat /var/run/piler/piler.pid
#2: click on the "apply changes" button on the gui. Make sure you allow the piler user to execute /etc/init.d/rc.piler reload without asking for a password. -
reporter Thanks for your help,
this is the content of my source file, i dont know how to create pilertest ?
root@mail01:~/piler-0.1.23# ls aclocal.m4 contrib LICENSE piler-config.h test config.log CREDITS Makefile piler-config.h.in util config.status etc Makefile.in README webui configure init.d mkinstalldirs src configure.in install-sh params.h stamp-h1
-
repo owner it's in the src directory.
-
reporter OK, i think my probleme es that i create my rule with : Subject: ^Lu : I try with Subject: ^Lu It work fine.
Do you now why it doesn't work with ":" at the end ? Thank you !
-
reporter Also i have more than 200 mail containing Lu: , have you a solution to remove them of my server ?
Thanks
-
repo owner Regarding the "Lu:" issue: try escaping the : character, ie. \:
There's one way to remove some messages:
- Set retained=1000000000 and deleted=1 in metadata table for those emails you want to get rid of.
- execute "pilerpurge -d" as user piler. -d stands for "dry run". If you are satisfied with the result, run simply pilerpurge.
The periodic indexer job will purge them from the sphinx database.
-
reporter I try with the escape character it wont detect it. I think this is because it add a "Â" Charcter when he copare the data. subject: Lu : t body:
For the moment you solved my problem (i use subject: ^Lu). Thank you very much for your help.
-
reporter - changed status to resolved
- Log in to comment
I recommend you to put piler to a.b.c.d:25, eg. 192.168.1.2:25. Please verify with netstat -an to check where piler listens actually.
Regarding the subject regex issue. Could you paste the header of the email you want to exclude from the archive?