I have just completed an experimental integration of razor into an MTA (of my own design) that I am working on.
I haven't initially been getting anything like the performance I was expecting, and I have been doing some digging around to try and understand why not. The first thing I noticed was that only 'text' SPAMs were getting correctly identified. I then ran some examples by hand, and noticed that though MIME separators were getting correctly identified, no MIME blocks were getting processed. After some scratching of the head (I'm not a perl programmer) I came to the conclusion that one of the main culprits is in String.pm, line 835: my @tmpparts = split /\n\Q--$boundary\E\n/, $body; Certainly a lot of the mail that comes through my system contain "\r\n" at the end of lines. So, wouldn't my @tmpparts = split /\n\Q--$boundary\E\r*\n/, $body; be a safer option? I tried it and it certainly improved the parsing up to a point, but I suspect that the situation is rife throughout the code. So here is my list of possible scenarios: 1. I need to do some preprocessing on my mail file (they are exact images of what I receive via SMTP), eg replace all instances of "\r\n" with "\n". I haven't looked at the preprocessing that razor does prior to generating sigs but clearly modifying the mail message may render academic the whole exercise ... however, maybe whitespace doesn't matter. 2. There is some configuration issue I have come up against. 3. There is actually a serious bug here that needs to be fixed. I regard that as unlikely given the presence and reputation of razor in the world. However ... Any ideas however ludicrous gratefully received. I have plenty of examples that fail if anyone wants a look. Cheers Jim PS a typical example of a razor-check session with a file containing several MIME blocks: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Razor-Log: Computed razorhome from env: /root/.razor Razor-Log: Found razorhome: /root/.razor Razor-Log: read_file: 14 items read from /root/.razor/razor-agent.conf Oct 14 19:16:41.521281 check[20921]: [ 1] [bootup] Logging initiated LogDebugLevel=20 to stdout Oct 14 19:16:41.522672 check[20921]: [15] cmd-line options: HASH - HASH(0x8453450),2 keys debug => 1 debuglevel => 20 Oct 14 19:16:41.524098 check[20921]: [ 5] computed razorhome=/root/.razor, conf=/root/.razor/razor-agent.conf, ident=/root/.razor/identity-ru9YrtFRRe Oct 14 19:16:41.524541 check[20921]: [ 2] Razor-Agents v2.14 starting razor-check -dl=20 -d 41 Oct 14 19:16:41.530577 check[20921]: [ 9] uname -a: Linux slack-test 2.4.19 #3 Mon Sep 23 11:00:43 BST 2002 i686 unknown Oct 14 19:16:41.531317 check[20921]: [ 8] reading straight RFC822 mail from 41 Oct 14 19:16:41.532962 check[20921]: [ 6] read 1 mail Oct 14 19:16:41.533766 check[20921]: [ 8] Client supported_engines: 1 2 3 4 Oct 14 19:16:41.534833 check[20921]: [16] log2file: wrote message len=8887 to file: /tmp/razor.20921.1.orig_mail prep_mail: orig=8887 Saweeet!!! Boundary (0): TEP-1457513342.1463792894.1034600406 **** prep_mail done: headers=744 Oct 14 19:16:41.536562 check[20921]: [ 8] prep_mail done: mail 1 headers=744 Oct 14 19:16:41.536839 check[20921]: [ 2] empty body in mail 1, skipping Oct 14 19:16:41.537822 check[20921]: [14] prepared objs: ARRAY - ARRAY(0x838b3a8),1 items HASH - HASH(0x84bc664),2 keys id => 1 orig_mail => SCALAR - SCALAR(0x84c69dc) [length=8887] Return-Path: <list-errors.0.98469.32845235.501.26361.4 Oct 14 19:16:41.538512 check[20921]: [ 6] skipping whitelist file (empty?): /root/.razor/razor-whitelist Oct 14 19:16:41.539429 check[20921]: [ 5] read_file: 1 items read from /root/.razor/servers.discovery.lst Oct 14 19:16:41.539874 check[20921]: [11] Read 1 from server listfile: /root/.razor/servers.discovery.lst Oct 14 19:16:41.540505 check[20921]: [ 5] read_file: 1 items read from /root/.razor/servers.nomination.lst Oct 14 19:16:41.540903 check[20921]: [11] Read 1 from server listfile: /root/.razor/servers.nomination.lst Oct 14 19:16:41.541561 check[20921]: [ 5] read_file: 2 items read from /root/.razor/servers.catalogue.lst Oct 14 19:16:41.541977 check[20921]: [11] Read 2 from server listfile: /root/.razor/servers.catalogue.lst Oct 14 19:16:41.542720 check[20921]: [ 9] Assigning defaults to hubris.cloudmark.com Oct 14 19:16:41.543184 check[20921]: [ 9] Assigning defaults to truth.cloudmark.com Oct 14 19:16:41.543611 check[20921]: [ 9] Assigning defaults to fire.cloudmark.com Oct 14 19:16:41.545177 check[20921]: [ 5] read_file: 11 items read from /root/.razor/server.hubris.cloudmark.com.conf Oct 14 19:16:41.546378 check[20921]: [ 5] read_file: 11 items read from /root/.razor/server.fire.cloudmark.com.conf Oct 14 19:16:41.547556 check[20921]: [ 5] read_file: 11 items read from /root/.razor/server.truth.cloudmark.com.conf Oct 14 19:16:41.547940 check[20921]: [16] entered nextserver Oct 14 19:16:41.548189 check[20921]: [16] entered discover Oct 14 19:16:41.548864 check[20921]: [ 5] 149148 seconds before closest server discovery Oct 14 19:16:41.549558 check[20921]: [ 6] truth.cloudmark.com is a Catalogue Server srl 61; computed min_cf=1, Server se: 0A Oct 14 19:16:41.550102 check[20921]: [ 8] Computed supported_engines: 2 4 Oct 14 19:16:41.550421 check[20921]: [11] No bootstrap_discovery (DNS) recently, not recording .lst files Oct 14 19:16:41.550721 check[20921]: [ 8] Using next closest server truth.cloudmark.com:2703, cached info srl 61 Oct 14 19:16:41.551199 check[20921]: [ 8] mail 1 Subject: FREE Nokia Phone with FREE Long Distance! Oct 14 19:16:41.552222 check[20921]: [16] log2file: wrote message len=8141 to file: /tmp/razor.20921.1.before.preproc_vr1 Oct 14 19:16:41.554789 check[20921]: [16] log2file: wrote message len=8136 to file: /tmp/razor.20921.1.after.preproc_vr1 Oct 14 19:16:41.556846 check[20921]: [11] engine 1 computing on 8136, sig=TCb0ZLNt6x7fUeWH3QJpIpVZxP4A Oct 14 19:16:41.557327 check[20921]: [16] entered connect Oct 14 19:16:41.557611 check[20921]: [ 5] Connecting to truth.cloudmark.com ... Oct 14 19:16:43.032907 check[20921]: [ 8] Connection established Oct 14 19:16:43.033466 check[20921]: [ 4] truth.cloudmark.com >> 29 server greeting: sn=C&srl=61&ep4=7542-10&a=l Oct 14 19:16:43.033895 check[20921]: [16] entered parse_greeting(sn=C&srl=61&ep4=7542-10&a=l ) Oct 14 19:16:43.034870 check[20921]: [ 6] truth.cloudmark.com is a Catalogue Server srl 61; computed min_cf=1, Server se: 0A Oct 14 19:16:43.035532 check[20921]: [ 8] Computed supported_engines: 2 4 Oct 14 19:16:43.036073 check[20921]: [ 5] No queries, no spam Oct 14 19:16:43.036659 check[20921]: [ 5] disconnecting from server truth.cloudmark.com Oct 14 19:16:43.037045 check[20921]: [16] entered _send Oct 14 19:16:43.037635 check[20921]: [ 4] truth.cloudmark.com << 5 Oct 14 19:16:43.037980 check[20921]: [ 6] a=q Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/Razor2/Client/Agent.pm line 540, <GEN0> line 1. Use of uninitialized value in numeric eq (==) at /usr/lib/perl5/site_perl/Razor2/Client/Agent.pm line 540, <GEN0> line 1. Oct 14 19:16:43.039029 check[20921]: [ 8] razor-check finished successfully. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Razor-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/razor-users