You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Matthew Broadhead <ma...@nbmlaw.co.uk> on 2018/01/13 08:35:47 UTC

moving spam to junk folder

i am using CentOS 7, spamassassin-3.4.0-2.el7.x86_64, 
postfix-2.10.1-6.el7.x86_64, with amavisd.

i set my local.cf to use MySQL as a bayes store and it seems to work 
fine setting ham and spam in the database when a message is flagged.  
however it has had no impact on spam received to the inboxes.  we are 
still receiving a large amount of junk email.

i originally installed spamassassin according to this guide 
http://forums.sentora.org/showthread.php?tid=1118 and it does indeed 
filter the test message so it should be working ok?

Re: moving spam to junk folder

Posted by David Jones <dj...@ena.com>.
On 01/15/2018 11:37 AM, Matthew Broadhead wrote:
> thanks for your quick reply.  i expected the spam to be filtered into 
> the Junk mailbox on the server I guess.
> i just sent a test email with GTUBE subject line and i got this
> Jan 15 17:28:40 ns1 amavis[23493]: (23493-20) Blocked SPAM 
> {DiscardedInbound,Quarantined}, [74.125.82.46]:39246 [74.125.82.46] 
> <nb...@gmail.com> -> <ma...@nbmlaw.co.uk>, Queue-ID: 
> 2B73F2C26FD, Message-ID: 
> <CA...@mail.gmail.com>, 
> mail_id: oRq2de4T0Gvi, Hits: 997.982, size: 3387, 
> dkim_sd=20161025:gmail.com, 7408 ms
> so does that mean amavis is discarding the spams or only above a certain 
> hits?
> 
> this is the local.cf after configuring the bayes:
> # These values can be overridden by editing ~/.spamassassin/user_prefs.cf
> # (see spamassassin(1) for details)
> 
> # These should be safe assumptions and allow for simple visual sifting
> # without risking lost emails.
> 
> required_hits 5
> report_safe 0
> rewrite_header Subject [SPAM]
> 
> use_bayes          1
> bayes_auto_learn   1
> bayes_auto_expire  1
> 
> # Store bayesian data in MySQL
> bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
> bayes_sql_dsn      DBI:mysql:sa_bayes:localhost:3306
> 
> # Store bayesian data in MySQL
> #bayes_store_module Mail::SpamAssassin::BayesStore::PgSQL
> #bayes_sql_dsn      DBI:Pg:database:sql_server:sql_port
> #
> bayes_sql_username sa_user
> bayes_sql_password <my password>
> #
> # Override the username used for storing
> # data in the database. This could be used to group users together to
> # share bayesian filter data. You can also use this config option to
> # trick sa-learn to learn data as a specific user.
> #
> #bayes_sql_override_username vmail
> 
> On 13/01/2018 10:51, Antony Stone wrote:
>> On Saturday 13 January 2018 at 09:35:47, Matthew Broadhead wrote:
>>
>>> i am using CentOS 7, spamassassin-3.4.0-2.el7.x86_64,
>>> postfix-2.10.1-6.el7.x86_64, with amavisd.
>>>
>>> i set my local.cf to use MySQL as a bayes store and it seems to work
>>> fine setting ham and spam in the database when a message is flagged.
>>> however it has had no impact on spam received to the inboxes.  we are
>>> still receiving a large amount of junk email.
>> What do you expect to happen to spam instead of it being delivered to 
>> inboxes?
>>
>>> i originally installed spamassassin according to this guide
>>> http://forums.sentora.org/showthread.php?tid=1118  and it does indeed
>>> filter the test message so it should be working ok?
>> That set of steps is designed to do is to change the subject line of spam
>> emails to contain (it's not clear to me whether it then becomes the only
>> content, or whether the original content is also retained) the phrase
>> "***SPAM***"
>>
>> Are the spam emails which are still arriving in your inbox/es labelled 
>> in this
>> way?  If they are, then what you have installed is working as expected.
>>
>> Also, you say you "originally installed spamassassin according to that 
>> guide"
>> - what have you changed since then?  How does your current setup 
>> differ from
>> what those steps create?
>>
>>
>> Antony.
>>
> 

Amavis will be calling SpamAssassin on it's own most likely as a milter 
inside Postfix.  You shouldn't need any other SA integration in the 
master.cf so make sure you only have SA being called once in amavis then 
look at the /etc/amavisd/amavis.conf (most likely location but could be 
somewhere else depending on how you installed it) for the SA-related 
settings.

Once Amavis is done with the message and it passes clean, there will be 
an MDA like dovecot that will be responsible for moving the message into 
the Junk/Spam folder.

Try setting up a quick test VM with iRedmail (https://iredmail.org) to 
see how all of this fits together.  It only takes a few minutes to 
install iRedMail on a clean VM installation then you have everything 
setup properly to see how it should be done.

-- 
David Jones

Re: moving spam to junk folder

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 15.01.18 18:37, Matthew Broadhead wrote:
>thanks for your quick reply.  i expected the spam to be filtered into 
>the Junk mailbox on the server I guess.

That's precisely why I was talking about MDA (procmail, maildrop, sieve).

if you use one globally, you can configure it to deliver mail to Junk, if it
matches spam headerd (X-Spam-Flag: YES).

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
I'm not interested in your website anymore.
If you need cookies, bake them yourself.

Re: moving spam to junk folder

Posted by Matthew Broadhead <ma...@nbmlaw.co.uk>.
thanks for your quick reply.  i expected the spam to be filtered into 
the Junk mailbox on the server I guess.
i just sent a test email with GTUBE subject line and i got this
Jan 15 17:28:40 ns1 amavis[23493]: (23493-20) Blocked SPAM 
{DiscardedInbound,Quarantined}, [74.125.82.46]:39246 [74.125.82.46] 
<nb...@gmail.com> -> <ma...@nbmlaw.co.uk>, Queue-ID: 
2B73F2C26FD, Message-ID: 
<CA...@mail.gmail.com>, 
mail_id: oRq2de4T0Gvi, Hits: 997.982, size: 3387, 
dkim_sd=20161025:gmail.com, 7408 ms
so does that mean amavis is discarding the spams or only above a certain 
hits?

this is the local.cf after configuring the bayes:
# These values can be overridden by editing ~/.spamassassin/user_prefs.cf
# (see spamassassin(1) for details)

# These should be safe assumptions and allow for simple visual sifting
# without risking lost emails.

required_hits 5
report_safe 0
rewrite_header Subject [SPAM]

use_bayes          1
bayes_auto_learn   1
bayes_auto_expire  1

# Store bayesian data in MySQL
bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
bayes_sql_dsn      DBI:mysql:sa_bayes:localhost:3306

# Store bayesian data in MySQL
#bayes_store_module Mail::SpamAssassin::BayesStore::PgSQL
#bayes_sql_dsn      DBI:Pg:database:sql_server:sql_port
#
bayes_sql_username sa_user
bayes_sql_password <my password>
#
# Override the username used for storing
# data in the database. This could be used to group users together to
# share bayesian filter data. You can also use this config option to
# trick sa-learn to learn data as a specific user.
#
#bayes_sql_override_username vmail

On 13/01/2018 10:51, Antony Stone wrote:
> On Saturday 13 January 2018 at 09:35:47, Matthew Broadhead wrote:
>
>> i am using CentOS 7, spamassassin-3.4.0-2.el7.x86_64,
>> postfix-2.10.1-6.el7.x86_64, with amavisd.
>>
>> i set my local.cf to use MySQL as a bayes store and it seems to work
>> fine setting ham and spam in the database when a message is flagged.
>> however it has had no impact on spam received to the inboxes.  we are
>> still receiving a large amount of junk email.
> What do you expect to happen to spam instead of it being delivered to inboxes?
>
>> i originally installed spamassassin according to this guide
>> http://forums.sentora.org/showthread.php?tid=1118  and it does indeed
>> filter the test message so it should be working ok?
> That set of steps is designed to do is to change the subject line of spam
> emails to contain (it's not clear to me whether it then becomes the only
> content, or whether the original content is also retained) the phrase
> "***SPAM***"
>
> Are the spam emails which are still arriving in your inbox/es labelled in this
> way?  If they are, then what you have installed is working as expected.
>
> Also, you say you "originally installed spamassassin according to that guide"
> - what have you changed since then?  How does your current setup differ from
> what those steps create?
>
>
> Antony.
>


Re: moving spam to junk folder

Posted by Antony Stone <An...@spamassassin.open.source.it>.
On Saturday 13 January 2018 at 09:35:47, Matthew Broadhead wrote:

> i am using CentOS 7, spamassassin-3.4.0-2.el7.x86_64,
> postfix-2.10.1-6.el7.x86_64, with amavisd.
> 
> i set my local.cf to use MySQL as a bayes store and it seems to work
> fine setting ham and spam in the database when a message is flagged. 
> however it has had no impact on spam received to the inboxes.  we are
> still receiving a large amount of junk email.

What do you expect to happen to spam instead of it being delivered to inboxes?

> i originally installed spamassassin according to this guide
> http://forums.sentora.org/showthread.php?tid=1118 and it does indeed
> filter the test message so it should be working ok?

That set of steps is designed to do is to change the subject line of spam 
emails to contain (it's not clear to me whether it then becomes the only 
content, or whether the original content is also retained) the phrase 
"***SPAM***"

Are the spam emails which are still arriving in your inbox/es labelled in this 
way?  If they are, then what you have installed is working as expected.

Also, you say you "originally installed spamassassin according to that guide" 
- what have you changed since then?  How does your current setup differ from 
what those steps create?


Antony.

-- 
"I think both KDE and Gnome suck - I'm quite unbiased in that, because I use a 
Mac."

 - Jason Isitt

                                                   Please reply to the list;
                                                         please *don't* CC me.

Re: moving spam to junk folder

Posted by jdow <jd...@earthlink.net>.
On 2018-01-13 09:42, Matus UHLAR - fantomas wrote:
> On 13.01.18 09:35, Matthew Broadhead wrote:
>> i set my local.cf to use MySQL as a bayes store and it seems to work fine 
>> setting ham and spam in the database when a message is flagged. however it has 
>> had no impact on spam received to the inboxes.  we are still receiving a large 
>> amount of junk email.
>>
>> i originally installed spamassassin according to this guide 
>> http://forums.sentora.org/showthread.php?tid=1118 and it does indeed filter 
>> the test message so it should be working ok?
> 
> spamassassin detects and marks mail, it does not deliver it.
> the MDA (mail delivery agent) delivers the mail.
> 
> you need to configure your MDA (procmail, maildrop, sieve etc) to deliver
> mail marked as spam to Junk folder.

Or, if it is sufficient, he could have his MUA sort incoming marked as spam into 
his local spam bucket for examination before disposal. I make that easy by 
telling SA I want a header that looks like this: "*****SPAM***** 009.1 ** You 
have 3 missed Nigerian Spam Pill Adds". Sorting incoming based on the 
"*****SPAM*****" part is rather easy.

{^_^}

Re: moving spam to junk folder

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 13.01.18 09:35, Matthew Broadhead wrote:
>i set my local.cf to use MySQL as a bayes store and it seems to work 
>fine setting ham and spam in the database when a message is flagged.  
>however it has had no impact on spam received to the inboxes.  we are 
>still receiving a large amount of junk email.
>
>i originally installed spamassassin according to this guide 
>http://forums.sentora.org/showthread.php?tid=1118 and it does indeed 
>filter the test message so it should be working ok?

spamassassin detects and marks mail, it does not deliver it.
the MDA (mail delivery agent) delivers the mail.

you need to configure your MDA (procmail, maildrop, sieve etc) to deliver
mail marked as spam to Junk folder.

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
    One OS to rule them all, One OS to find them, 
One OS to bring them all and into darkness bind them