Subject: How did I make my sieve filter work again
OK, I was decided to make this work. After reading and reading sieve samples, I discover something that maybe helps other.
I got this sieve error messages before my "fix". Of course this means that I have some errors on my sieve filters.
sieve2_execute() returned 11: Sieve Error: header could not be parsed
sieve2_validate() returned 12: Sieve Error: script was not retrieved
I don't remember what mistakes have the filter that cause the previous errors, but with my new filter at this moment I don't have sieve error messages on Citadel.
First, many examples on Internet have this kind of line (but don't work on citadel v7.83)
require ["fileinto", "reject"];
For this to work we need to put one line for every requierement like this:
require "fileinto";
require "reject";
require "vacation";
require "envelope";
But not only this Is need it to make a sieve filter to work on Citadel, for some reason when I save my sieve filter the Citadel parser or whatever is called "eats" the first char on the 1st line, so to fix this I found by try and error that if I put on my first line the char "#" many times the parser respect this line and don't eat the first char, so the filter is not broken.
This is my current sieve filter that works!
This test and other where made on an account that POP mail from another very spammed mail, the fetch the mails every 5 minutes and by all means I need to discard the spam and redirect the ham. For my test I create another room called "Forward" so I manage this POPed account using IMAP and when I see a mail in the "Forward" folder I very sure that the mail was delivered to the right users. (please note that each line starts with a char space, maybe is not need it, I try this many months ago and when I leave the line without the space I got errors, since those days by habit I start every line with one o more spaces... and oh well it works.
### ###
##require ["fileinto", "reject"]; *** This line choke the sieve2_
##require ["fileinto", "reject", "envelope", "vacation"]; *** this was another "sample" that don't work
require "fileinto";
require "reject";
require "vacation";
require "envelope";
#! just_redirec_to_some_users
if header :contains ["Subject"] [
"some string", "s.o.m.e.w.e.i.r.d.s.u.b.j.e.c.t."
] {
redirect "some.user@sampledomain.com";
redirect "for.me@sampledomain.com";
fileinto "Forward";
stop;
}
#! redirect for sales
if header :contains ["From"] [
"bankinfo@bank.com", "@bank.com", "*@bank2.com", "alert@bankservice.com"
] {
redirect "some.user@sampledomain.com";
redirect "for.me@sampledomain.com";
fileinto "Forward";
stop;
}
#! my_spam_test
if header :contains ["Subject"] [
"1234567F-I-L-T-E-R-ME"
] {
redirect "for.me@sampledomain.com";
fileinto "Forward";
#discard;
stop;
}
Hope someone find this helpful.
Regards, s3cr3to
IG, regarding your rework of sendcommand & setup...
Is password recovery going to continue working?
Subject: Re: How did I make my sieve filter work again
Sad, I take my words back, my sieve filters works but the sieve errors came back
sieve2_execute() returned 11: Sieve Error: header could not be parsed
sieve2_validate() returned 12: Sieve Error: script was not retrieved
Oh well, maybe is the server that is "choked" (with no activity maybe is bored), I just hope that my users don't miss some mails. I can see in the logs that some mails are wel redirected but today is a slow day, maybe at monday I can see more activity.
Regards
Subject: Re: How did I make my sieve filter work again
Sat Feb 25 2012 06:36:45 PM EST from IGnatius T Foobar @ Uncensored Subject: Re: How did I make my sieve filter work againI wonder if we should simply drop support for Sieve and parse the rulesets as they are.
Hope not drop Sieve, when it works is more powerfull and easy to maintain that have dozens rules. I ignore is with rules we can write filters like this or I need to write many filters just to do it:
I don't know if using filter rules I can include many individual strings for the subjects:
#! spam_by_subject
if header :contains "Subject" [
"mundial" "football", "futbol", "cierran hotmail", "linkedin","Quepasa.com", "URGE ENCONTRARLO", "se perdio en" , "RV: por favor", "SOLO ES UN", "miss you", "this is cool", "Look what i found", "I want to show you" , "...more spam subjects ... ", "Marketing" ] { discard; stop; }1 if [Subject] [contains] {string1, string2, string3} [Discard silently] [stop]
In the rule #1, I don't know how to separate many subjects in just one rule... it's posible?
Also I don't know how to reproduce in sieve a reject filter with a message :
2 if [From] [is] {spammer@domainxyx.com} [Reject] Message: {bug off!}. [and then] [stop]
Also maybe is posible to create a rule using more than one email or more than a part like:
3 if [From] [is] {spammer@domainxyx.com , another@otherweir.do} [Reject] Message: {bug off!}. [and then] [stop]
4 if [From] [contains] {domainxyx.com , otherweir.do , hi5} [Reject] Message: {bug off!}. [and then] [stop]
I know that in sieve I can try this:
# spammer_by_address
if header :contains ["From"] [ "clubspam", "superspam", "hi5.com", "direct-promo.net", "onedateinvite", "adobeinfo.com", "bizz", "twitter", "linkedin" ] { discard; stop; }
I need to use sieve, to filter the mails from an external mail account that is retrieved by POP and spamassassin don't works here... really I hope some day discard this external mail but in the mean time sieve is the only that can help to now, just 1% are important mails that I can't afford to loose the other 99% is just trash, and is really hard to sort out the cr*p without sieve or without a more powerfull filter system (that I don't know if exist or how to use).
Thanks for your pacience, forgive me if I do wrong for write here instead of support.
Subject: Re: Please don't drop sieve
Other software does this as well. Thunderbird for example will briefly flicker a message into your inbox from time to time before it gets handled.
Hi
Mon Feb 27 2012 07:24:37 ESTfrom IGnatius T Foobar @ Uncensored Subject: Re: Please don't drop sieveOk, well in any case you don't have to worry about losing mail. The way our implementation works is that Sieve runs *after* a message arrives in the user's inbox. The absolute worst case scenario is that a message is left in the inbox.
Other software does this as well. Thunderbird for example will briefly flicker a message into your inbox from time to time before it gets handled.
IG, regarding your rework of sendcommand & setup...
Is password recovery going to continue working?
Yes, in fact it works better now than it did before. You just run setup and it does the right thing; it will even extract the correct admin password and let you verify and/or change the password.
We inadvertently released a couple of versions where this didn't work at all because davew didn't understand what the "master user" function was for (hint: it's not an administrator)
Subject: Re: How did I make my sieve filter work again
sieve2_validate() returned 12: Sieve Error: script was not retrieved
This error results from an "empty" script being fed into the Sieve parser.
I have committed a change that will check for this condition and stop processing instead of throwing a spurious error.
The bit about eating the first character of the script is concerning. Right now I am looking into a WebCit problem that is preventing the display of the form that allows custom scripts. After I resolve that, I'll see what's happening with the first character.
Subject: sample of filter w/space eaten and why my filter don't work?
Tue Feb 28 2012 01:22:07 PM EST from IGnatius T Foobar @ Uncensored Subject: Re: How did I make my sieve filter work againThe bit about eating the first character of the script is concerning. Right now I am looking into a WebCit problem that is preventing the display of the form that allows custom scripts. After I resolve that, I'll see what's happening with the first character.
Here is a sample of my sieve filter Citadel 7.83.
During edition; before save there is a space in the first line,
### ###
require "fileinto";
require "reject";
#!1 spam_subject
if header :contains "Subject" [
"string1", "string2_subject", "1234567A-B-CZAP"
] {
discard;
stop;
}
After saving see the space eaten
### ###
require "fileinto";
require "reject";
#!1 spam_subject
if header :contains "Subject" [
"string1", "string2_subject", "1234567A-B-CZAP"
] {
discard;
stop;
}
If the first line is something like: require "blah"; I recall that the filter fails, maybe the parser get the line as: equire "blah"; eating the first char.. maybe.
I see something like that when I was editing the "banners" or was the "bio"?, but maybe is normal/by desing to write two new lines to have a new line.
I have some fun trying to write my sieve filters, I have the chance to test an old Kerio (not ad intended) mail server in windows with sieve filters; for some reason the K#rio sieve filters works fine but not in Citadel.
Here is a sample of the old filter that works in K#rio. i see that only a "few" rules for my sieve filter works, looks like the "full" filter is not proceeded.
Maybe exists a length limit for the text of a sieve filter?
#!1 :spam_discard
if address :all :contains "From" ["@market.info", "linkedin.com", ".co.th" ,"@spammer" ] {
discard;
stop;
}#!1 :spamxreplyto_delete
if address :all :contains "Reply-To" ["@market2.info", "@LIST.RU", "@live.fr", "@badspammer.com", "@spammerother.com"] {
discard;
stop;
}## I can combine this
#!1 :TO_us_FROM_someone
if anyof (address :all :contains ["To", "Cc"] "for_us@gmail.com", address :all :contains "From" "@someone.com") {
redirect "to_us@domain.com";
redirect "to_us2@domain.com";
fileinto "forward";
stop;
}
I include my edited filter, maybe it helps or make thing worse :) just in case
Regards
require "fileinto";
require "reject";
require "vacation";
require "envelope";
#! a1
if header :contains "From" [ "someon@bigcorp.com"
] {
redirect "mailbox1@ourdomain.com";
redirect "mailbox2@ourdomain.com";
redirect "mailbox3@ourdomain.com";
redirect "myownbox@ourdomain.com";
fileinto "Forward";
stop;
}
#! para v1
if header :contains ["Subject"] [ "GOOD1", "GOOD2"
] {
redirect "mailbox4@ourdomain.com";
redirect "myownbox@ourdomain.com";
fileinto "Forward";
stop;
}
#! para ventas2
if header :contains ["From"] [ "frombank@bank.com"
] {
redirect "mailbox4@ourdomain.com";
redirect "myownbox@ourdomain.com";
fileinto "Forward";
stop;
}
#! spam_test
if header :contains ["Subject"] [ "1234567A-B-C"
] {
redirect "myownbox@ourdomain.com";
fileinto "Forward";
#discard;
stop;
}
#! a2
if header :contains "Subject" [ "Report From ", "GOOD-ONE2"
] {
redirect "mailbox1@ourdomain.com";
redirect "mailbox2@ourdomain.com";
redirect "mailbox3@ourdomain.com";
redirect "myownbox@ourdomain.com";
fileinto "Forward";
stop;
}
#! r1
if header :contains ["From"] [ "yes1@good3.com", "yes2@good4.com"
] {
redirect "mailbox8@ourdomain.com";
redirect "myownbox@ourdomain.com";
fileinto "Forward";
discard;
stop;
}
#! r2
if header :contains ["From"] [ "good2","*good2*", "ok@good2.com"
] {
redirect "mailbox5@ourdomain.com";
redirect "mailbox6@ourdomain.com";
redirect "myownbox@ourdomain.com";
fileinto "Forward";
discard;
stop;
}
#! v2
if header :contains "From" ["a1234@good.com"
] {
redirect "mailbox7@ourdomain.com";
redirect "mailbox1@ourdomain.com";
redirect "myownbox@ourdomain.com";
fileinto "Forward";
stop;
}
#! c
if header :contains "Subject" ["ALWAYSGOOD"] {
redirect "mailbox2@ourdomain.com";
redirect "mailbox7@ourdomain.com";
fileinto "Forward";
stop;
}
# This filters don't work... but why?
if header :contains "Subject" [
"Gold Members Food Products", "Ahora si", "futbol", "cierran hotmail", "linkedin", "al parecer es real"
, "LO PASARON EN LA TELE", "Quepasa.com", "URGE ENCONTRARLO", "se perdio en"
, "RV: POR favor", "SOLO ES UN", "miss you", "Evaluando ERP"
, "quiere ser tu amigo/a en Windows Live", "Mira lo que me acaba de llegar"
, "this is cool", "Look what i found", "I want to show you"
, "PARA LA DIRECCION GENERAL", "empleados con", "Huella Digital"
, "vea su registro por", "enviar a todos", "GUARDERIA AB"
, "Condolencias", "bajar de peso", "promocion", "Sorprendete"
, "Convencete", "Afiliate", "Marketing", "Seminario", "revista", "vacaciones en", "taller de", "Gold Members", "Food Products", "incrementar sus ventas"
] {
discard;
stop;
}
# This filters don't work... but why?
if header :contains ["From"] [ "robert_zz@hotmail.com", "webbcenter", "badoo", "linkedin", "ivan.aguayo@nextel.mitmx.net", "toyotasantafeonline", "elsemanario", "gvaweb", "paginaswebcreaciones", "lanzaweb", "*lanzaweb*", "rosasregalos", "ultimate", "contanoconta", "mercadogrupal", "nnnoticias@gmail.com", "proyecciondelcapitalhumano", "humanagement", "lozano.sandra.obra@gmail.com", "sap@mailsap.com", "aibonline", "ceorecluta", "aroblesm76", "samuel.pasillas.landeros@banorte.com", "top-it", "gie.net", "comintegral", "cabreran@avimex.com.mx", "aliciasandovalcursos", "mysitesnews", "agritendencias", "maquinaria", "subastas", "juice4life", "promociones", "esmexico", "thot.mx", "@consist", "fooddirectories", "csloxinfo", "@ipmsoluciones.com", "collegeabroad", "securemailingplus", ".info", ".info", "ventasnacionales@prodigy.net.mx", "@gmag", "marketing", "@compusoluciones.com", "planeacionestrategica", "@ultimate-mail", "karla.quintero.df@gmail.com", "akwo@csloxinfo.com", "marketinggem@etytec.com", "Duke@ibamarket.com", "*@ibamarket.com", "webmaster@licigob.com.mx", "presidente@canacintranayarit.com", "vtainvestments@gmail.com", "ventas@publytaxi.com", "comunicados@tiempoairemovistar.com.mx", "fooddirectories@csloxinfo.com", "@csloxinfo.com", "soporte@lasubasteria.com", "@lasubasteria.com", "cyndi.morgado@gmail.com", "webmaster@mefintax.com.mx", "@mefintax.com.mx", "genesys@genesyslab.com", "@genesyslab.com", "calzapacifico@hotmail.com", "contacto@entrenamientosempresariales.com.mx", "@entrenamientosempresariales.com.mx", "*@entrenamientosempresariales.com.mx", "mt.mexico@mt.com"
] {
discard;
stop;
}
# This filters don't work... but why?
if header :contains ["From"] [ "interlegit.com", "tablero", "tumayra2010", "socioaguila@clubamerica.com.mx", "clubamerica.com.mx", "supertravel", "hi5.com", "@viajeseci.com.mx", "@direct-promo.net", "@simorelos.com", "onedateinvite", "adobeinfo.com", "mercadotecnia", "@dominionmexico", "@roshfrans.com", "acempresarial", "entrenamientoace", "deportes6am@gmail.com", "twitter.com", "humanagementt.com.mx", "cadenalogistica.com", "enviosgee.com.mx", "tumayra2010@yahoo.com.mx", "roshfrans", "flixster", "cosica.com", "rotsylouis@hotmail.com", "gueko", "manuel.maldonado.m@hotmail.com", "buja202@hotmail.com", "bizz", "rc-extended", "ayuda@prodigy.net.mx", "ivan.aguayo@nextel.mitmx.net", "nnnoticias@gmail.com", "promociones@toyotasantafeonline.com", "contacto@elsemanario.com.mx", "instituto@kpa.com.mx", "milenio", "editor@reporteroindustrial.com", "aliciasandovalcursos@gmail.com", "lopes.georgina1986@gmail.com", "maria.garcia269@gmail.com", "paraelrestaurante","autoclub", "*@actualiza*"
] {
discard;
stop;
}
keep;
Subject: Re: sample of filter w/space eaten and why my filter don't work?
I'm more concerned with the characters being "eaten". Can you show me the original line of script and what it looked like after it was mangled?
Subject: Re: sample of filter w/space eaten and why my filter don't work?
My previous post has the sample, here is anyway:
Here is a sample of my sieve filter Citadel 7.83.
The first line has a space, select the line to see it:
### ###<--the first char in this line is a space
require "fileinto";
require "reject";
#!1 spam_subject
if header :contains "Subject" [
"string1", "string2_subject", "1234567A-B-CZAP"
] {
discard;
stop;
}
After saving see the space eaten
### ###<--the first char, the space is gone after saving
require "fileinto";
require "reject";
#!1 spam_subject
if header :contains "Subject" [
"string1", "string2_subject", "1234567A-B-CZAP"
] {
discard;
stop;
}
I copy this from my current sieve filter. I ended using a line commented "#" because of this issue.
Regards
Subject: Re: sample of filter w/space eaten and why my filter don't work?
I'm testing my filters on both servers (easy install 7.86 and debs v7.83)
Until now only the first char if is a space is eaten in the first line, I can't remember if I see something more, because I can't write my sieve filters like I do at first, now I use many lines and spaces to read more easily and my first test were more dirty writen. Sorry... I
Even this "ugly" one works.
require "fileinto";
require "reject";
if header :contains "Subject" ["1234567A-B-CZAP"]{discard;stop;}
keep;
I think that was the sample filter from the web that I use before that give me more "errors" :
require ["fileinto","reject"];
Regards
Subject: Re: sample of filter w/space eaten and why my filter don't work?
Hi,
I tried to build citadel 8.10 on fedora. But it quits with error: ev.h was not found.
But it is installed:
# rpm -ql libev-devel
/usr/include/libev
/usr/include/libev/ev++.h
/usr/include/libev/ev.h
/usr/include/libev/event.h
/usr/lib64/libev.so
/usr/lib64/pkgconfig/libev.pc
/usr/share/man/man3/ev.3.gz
With openSUSE the build is no problem because it places libev directly under include:
# rpm -ql libev-devel
/usr/include/ev++.h
/usr/include/ev.h
/usr/include/event.h
...
Is it possible to make the configure script look in both places, or can I tell the configure script where to look for ev.h?
Thanks
Stefan
uhm. thats awfull, since it will make easy install a hard job.
does it work with
CFLAGS=-I/usr/include/ev
LDFLAGS=-L/usr/lib/ev
?
regarding the size of libev, thats a real option.
regarding that everything is in /usr/local/citadel and nobody is going to use it anyways so there is no duplicate loading which dynamic libs try to avoid... so static might be well also.
Subject: Re: sample of filter w/space eaten and why my filter don't work?
(updated in git and in Easy Install, so far...)
Hi,
maybe you'll find systemd's socket activation feature interesting:
http://0pointer.de/blog/projects/socket-activation.html
http://0pointer.de/blog/projects/socket-activation2.html
Regards
Stefan