Re: [AMaViS-user] autolearn= not showing in headers on autolearned messages
Jonathan, I'm using an Amavis/SpamAssassin/Postfix setup on a fresh install of Ubuntu Hardy. I don't see any reference to the autolearn= field in any of the mail headers Amavis is generating. What am I missing? I considered it sufficient to have autolearn information in the log and did not feel a need to stash it into the X-Spam-Status header field. But I guess it doesn't hurt, so I'll do what you suggest, thanks. Mark - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/
Re: [AMaViS-user] autolearn= not showing in headers on autolearned messages
On Monday 14 July 2008 19:49:30 Jonathan Skanes wrote: On Sunday 13 July 2008 01:11:04 Jonathan Skanes wrote: Hi all, I'm using an Amavis/SpamAssassin/Postfix setup on a fresh install of Ubuntu Hardy. I don't see any reference to the autolearn= field in any of the mail headers Amavis is generating. What am I missing? Here are the versions: amavisd-new: Installed: 1:2.5.3-1ubuntu3 Candidate: 1:2.5.3-1ubuntu3 Version table: *** 1:2.5.3-1ubuntu3 0 500 http://gulus.usherbrooke.ca hardy/main Packages 100 /var/lib/dpkg/status spamassassin: Installed: 3.2.4-1ubuntu1 Candidate: 3.2.4-1ubuntu1 Version table: *** 3.2.4-1ubuntu1 0 500 http://gulus.usherbrooke.ca hardy/universe Packages 100 /var/lib/dpkg/status So I got bored and started poking around in the code. Can anyone see any issues with doing this? I updated my changes to reflect the semantics of Spamassassin. It returns 'autolearn=unavailable' if the message isn't scanned, ie. too big. Use this at your own risk. It seems to work well for me. Oh, and cheers to the developers, I found the code easy to read :) Feel free to include this, with attribution, if you think others may find it useful. --- /usr/sbin/amavisd-new-dist 2008-07-14 19:37:33.0 -0230 +++ /usr/sbin/amavisd-new 2008-07-15 17:54:49.0 -0230 @@ -9833,6 +9833,7 @@ my($do_p0f) = $is_local $os_fp ne '' $allowed_hdrs $allowed_hdrs-{lc('X-Amavis-OS-Fingerprint')}; my($tag_level, $tag2_level, $subject_tag, $pp_age); + my($autolearn_status) = ( $msginfo-supplementary_info('AUTOLEARN') || 'unavailable' ); if ($allowed_hdrs $allowed_hdrs-{lc('X-Amavis-PenPals')}) { $pp_age = $r-recip_penpals_age; $pp_age = format_time_interval($pp_age) if defined $pp_age; @@ -9896,10 +9897,11 @@ # : 0+sprintf(%.3f,$spam_level); # trim fraction # my($bl) = !defined($boost) ? undef : 0+sprintf(%.3f,$boost); # (!defined($boost) || $bl==0 ? $sl : $bl=0 ? $sl.'+'.$bl : $sl.$bl), - $full_spam_status = sprintf(%s,\n score=%s\n %s%s%stests=[%s], + $full_spam_status = sprintf(%s,\n score=%s\n autolearn=%s\n %s%s%stests=[%s], $do_tag2 ? 'Yes' : 'No', !defined($spam_level) !defined($boost) ? 'x' : 0+sprintf(%.3f,$spam_level+$boost), + $autolearn_status, !defined $tag_level || $tag_level eq '' ? '' : sprintf(tagged_above=%s\n ,$tag_level), !defined $tag2_level ? '' : sprintf(required=%s\n , $tag2_level), @@ -10428,6 +10430,7 @@ my($tag_level_min,$tag2_level_min,$kill_level_min,$boost_max); my($spam_level) = $msginfo-spam_level; my(@q_addr,@qar_addr,@a_addr); # per-recip quarantine address(es) and admins + my($autolearn_status) = ( $msginfo-supplementary_info('AUTOLEARN') || 'unavailable' ); for my $r (@{$msginfo-per_recip_data}) { my($rec) = $r-recip_addr; my($blocking_ccat) = $r-blocking_ccat; @@ -10515,9 +10518,10 @@ my($sl) = !defined($spam_level) ? 'x' : 0+sprintf(%.3f,$spam_level); # trim my($bl) = !defined($boost_max) ? undef: 0+sprintf(%.3f,$boost_max); # trim my($full_spam_status) = sprintf( -%s,\n score=%s\n tag=%s\n tag2=%s\n kill=%s\n %stests=[%s], +%s,\n score=%s\n autolearn=%s\n tag=%s\n tag2=%s\n kill=%s\n %stests=[%s], $do_tag2_any||$do_kill_any ? 'Yes' : 'No', (!defined($boost_max) || $bl==0 ? $sl : $bl=0 ? $sl.'+'.$bl : $sl.$bl), + $autolearn_status, (map { !defined $_ ? 'x' : 0+sprintf(%.3f,$_) } ($tag_level_min, $tag2_level_min, $kill_level_min)), join('', $blacklisted_any ? BLACKLISTED\n : (), @@ -10593,7 +10597,6 @@ } if (ll(2) $msginfo-is_in_contents_category(CC_SPAM)) { # log entry compatible with older log parsers -my($autolearn_status) = $msginfo-supplementary_info('AUTOLEARN'); $s = $full_spam_status; $s =~ s/\n[ \t]/ /g; do_log(2,SPAM, %s - %s, %s%s%s, $msginfo-sender_smtp, join(',', qquote_rfc2821_local(@{$msginfo-recips})), $s, - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/
Re: [AMaViS-user] autolearn= not showing in headers on autolearned messages
On Sunday 13 July 2008 01:11:04 Jonathan Skanes wrote: Hi all, I'm using an Amavis/SpamAssassin/Postfix setup on a fresh install of Ubuntu Hardy. I don't see any reference to the autolearn= field in any of the mail headers Amavis is generating. What am I missing? Here are the versions: amavisd-new: Installed: 1:2.5.3-1ubuntu3 Candidate: 1:2.5.3-1ubuntu3 Version table: *** 1:2.5.3-1ubuntu3 0 500 http://gulus.usherbrooke.ca hardy/main Packages 100 /var/lib/dpkg/status spamassassin: Installed: 3.2.4-1ubuntu1 Candidate: 3.2.4-1ubuntu1 Version table: *** 3.2.4-1ubuntu1 0 500 http://gulus.usherbrooke.ca hardy/universe Packages 100 /var/lib/dpkg/status Here a portion of the Amavis log: [31710] dbg: learn: auto-learn: currently using scoreset 3, recomputing score based on scoreset 1 [31710] dbg: learn: auto-learn: message score: -2.171, computed score for autolearn: 0.001 [31710] dbg: learn: auto-learn? ham=1, spam=6, body-points=0.001, head-points=0.001, learned-points=-2.599 [31710] dbg: learn: auto-learn? yes, ham (0.001 1) [31710] dbg: learn: initializing learner [31710] dbg: learn: learning ham [31710] dbg: eval: all 'xxx [31710] dbg: eval: all 'xxx [31710] dbg: locker: safe_lock: created /var/lib/amavis/.spamassassin/bayes.lock.example.com.31710 [31710] dbg: locker: safe_lock: trying to get lock on /var/lib/amavis/.spamassassin/bayes with 0 retries [31710] dbg: locker: safe_lock: link to /var/lib/amavis/.spamassassin/bayes.lock: link ok [31710] dbg: bayes: tie-ing to DB file R/W /var/lib/amavis/.spamassassin/bayes_toks [31710] dbg: bayes: tie-ing to DB file R/W /var/lib/amavis/.spamassassin/bayes_seen [31710] dbg: bayes: found bayes db version 3 [31710] dbg: bayes: learned '[EMAIL PROTECTED]', atime: 1215920262 [31710] dbg: bayes: untie-ing [31710] dbg: bayes: files locked, now unlocking lock [31710] dbg: locker: safe_unlock: unlink /var/lib/amavis/.spamassassin/bayes.lock [31710] dbg: learn: initializing learner [31710] dbg: check: is spam? score=-2.171 required=5 [31710] dbg: check: tests=AWL,BAYES_00,HTML_MESSAGE,SPF_PASS [31710] dbg: check: subtests=__AFF_LOTTERY,__COMMENT_EXISTS,__CT,__CTYPE_HAS_BOUNDARY,__DNS_FRO M_RFC_POST,__DOS_HAS_ANY_URI,__DOS_RCVD_SAT,__DOS_RCVD_SUN,__DOS_RELAYED_EXT ,__ENV_AND_HDR_FROM_MATCH,__FB_NUM_PERCNT,__FB_VIA_URL_SPEC1,__FB_V_SPACE_HT TP,__HAS_ANY_EMAIL,__HAS_ANY_URI,__HAS_MSGID,__HAS_RCVD,__HAS_SUBJECT,__HTML _LINK_IMAGE,__LAST_UNTRUSTED_RELAY_NO_AUTH,__MIME_HTML,__MIME_QP,__MIME_VERS ION,__MISSING_REF,__MSGID_OK_DIGITS,__MSGID_OK_HOST,__MSOE_MID_WRONG_CASE,__ NAKED_TO,__NONEMPTY_BODY,__RCVD_IN_DNSWL,__RFC_IGNORANT_ENVFROM,__SANE_MSGID ,__TAG_EXISTS_BODY,__TAG_EXISTS_CENTER,__TAG_EXISTS_HEAD,__TAG_EXISTS_HTML,_ _TOCC_EXISTS,__TVD_BODY,__TVD_MIME_ATT_TP,__TVD_MIME_CT_MM (note addresses changed on post) Here is my local amavis config: use strict; # # Place your configuration directives here. They will override those in # earlier files. # # See /usr/share/doc/amavisd-new/ for documentation and examples of # the directives you can use in this file # $unfreeze = ['unfreeze', 'freeze -d', 'melt', 'fcat']; #disabled (non-free, no security support) $unrar = ['rar', 'unrar']; #disabled (non-free, no security support) $lha= 'lha'; #disabled (non-free, no security support) $myhostname = windy.skanes.ca; $final_spam_destiny = D_DISCARD; $X_HEADER_LINE = Ubuntu $myproduct_name at $mydomain; $sa_tag_level_deflt = -; $sa_kill_level_deflt = 20; # triggers spam evasive actions $sa_dsn_cutoff_level = 20; # spam level beyond which a DSN is not sent $sa_auto_whitelist = 1; $sa_spam_report_header = 1; $final_spam_destiny = D_PASS; $final_bad_header_destiny = D_PASS; # False-positive prone (for spam) # # Debugging settings # $sa_debug = '1'; $log_level = 5; $LOGFILE = $MYHOME/amavis.log; $DEBUG=1; # # Disable SA Caching $spam_check_negative_ttl = 0; #10*60; # time to cache contents as not spam $spam_check_positive_ttl = 0; #30*60; # time to cache contents as spam # # Do not modify anything below this line - 1; # ensure a defined return Here is my SA local.cf: # This is the right place to customize your installation of SpamAssassin. # # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be # tweaked. # # Only a small subset of options are listed below # ### # Add *SPAM* to the Subject header of spam e-mails # # rewrite_header Subject *SPAM* # Save spam messages as a message/rfc822 MIME attachment instead of # modifying the original message (0: off, 2: use text/plain instead) # # report_safe 1 # Set which networks or hosts are considered 'trusted' by your mail # server (i.e. not spammers) # # trusted_networks 212.17.35. # Set file-locking
[AMaViS-user] autolearn= not showing in headers on autolearned messages
Hi all, I'm using an Amavis/SpamAssassin/Postfix setup on a fresh install of Ubuntu Hardy. I don't see any reference to the autolearn= field in any of the mail headers Amavis is generating. What am I missing? Here are the versions: amavisd-new: Installed: 1:2.5.3-1ubuntu3 Candidate: 1:2.5.3-1ubuntu3 Version table: *** 1:2.5.3-1ubuntu3 0 500 http://gulus.usherbrooke.ca hardy/main Packages 100 /var/lib/dpkg/status spamassassin: Installed: 3.2.4-1ubuntu1 Candidate: 3.2.4-1ubuntu1 Version table: *** 3.2.4-1ubuntu1 0 500 http://gulus.usherbrooke.ca hardy/universe Packages 100 /var/lib/dpkg/status Here a portion of the Amavis log: [31710] dbg: learn: auto-learn: currently using scoreset 3, recomputing score based on scoreset 1 [31710] dbg: learn: auto-learn: message score: -2.171, computed score for autolearn: 0.001 [31710] dbg: learn: auto-learn? ham=1, spam=6, body-points=0.001, head-points=0.001, learned-points=-2.599 [31710] dbg: learn: auto-learn? yes, ham (0.001 1) [31710] dbg: learn: initializing learner [31710] dbg: learn: learning ham [31710] dbg: eval: all 'xxx [31710] dbg: eval: all 'xxx [31710] dbg: locker: safe_lock: created /var/lib/amavis/.spamassassin/bayes.lock.example.com.31710 [31710] dbg: locker: safe_lock: trying to get lock on /var/lib/amavis/.spamassassin/bayes with 0 retries [31710] dbg: locker: safe_lock: link to /var/lib/amavis/.spamassassin/bayes.lock: link ok [31710] dbg: bayes: tie-ing to DB file R/W /var/lib/amavis/.spamassassin/bayes_toks [31710] dbg: bayes: tie-ing to DB file R/W /var/lib/amavis/.spamassassin/bayes_seen [31710] dbg: bayes: found bayes db version 3 [31710] dbg: bayes: learned '[EMAIL PROTECTED]', atime: 1215920262 [31710] dbg: bayes: untie-ing [31710] dbg: bayes: files locked, now unlocking lock [31710] dbg: locker: safe_unlock: unlink /var/lib/amavis/.spamassassin/bayes.lock [31710] dbg: learn: initializing learner [31710] dbg: check: is spam? score=-2.171 required=5 [31710] dbg: check: tests=AWL,BAYES_00,HTML_MESSAGE,SPF_PASS [31710] dbg: check: subtests=__AFF_LOTTERY,__COMMENT_EXISTS,__CT,__CTYPE_HAS_BOUNDARY,__DNS_FROM_RFC_POST,__DOS_HAS_ANY_URI,__DOS_RCVD_SAT,__DOS_RCVD_SUN,__DOS_RELAYED_EXT,__ENV_AND_HDR_FROM_MATCH,__FB_NUM_PERCNT,__FB_VIA_URL_SPEC1,__FB_V_SPACE_HTTP,__HAS_ANY_EMAIL,__HAS_ANY_URI,__HAS_MSGID,__HAS_RCVD,__HAS_SUBJECT,__HTML_LINK_IMAGE,__LAST_UNTRUSTED_RELAY_NO_AUTH,__MIME_HTML,__MIME_QP,__MIME_VERSION,__MISSING_REF,__MSGID_OK_DIGITS,__MSGID_OK_HOST,__MSOE_MID_WRONG_CASE,__NAKED_TO,__NONEMPTY_BODY,__RCVD_IN_DNSWL,__RFC_IGNORANT_ENVFROM,__SANE_MSGID,__TAG_EXISTS_BODY,__TAG_EXISTS_CENTER,__TAG_EXISTS_HEAD,__TAG_EXISTS_HTML,__TOCC_EXISTS,__TVD_BODY,__TVD_MIME_ATT_TP,__TVD_MIME_CT_MM (note addresses changed on post) Here is my local amavis config: use strict; # # Place your configuration directives here. They will override those in # earlier files. # # See /usr/share/doc/amavisd-new/ for documentation and examples of # the directives you can use in this file # $unfreeze = ['unfreeze', 'freeze -d', 'melt', 'fcat']; #disabled (non-free, no security support) $unrar = ['rar', 'unrar']; #disabled (non-free, no security support) $lha= 'lha'; #disabled (non-free, no security support) $myhostname = windy.skanes.ca; $final_spam_destiny = D_DISCARD; $X_HEADER_LINE = Ubuntu $myproduct_name at $mydomain; $sa_tag_level_deflt = -; $sa_kill_level_deflt = 20; # triggers spam evasive actions $sa_dsn_cutoff_level = 20; # spam level beyond which a DSN is not sent $sa_auto_whitelist = 1; $sa_spam_report_header = 1; $final_spam_destiny = D_PASS; $final_bad_header_destiny = D_PASS; # False-positive prone (for spam) # # Debugging settings # $sa_debug = '1'; $log_level = 5; $LOGFILE = $MYHOME/amavis.log; $DEBUG=1; # # Disable SA Caching $spam_check_negative_ttl = 0; #10*60; # time to cache contents as not spam $spam_check_positive_ttl = 0; #30*60; # time to cache contents as spam # # Do not modify anything below this line - 1; # ensure a defined return Here is my SA local.cf: # This is the right place to customize your installation of SpamAssassin. # # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be # tweaked. # # Only a small subset of options are listed below # ### # Add *SPAM* to the Subject header of spam e-mails # # rewrite_header Subject *SPAM* # Save spam messages as a message/rfc822 MIME attachment instead of # modifying the original message (0: off, 2: use text/plain instead) # # report_safe 1 # Set which networks or hosts are considered 'trusted' by your mail # server (i.e. not spammers) # # trusted_networks 212.17.35. # Set file-locking method (flock is not safe over NFS, but is faster) # # lock_method flock # Set the threshold at which a message is considered spam (default: 5.0) # #