--quarantine-reject: reply with an smtp error to spam

Forum for getting help with Project Gamera, Spamassassin, Clamav, qmail-scanner and other anti-spam tools.
EvolutionCrazy
Forum User
Forum User
Posts: 67
Joined: Wed Jun 01, 2005 5:52 pm

--quarantine-reject: reply with an smtp error to spam

Unread post by EvolutionCrazy »

i was looking around qmail-scanner.ini but didn't saw anything that refer to the :
--quarantine-reject switch...

Defaults to "no". Whether to trigger a SMTP
error response to quarantine events (inc. SPAM).
Qmail installed with the "custom error patch" will
get a nice little text msg sent, those without
just produce a generic Qmail error.
How do you give an SMTP error instead of just dropping spam messages without letting the sender know?

(don't think NOTIFY="none" is what I'm looking for as that would just bounce the message to the (maybe) forged sender...)

qmail-scanner.ini

Code: Select all

# qmail-scanner settings
QMAILSCANNERHOME="/usr/share/qmail-scanner"
SPOOLDIR="/var/spool/qscan"
SPAMDIR="/var/spool/qscan/quarantine/spam"

QS_USER="qscand"                        # default is qscand
QS_GROUP="qscand"                       # default is qscand
NOTIFY="none"                           # [none|sender|recips|precips|admin|nmladm|nmlvadm|all] (defaults to "psender,nmlvadm")
ARCHIVE="no"                            # [yes|no|regex]
FIX_MIME="2"                            # [yes|no|num], try "1" if blocks occurring due to this setting
IGNORE_EOL_CHECK="no"                   # [yes|no]
ADD_DESC_HEADERS="no"                   # [yes|no|all], old-fashion X-Qmail-Scanner, "all" adds rcpt to headers
DEBUG="no"                              # [yes|no]
MINIDEBUG="1"                           # [yes|no|1|2]
SETTINGS_PER_DOMAIN="yes"               # [yes|no]

# ClamAV settings
CLAMD_USER="qscand"                     # default is clamav

# Spamassassin settings
SA_SETTINGS="-d -c -m5 -H"              # Default settings for spamd
SA_SQL="no"                             # [yes|no], runs spamassassin with the 'rcpt to' as option. Only use if mysql is enabled in SA
SA_DELTA="1"                            # [num]
SA_SUBJECT="****SPAM****"               # <"some text">
SA_QUARANTINE="0"                       # [num], required_hits + sa_quarantine  will go to SPAMDIR, 0 disables
SA_DELETE="0"                           # [num], required_hits + sa_delete will be deleted, 0 disables
SA_REJECT="no"                         # [yes|no], changes deletes to rejects
SA_ALT="no"                             # [yes|no], runs in *fast_spamassassin* mode and doesn't pass the '-u' optio
SA_DEBUG="no"                           # [yes|no], requires sa-alt: yes
SA_REPORT="no"                          # [yes|no], requires sa-alt: yes, sa-debug: yes
SA_FORWARD=""                           # <username@domain>, User to redirect quarantined spam mails, unmodified for sa-learn (not used)
SA_VERBOSE="no"                         # [yes|no], requires SA-FORWARD (not used)

/etc/mail/spamassassin/local.cf

Code: Select all

# SpamAssassin config file for version 3.x
# NOTE: NOT COMPATIBLE WITH VERSIONS 2.5 or 2.6
# See http://www.yrex.com/spam/spamconfig25.php for earlier versions
# Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)

# How many hits before a message is considered spam.
required_score           5.0

# Change the subject of suspected spam
rewrite_header subject         *****SPAM*****

# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe             0

# Enable the Bayes system
use_bayes               1

# Enable Bayes auto-learning
bayes_auto_learn              1

# Enable or disable network checks
skip_rbl_checks         1
use_razor2              1
use_dcc                 1
use_pyzor               1

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages            all

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales              all
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Add it in and send me a patch
EvolutionCrazy
Forum User
Forum User
Posts: 67
Joined: Wed Jun 01, 2005 5:52 pm

Unread post by EvolutionCrazy »

I thought

Code: Select all

SA_REJECT="yes"
would have done the trick, but It's not working as expected :(

shouldn't that result in the same behaviour?

PS: spamassassin in your repos is not configured to start at 345 runlevels?
EvolutionCrazy
Forum User
Forum User
Posts: 67
Joined: Wed Jun 01, 2005 5:52 pm

Unread post by EvolutionCrazy »

tried doing the configure of qmail scanner with "--quarantine-reject yes" but that didn't resulted in what I was looking for (nothing changed :( )

basically I'm sending an email to myself (from a different server) with subject: "viagra" and content "viagra"

it "fails" (do not get delivered to my box) with this log:

Code: Select all

Oct 12 22:02:30 ns3 spamd[10078]: spamd: connection from localhost.localdomain [127.0.0.1] at port 36647 
Oct 12 22:02:30 ns3 spamd[10078]: spamd: setuid to qscand succeeded 
Oct 12 22:02:30 ns3 spamd[10078]: spamd: checking message <48F257BD.5090105@sender.domain> for qscand:10002 
Oct 12 22:02:30 ns3 spamd[10078]: spamd: clean message (0.4/5.0) for qscand:10002 in 0.5 seconds, 1086 bytes. 
Oct 12 22:02:30 ns3 spamd[10078]: spamd: result: . 0 - AWL,DRUGS_ERECTILE scantime=0.5,size=1086,user=qscand,uid=10002,required_score=5.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=36647,mid=<48F257BD.5090105@sender.domain>,autolearn=no 
Oct 12 22:02:30 ns3 spamd[10075]: prefork: child states: II 
Oct 12 22:02:30 ns3 qmail-scanner[10118]: Clear:RC:1(127.0.0.1): 0 1100 root@ns3.mailserver.domain <> policy-violation_found_in_sent_message_"viagra" ns3.mailserver.domain122384175079110118-root@ns3.mailserver.domain quarantine-event.txt:1000 
Oct 12 22:02:30 ns3 qmail-scanner[10118]: Perlscan:Spam_Viagra:RC:0(62.149.128.209):SA:0(0.4/5.0): 0.637533 1039 evolutioncrazy@sender.domain evcz@receiving.domain viagra <48F257BD.5090105@sender.domain> 1223841750.10120-0.ns3.mailserver.domain:19 orig-ns3.mailserver.domain122384175079110118:1039
isn't there a way to directly reply to the mail server rejecting his email with the error perlscan retuner?
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Unread post by faris »

SA_REJECT="yes" **PLUS** SA_DELETE="some non-zero figure" are what you need to set.

When set SA_REJECT="yes" the message is rejected at the smtp level rather than being deleted. This is what you want as far as I can tell.

But to get rejected, the message has to score the required_hits (in spamassassin's config) PLUS the number you set in SA_DELETE

So if you have required hits of, say, 3 in spamassassin, and SA_DELETE="3" then the message will be rejected if the total score is 6 or more.

If you set SA_DELETE="0" as you have done then deletion is disabled and so there will be no rejecting :-)

Faris.
Last edited by faris on Sun Oct 12, 2008 7:01 pm, edited 1 time in total.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
EvolutionCrazy
Forum User
Forum User
Posts: 67
Joined: Wed Jun 01, 2005 5:52 pm

Unread post by EvolutionCrazy »

ok thank you, will try that for spamassassin :)
Post Reply