RE: [suse-sles-e] Configuring Spamassassin and amavisd-new
Still not quite there.
First, thanks to all (especially JQ and Sandy) for your suggestions.
I've implemented several of them, but still do not get the X-Spam*
headers. I sent a test SPAM message from one of my email addresses to
another (actually forwarded some real SPAM). Below are the following:
1 - a snippet from my /var/log/mail file;
2 - the headers in the message I received.
3 - startup messages from amavis-new
4 - the spamassassin config lines in /etc/amavisd.conf
Again I am running SLES9, Postfix, cyrus and amavisd-new with clamd and
spamassassin configured. did one thing different than before -
somewhere I read that if spamassassin was configured in amavis-new that
I did not need to run spamd. I thought they might be conflicting so I
stopped spamd and just started amavis-new. The amavis startup messages
appear to indicate that it has started spamassassin OK, but I might be
wrong.
Many thanks in advance for your help - Richard
**** /var/log/mail - BEGIN ****
<SNIP>
Apr 1 09:24:12 gofish amavis[19362]: (19362-01) Passed,
Richard Mixon (qwest) wrote:
**** /var/log/mail - BEGIN **** <SNIP> Apr 1 09:24:12 gofish amavis[19362]: (19362-01) Passed,
-> , Message-ID: , Hits: 3.584
According to your settings below, this mail should have at least the X-Spam-Status header. I am slowly beginning to suspect that Outlook simply doesn't show that header. Could you do me the favor and check the email itself on the server (just open it with less) to see, if you suddenly find the missing header? Or as an alternative just use Thunderbird to read your mail and have a look at the message source.
$sa_tag_level_deflt = 3.0; # add spam info headers if at, or above that
If you wish to add the info headers to EVERY mail you could give the setting above a negative score. The server for this list for example uses a score of -20, so really every mail gets the info headers. Sandy
Sandy Drobic wrote:
Richard Mixon (qwest) wrote:
**** /var/log/mail - BEGIN **** <SNIP> Apr 1 09:24:12 gofish amavis[19362]: (19362-01) Passed,
-> , Message-ID: , Hits: 3.584 According to your settings below, this mail should have at least the X-Spam-Status header. I am slowly beginning to suspect that Outlook simply doesn't show that header.
Could you do me the favor and check the email itself on the server (just open it with less) to see, if you suddenly find the missing header?
Or as an alternative just use Thunderbird to read your mail and have a look at the message source.
$sa_tag_level_deflt = 3.0; # add spam info headers if at, or above that
If you wish to add the info headers to EVERY mail you could give the setting above a negative score. The server for this list for example uses a score of -20, so really every mail gets the info headers.
OK, in /etc/amavisd.conf I set
sa_tag_level_deflt = -20.0
saved and and did a "rcamavis restart"
Not sure how to use "less" to read mail, so I just used the "mail"
command - but nothing was there from a ssh session. So I used our
webmail, which is squirrelmail. It has an option to view "full header"
which I did. It does not have the X-Spam* headers of any kind. See below
and also further down I have the messages from /var/log/mail.
Thanks again - Richard
***** SQUIRRELMAIL - Full Headers BEGIN *****
Return-Path:
Richard Mixon (qwest) wrote:
OK, in /etc/amavisd.conf I set sa_tag_level_deflt = -20.0 saved and and did a "rcamavis restart"
Not sure how to use "less" to read mail, so I just used the "mail" command - but nothing was there from a ssh session. So I used our
He he!! In the end emails are just text files, so nothing hinders you to just open the mail stored on your server using "less". less /var/spool/imap/testuser/spam/.1242 There you are. (^-)
webmail, which is squirrelmail. It has an option to view "full header" which I did. It does not have the X-Spam* headers of any kind. See below
I just checked with my own squirrelmail installation. The "full header" view does show the X-Spam headers, so it seems as if your amavis isn't adding the desired headers. You can do two things to get an insight into your problem: $final_spam_destiny = D_PASS; Somewhere within the murky back of my rotting brain, I seem to recall that there are some settings that only work when $final_spam_destiny is set to "D_PASS". You could try that. Another way is to stop amavis and start it in debug mode. It will show lines like "header...." rcamavis stop amavis debug Then you have a real time view into the insides of amavis as is processes the mails. Sandy
Sandy Drobic wrote:
Richard Mixon (qwest) wrote: <SNIP>
You can do two things to get an insight into your problem:
$final_spam_destiny = D_PASS;
Somewhere within the murky back of my rotting brain, I seem to recall that there are some settings that only work when $final_spam_destiny is set to "D_PASS". You could try that.
Another way is to stop amavis and start it in debug mode. It will show lines like "header...." rcamavis stop amavis debug
Then you have a real time view into the insides of amavis as is processes the mails.
Sandy/Carlos/all,
Sorry, but his saga continues. But I am learning a lot more than I ever
knew before, thanks to each of you for your time.
I checked my /etc/amavisd.conf and have the following settings:
$final_virus_destiny = D_BOUNCE; # (defaults to D_BOUNCE)
$final_banned_destiny = D_BOUNCE; # (defaults to D_BOUNCE)
$final_spam_destiny = D_PASS;
$final_bad_header_destiny = D_PASS; # (defaults to D_PASS), D_BOUNCE
suggested
Also, I finally had a chance to get debug turned on for amavsid.
Even with debug on I do not see clue as to why the X-Spam* headers are
not inserted. I have pretty closely inspected both the console output
and the output into /var/log/mail, but do not see anything telling (at
least to me).
I do see one message in my /var/log/mail (see output #2 below) that
might indicate a problem:
Apr 6 09:01:26 gofish postfix/smtp[5170]: connect to localhost[::1]:
Connection refused (port 10024)
This port number is referred to in my /etc/postfix/master.cf file so
I've attached the configuration lines from that file.
Not sure if this matters, but we are using email client authentication
and SSL encryption for our connections if that makes any difference.
This has been working fine for quite a while. Our certificate is
self-generated so each time Mozilla or Outlook connect we get a warning
asking do we want to accept the certificate - but other than that no
problems.
So, here are the attachments below:
1) /etc/postfix/master.cf
2) Corresponding output from /var/log/mail
3) Headers received with the mail message at the client. Yes, its
Outlook, but I have compared Outlook with Squirrelmail and they both
pass the same headers. I tried looking in /var/spool, but as I am using
Cyrus I do not see a spam folder for any of my users.
4) SPAM notification for the above message that was sent to the
designated administrator account.
I tried to sen:
5) Amavis debug console output, showing amavis startup and processing
of a single SPAM message that I sent from a computer outside my domain
(rnmixon@qwest.net) to a user (rnmixon@acme.com) on my domain.
but it caused the message to exceed the 20,000 character limit the list
has. I can break it in to two chunks and send it separately if needed.
NOTE: I have changed my domain name in these messages from XXXXXXXX to
Acme and altered my actual server IP address for a (possibly false)
sense of security :).
Thank you for any ideas/help on resolving this.
- Richard
1) /etc/postfix/master.cf (comments ommitted):
#
========================================================================
==
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
#
========================================================================
==
smtp inet n - n - 2 smtpd
-o content_filter=smtp:[localhost]:10024
smtps inet n - n - 2 smtpd
-o content_filter=smtp:[localhost]:10024
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes -o
smtpd_etrn_restrictions=reject
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
#tlsmgr fifo - - n 300 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
localhost:10025 inet n - n - - smtpd
-o content_filter=
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -r ${sender} -m
${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop
$recipient
vscan unix - n n - 10 pipe
user=vscan argv=/usr/sbin/amavis ${sender} ${recipient}
procmail unix - n n - - pipe
flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc
${sender} ${recipient}
2) Corresponding output from /var/log/mail:
Apr 6 09:01:25 gofish postfix/smtpd[5167]: connect from
mpls-qmqp-03.inet.qwest.net[63.231.195.114]
Apr 6 09:01:26 gofish postfix/smtpd[5167]: 2670B1693:
client=mpls-qmqp-03.inet.qwest.net[63.231.195.114]
Apr 6 09:01:26 gofish postfix/cleanup[5169]: 2670B1693:
message-id=
Richard Mixon (qwest) wrote:
Sandy/Carlos/all,
Sorry, but his saga continues. But I am learning a lot more than I ever knew before, thanks to each of you for your time.
That's what life is about, learning something new every day. (^-^)
Even with debug on I do not see clue as to why the X-Spam* headers are not inserted. I have pretty closely inspected both the console output and the output into /var/log/mail, but do not see anything telling (at least to me).
This is what my debug outpot generates (only the relevant lines)
Apr 6 19:49:14 japantest.homelinux.com /usr/sbin/amavisd[28276]: (28276-01)
lookup: (scalar) matches, result="-20"
Apr 6 19:49:14 japantest.homelinux.com /usr/sbin/amavisd[28276]: (28276-01)
lookup (spam_tag_level) => true, "suse-linux@japantest.homelinux.com" matches,
result="-20", matching_key="(constant:-20)"
Apr 6 19:49:14 japantest.homelinux.com /usr/sbin/amavisd[28276]: (28276-01)
headers CLUSTERING: NEW CLUSTER
I do see one message in my /var/log/mail (see output #2 below) that might indicate a problem:
Apr 6 09:01:26 gofish postfix/smtp[5170]: connect to localhost[::1]: Connection refused (port 10024)
That is no real problem. It seems you have not disabled IPv6, which is queried ahead of IPv4. Disabling IPv6 will get rid of that error message, only to replace it with another: "...protocol family not supported..." It's a question of style which error message you prefer. I haven't been able to get rid of it. Is IPv6 support compiled into postfix by Suse? I think so.
This port number is referred to in my /etc/postfix/master.cf file so I've attached the configuration lines from that file.
It's also set in amavisd.conf as the receiving port on localhost.
Not sure if this matters, but we are using email client authentication and SSL encryption for our connections if that makes any difference. This has been working fine for quite a while. Our certificate is self-generated so each time Mozilla or Outlook connect we get a warning asking do we want to accept the certificate - but other than that no problems.
Shouldn't be a problem. The logs you send don't really help to narrow down the problem. Could you rather post /etc/amavisd.conf? Sandy
Sandy Drobic wrote:
Richard Mixon (qwest) wrote: <SNIP> <SNIP> The logs you send don't really help to narrow down the problem. Could you rather post /etc/amavisd.conf?
Hmms - the "matches" lines from your debug output make sense. I find
some "matches" in my debug output, but they are quite different. I have
included the debug output form amavisd that is most similar (with
capitalized annotations), followed by my /etc/amavisd.conf as you
requested. The amavisd.conf is 67kb, so I squished all of the comments
out, but left the Section comments.
Thanks once again - Richard
1) Debug output of amavis while processing spam message:
09:01:26 gofish amavisd[5152]: Net::Server: 2005/04/06-09:01:26 CONNECT
TCP Peer: "127.0.0.1:14047" Local: "127.0.0.1:10024"
[BEGINNING OF REMAINING LINES ARE ABBREVIATED TO SAVE SPACE]
26 go amd: lookup_ip_acl: key="127.0.0.1" matches "127.0.0.1", result=1
26 go amd: prolong_timer after new request - timer reset: remaining time
= 300 s
26 go amd: SMTP> 220 [127.0.0.1] ESMTP amavisd-new service ready
26 go amd: prolong_timer after reading SMTP command: remaining time =
300 s
26 go amd: SMTP< EHLO gofish.AcmeSoftware.com\r\n
26 go amd: ESMTP> 250-[127.0.0.1]
26 go amd: ESMTP> 250-PIPELINING
26 go amd: ESMTP> 250-SIZE
26 go amd: ESMTP> 250-8BITMIME
26 go amd: ESMTP> 250 ENHANCEDSTATUSCODES
<SNIP>
26 go amd: (05152-01) Clam Antivirus-clamd result:
/var/spool/amavis/amavis-20050406T090126-05152/parts: OK\n
26 go amd: (05152-01) prolong_timer after virus_scan: remaining time =
300 s
26 go amd: (05152-01) white_black_list: checking sender
The Wednesday 2005-04-06 at 12:33 -0700, Richard Mixon (qwest) wrote:
1) Debug output of amavis while processing spam message:
Umpf! Instead of that, you could have touched this: $log_level = 2; and set it to 3 or 4 (in /etc/amavisd.conf).
09:01:26 gofish amavisd[5152]: Net::Server: 2005/04/06-09:01:26 CONNECT TCP Peer: "127.0.0.1:14047" Local: "127.0.0.1:10024" [BEGINNING OF REMAINING LINES ARE ABBREVIATED TO SAVE SPACE]
Argh. I'm feeling sleeeepy... (early hours here). Ok, a quick glance.
$log_level = 2;
Increase it, don't use perl debugging.
$remove_existing_x_scanned_headers = 0; $remove_existing_spam_headers = 1;
I wonder :-? -- Cheers, Carlos Robinson
The Wednesday 2005-04-06 at 20:36 +0200, Sandy Drobic wrote:
And here is the line that is added.
Apr 6 19:49:14 japantest.homelinux.com /usr/sbin/amavisd[28276]: (28276-01) header: X-Spam-Level: \n
I think you need to increase debug level in amavisd.conf to get that log line. Richard, try that.
Apr 6 09:01:26 gofish postfix/smtp[5170]: connect to localhost[::1]: Connection refused (port 10024)
That is no real problem. It seems you have not disabled IPv6, which is queried ahead of IPv4. Disabling IPv6 will get rid of that error message, only to replace it with another: "...protocol family not supported..." It's a question of style which error message you prefer. I haven't been able to get rid of it. Is IPv6 support compiled into postfix by Suse? I think so.
You probably have a line in main.cf like this one: mynetworks = 192.168.100.2/8 127.0.0.0/8 [::1/128] Just remove the [::1/128] part.
The logs you send don't really help to narrow down the problem. Could you rather post /etc/amavisd.conf?
You should have posted the grep trick to remove comments :-p -- Cheers, Carlos Robinson
The Friday 2005-04-01 at 12:05 -0700, Richard Mixon (qwest) wrote:
X-Virus-Scanned: by amavisd-new at acme.com ... Apr 1 11:53:33 gofish postfix/smtpd[22039]: connect from mpls-qmqp-03.inet.qwest.net[63.231.195.114]
Your machine, is it acme.com, or is it "gofish...somewhere"? There is an amavis-new running at the "acme.com" machine. The amavis-new program running at gofish...somewhere will not scan it again, I think. Can you clarify the name clash there? -- Cheers, Carlos Robinson
Carlos E. R. wrote:
The Friday 2005-04-01 at 12:05 -0700, Richard Mixon (qwest) wrote:
X-Virus-Scanned: by amavisd-new at acme.com ... Apr 1 11:53:33 gofish postfix/smtpd[22039]: connect from mpls-qmqp-03.inet.qwest.net[63.231.195.114]
Your machine, is it acme.com, or is it "gofish...somewhere"? There is an amavis-new running at the "acme.com" machine. The amavis-new program running at gofish...somewhere will not scan it again, I think.
Can you clarify the name clash there?
Carlos, My many thanks for your efforts and analysis. I apologize for the "acme.com" confusion. Yes, "gofish" is the actual host name - but due to a bit of paranoia, I tried to change all references to my real domain in the posting to "acme.com". It is possible that I slipped up and did not make the change uniformly - however I left the hostname a "gofish" in all places. I have made a first pass through your postings ... and have a learned a lot. Still my major outstanding problem is that we are not getting any X-Spam* headers at all in the emails - even though we can clearly see that the spam analysis is working. This does not appear to be an Outlook problem as SquirrelMail also has the problem. I just tried Mozilla mail agent and it also shows not X-Spam* headers - info or otherwise. Any other ideas? Thank you - Richard
The Monday 2005-04-04 at 15:05 -0700, Richard Mixon (qwest) wrote:
Can you clarify the name clash there?
Carlos,
My many thanks for your efforts and analysis. I apologize for the "acme.com" confusion. Yes, "gofish" is the actual host name - but due to a bit of paranoia, I tried to change all references to my real domain in the posting to "acme.com".
I can understand that :-) - but it confused my analysis.
I have made a first pass through your postings ... and have a learned a lot. Still my major outstanding problem is that we are not getting any X-Spam* headers at all in the emails - even though we can clearly see that the spam analysis is working. This does not appear to be an Outlook problem as SquirrelMail also has the problem. I just tried Mozilla mail agent and it also shows not X-Spam* headers - info or otherwise.
Any other ideas?
Not yet... it is late here, and as the list has been down some days, so I don't remember where we where, and I'm not very awake to reread it - I'll have a go tomorrow, and hopefully somebody else will say something before that. Check your amavis configuration carefully. Try to send yourself emails locally, track them. You can increase debug info. -- Cheers, Carlos Robinson
The Friday 2005-04-01 at 10:35 -0700, Richard Mixon (qwest) wrote:
**** /var/log/mail - BEGIN **** <SNIP> Apr 1 09:24:12 gofish amavis[19362]: (19362-01) Passed,
-> , Message-ID: , Hits: 3.584
Amavis is working, and gave a level of "3.584" to that email.
Apr 1 09:24:12 gofish amavis[19362]: (19362-01) TIMING [total 1300 ms] - SMTP EHLO: 4 (0%), SMTP pre-MAIL: 0 (0%), mkdir tempdir: 0 (0%), create email.txt: 0 (0%), SMTP pre-DATA-flush: 3 (0%), SMTP DATA: 38 (3%), body hash: 1 (0%), mkdir parts: 1 (0%), mime_decode: 15 (1%), get-file-type: 14 (1%), get-file-type: 14 (1%), decompose_part: 2 (0%), decompose_part: 0 (0%), parts: 0 (0%), AV-scan-1: 4 (0%), SA msg read: 2 (0%), SA parse: 1 (0%), SA check: 1106 (85%), fwd-connect: 33 (3%), fwd-mail-from: 2 (0%), fwd-rcpt-to: 7 (1%), write-header: 2 (0%), fwd-data: 0 (0%), fwd-data-end: 46 (4%), fwd-rundown: 1 (0%), unlink-2-files: 3 (0%), rundown: 0 (0%)
You can tell amavis-new not to add this line, it is too verbose. But you can see there that it in fact running SA.
**** Received message headers - BEGIN **** .... Content-Type: multipart/alternative; boundary="----=_NextPart_000_04AC_01C5369C.8624BD80" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
I would try to use a "real" mail program, say Mozilla, for example...
X-Virus-Scanned: by amavisd-new at acme.com
It has been scanned.
**** Received message headers - END ****
**** /var/log/messages - BEGIN **** ... Apr 1 09:22:16 gofish amavis[19360]: ANTI-SPAM code loaded
Ok.
**** /etc/amavisd.conf - BEGIN **** <SNIP> ...
# default values, can be overridden by more specific lookups, e.g. SQL $sa_tag_level_deflt = 3.0; # add spam info headers if at, or above that level $sa_tag2_level_deflt = 5.0;
These two are interesting. Info headers are only added if level is more or equal to 3.0. You have the explanation below: # a quick reference: # tag_level controls adding the X-Spam-Status and X-Spam-Level headers, # tag2_level controls adding 'X-Spam-Flag: YES', and editing Subject, # kill_level controls 'evasive actions' (reject, quarantine, extensions); # it only makes sense to maintain the relationship: # tag_level <= tag2_level <= kill_level < $sa_dsn_cutoff_level So, it will only add the X-Spam-Flag above level 5.0. Your email does not get to that level. But you should be seeing the "X-Spam-Status" and "X-Spam-Level" headers - unless outlook is playing tricks on you. Change.
$sa_kill_level_deflt = $sa_tag2_level_deflt; # triggers spam evasive actions # at or above that level: bounce/reject/drop, # quarantine, and adding mail address extension
Translation: above level 5.0, it will take "evasive action".
$sa_dsn_cutoff_level = 10; # spam level beyond which a DSN is not sent, # effectively turning D_BOUNCE into D_DISCARD; # undef disables this feature and is a default;
If I read it correctly, from level 5 to 10, email is bounced, and above 10 it is discarded. You don't see them at all. I don't like those actions. I would never bounce an spam! I don't clearly see how to tell it to quarantine always, or to do nothing. To do nothing I think would be, perhaps, setting "sa_kill_level_deflt = 10000" I don't see this clear, and I know no documentation. :-/ -- Cheers, Carlos Robinson
The Friday 2005-04-01 at 21:33 +0200, I wrote:
I don't see this clear, and I know no documentation. :-/
I said that amavis-new has no documentation. I'll qualify that statement: there is no manual under "/usr/share/doc/packages/amavisd-new", and "man amavis-new" produces nothing, not found (nor info nor perldoc). Some say that the documentation is included as comments in "/etc/amavis.conf", but while that is true, it is a "documentation" that only programmers can really understand. There is no user documentation, or, at least, it was not included with SuSE 9.1. So... reading that file, I have some more info on the problem at hand, after an hour or more studying it - but before, check this two vars: # @bypass_virus_checks_acl = qw( . ); # uncomment to DISABLE anti-virus code # @bypass_spam_checks_acl = qw( . ); # uncomment to DISABLE anti-spam code I would write that as "comment to enable whatever" - that explanation above is in "programmers parlance". You need both commented, then, as I suppose you need to check both spam and viruses. This setting, around 1/3 of the file, defines what action it takes for spam: $final_spam_destiny = D_PASS; The possible actions are: # Alternatives to consider for spam: # - use D_PASS if clients will do filtering based on inserted mail headers; # - use D_DISCARD, if kill_level is set safely high; # - use D_BOUNCE instead of D_REJECT if not using milter; ... # The separation of *_destiny values into D_BOUNCE, D_REJECT, D_DISCARD # and D_PASS made settings $warnvirussender and $warnspamsender only still # useful with D_PASS. # Notify spam sender? $warnspamsender = 0; # (defaults to false (undef)) The possible actions we can use are: # The following symbolic constants can be used in *destiny settings: # # D_PASS mail will pass to recipients, regardless of bad contents; # # D_DISCARD mail will not be delivered to its recipients, sender will NOT be # notified. Effectively we lose mail (but will be quarantined # unless disabled). Losing mail is not decent for a mailer, # but might be desired. # # D_BOUNCE mail will not be delivered to its recipients, a non-delivery # notification (bounce) will be sent to the sender by amavisd-new; # Exception: bounce (DSN) will not be sent if a virus name matches # $viruses_that_fake_sender_re, or to messages from mailing lists # (Precedence: bulk|list|junk); # # D_REJECT mail will not be delivered to its recipients, sender should # preferably get a reject, e.g. SMTP permanent reject response # (e.g. with milter), or non-delivery notification from MTA # (e.g. Postfix). If this is not possible (e.g. different recipients # have different tolerances to bad mail contents and not using LMTP) # amavisd-new sends a bounce by itself (same as D_BOUNCE). # So D_PASS should be the correct action for spam, so that the user can decide. Those actions are taken when? # tag_level <= tag2_level <= kill_level < $sa_dsn_cutoff_level tag_level = 3.0 Adds the X-Spam-Status and X-Spam-Level headers tag2_level = 5.0 Adds 'X-Spam-Flag: YES', and allows editing Subject. kill_level = 5.0 Does whatever action was defined, and we should have D_PASS sa_dsn_cutoff_level = 10.0 Discard email - undef to disable (default, but not for SuSE). Ie, although we defined that action as "D_PASS", above this level it does a "D_DISCARD". This means that it would be quarantined unless disabled, probably in "/var/spool/amavis/virusmails", in almost maildir format. But it is disabled: $spam_quarantine_to = undef; Lets see what I can learn about this. $QUARANTINEDIR = '/var/spool/amavis/virusmails'; # a directory #$virus_quarantine_method = "local:virus-%i-%n"; # default #$spam_quarantine_method = "local:spam-%b-%i-%n"; # default I think this means that virus mails are filed with names like "virus-date-hour-numbers". For example: "virus-20040628-013731-13574-10". Spam mails would be similar... perhaps. The "/etc/amavis.conf" continues saying this: # When using the 'local:' quarantine method (default), the following applies: # # A finer control of quarantining is available through variable # $virus_quarantine_to/$spam_quarantine_to. It may be a simple scalar string, # or a ref to a hash lookup table, or a regexp lookup table object, # which makes possible to set up per-recipient quarantine addresses. There are four variants - and notice that, as I don't know perl, I don't really understand the jargon: # VARIANT 1: # empty or undef disables quarantine; And we have: $virus_quarantine_to = 'virus-quarantine'; # traditional local quarantine $spam_quarantine_to = undef; Ie, spam above level 10 is not quarantined. What if we want to? Well... the file continues: #$spam_quarantine_to = "spam-quarantine\@$mydomain"; #$spam_quarantine_to = new_RE( # per-recip multiple quarantines # [qr'^(.*)@example\.com$'i => 'spam-${1}@example.com'], # [qr/.*/ => 'spam-quarantine'] ); My mind simply refuses to understand that. Somebody, please? I think we could simply write 'spam-quarantine' (single quotes). That would be "VARIANT 2": # VARIANT 2: # a string NOT containing an '@'; # amavisd will behave as a local delivery agent (LDA) and will quarantine # viruses to local files according to hash %local_delivery_aliases (pseudo # aliases map) - see subroutine mail_to_local_mailbox() for details. See? we have to be programmers to read documentation: "see subroutine..." :-/ # Some of the predefined aliases are 'virus-quarantine' and 'spam-quarantine'. # Setting $virus_quarantine_to ($spam_quarantine_to) to this string will: # # * if $QUARANTINEDIR is a directory, each quarantined virus will go # to a separate file in the $QUARANTINEDIR directory (traditional # amavis style, similar to maildir mailbox format); # What I deduce is that if we set $spam_quarantine_to = 'spam-quarantine' it will go to $QUARANTINEDIR in almost maildir format. But I don't know what other "predefined aliases" are there, even though I tried looking at the source. Possibly: virus-quarantine, spam-quarantine, user-quarantine, ham-quarantine, outgoing-quarantine, and incoming-quarantine. This one looks promising also: $spam_quarantine_to = new_RE( # per-recip multiple quarantines [qr'^(.*)@example\.com$'i => 'spam-${1}@example.com'], [qr/.*/ => 'spam-quarantine'] ); but it is not documented, as always... Or, if we simply want spam above 10 to go the final recipients, so the can apply their own filters (that's what I would do), we can do #$sa_dsn_cutoff_level = 10; or perhaps: $sa_dsn_cutoff_level = undef; And I'm tired of this (study). Hope you can make use of this :-) -- Cheers, Carlos Robinson
participants (3)
-
Carlos E. R.
-
Richard Mixon (qwest)
-
Sandy Drobic