Koozali.org: home of the SME Server

Problème spamassassin sous SME 9.2

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #45 on: October 29, 2021, 01:17:38 PM »
ok in

/usr/share/qpsmtpd/plugins/spamassassin

should replace remote_ip with local_ip

Code: [Select]
sub is_in_forcespamcheck {
    my $self = shift;

    my %forcespamcheck = map { $_ => 1 } $self->qp->config('forcespamcheck');

    my $ip = $self->qp->connection->remote_ip;

    while ($ip) {
        if (exists $forcespamcheck{$ip}) {
            $self->log(LOGINFO, "$ip in force spam check");
            return 1;
        }
        $ip =~ s/(\d|\w)+(:|\.)?$// or last;    # strip off another octet
    }

    $self->log(LOGDEBUG, "no match in forcespamcheck");
    return;
}

« Last Edit: October 29, 2021, 01:38:07 PM by Jean-Philippe Pialasse »

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #46 on: October 29, 2021, 01:41:00 PM »
this has to be tested. i am not sure local_ip contain only the current transaction local ip or all the ip qpsmtpd is listening to. 

also thinking more, i am not sure if we do not want to force check also on 127.0.0.1 anyway. 

do we trust that much email from php script ?

Offline ReetP

  • *
  • 3,732
  • +5/-0
Re: Problème spamassassin sous SME 9.2
« Reply #47 on: October 29, 2021, 01:46:24 PM »
do we trust that much email from php script ?

A very good question..... I'd be reluctant to see that.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Fredchou

  • *
  • 52
  • +0/-0
  • Use SME server at home
Re: Problème spamassassin sous SME 9.2
« Reply #48 on: November 05, 2021, 09:35:54 AM »
I have added "127.0.0.1" to /var/service/qpsmtpd/config/forcespamcheck but my e-mails still aren't scanned.  :sad:
Fred Chou

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #49 on: November 05, 2021, 12:07:32 PM »
on a pas de boule de cristal, donc sans log cel n’avance à rien ;)

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: Problème spamassassin sous SME 9.2
« Reply #50 on: November 05, 2021, 12:12:49 PM »
The IP address for fetchmail-retrieved emails is 127.0.0.200, not 127.0.0.1.

From logs on my SME 9 server, spamassassin is ignoring the fetchmail emails because '127.0.0.200' is a 'relayclient' according to the default contents of /etc/e-smith/templates/var/service/qpsmtpd/config/relayclients/10localhost ("127.0.0")

You might get fetchmail emails scanned by spamassassin if you customize .../relayclients/10localhost -

Code: [Select]
# create the custom template folder
mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/relayclients/

# change into it
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/relayclients/

# copy the original 10localhost, omitting the line that includes '127.0.0.*'
grep -v '127.0.0.\\n' /etc/e-smith/templates/var/service/qpsmtpd/config/relayclients/10localhost > 10localhost

# activate changes
signal-event email-update

Revert these changes if there are problems:
Code: [Select]
'rm' /etc/e-smith/templates-custom/var/service/qpsmtpd/config/relayclients/10localhost
signal-event email-update


I have verified that the steps above successfully modify /var/service/qpsmtpd/config/relayclients/10localhost.  My SME server is no longer receiving email so I can't verify that anything works after making the change...


Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #51 on: November 05, 2021, 01:45:13 PM »
@mccarn

Thing is the current setting makes fetchmail connect as 127.0.0.1 to 127.0.0.200:25 to deliver email.

but current code looks at remote ip not local ip.
if you see a log you see helo 127.0.0.1 for email from fetchmail, not helo 127.0.0.200.

so 127.0.0.1 should work and 127.0.0.200 not currently.  but accordingly Fredchou adding 127.0.0.1 does not help. 

127.0.0. would just be a similar situation removing the exclusion from all localhost.

but before doing any changes (whitelist 127.0.0. or 127.0.0.1 or altering the plugin code to test on local ip instead of remote ip) we should answer the question :
- de we really want to exclude from spam check emails from localhost?
- what is currently exclude from spam check and do we really want anything to be immune from that so the fix should be simply to remove the is immune call.

Offline Fredchou

  • *
  • 52
  • +0/-0
  • Use SME server at home
Re: Problème spamassassin sous SME 9.2
« Reply #52 on: November 08, 2021, 09:15:01 PM »
Here is /var/log/qpsmtpd/current content:

Code: [Select]
2021-11-08 20:50:04.662354500 1408 Accepted connection 1/40 from 127.0.0.1 / localhost
2021-11-08 20:50:04.662714500 1408 Connection from localhost [127.0.0.1]
2021-11-08 20:50:04.975496500 1408 (connect) relay: pass, octet match in relayclients (127.0.0.)
2021-11-08 20:50:04.975950500 1408 220 ***.net ESMTP
2021-11-08 20:50:04.976640500 1408 dispatching EHLO ***.net
2021-11-08 20:50:04.978063500 1408 250-***.net Hi localhost [127.0.0.1]
2021-11-08 20:50:04.978089500 1408 250-PIPELINING
2021-11-08 20:50:04.978115500 1408 250-8BITMIME
2021-11-08 20:50:04.978141500 1408 250-SIZE 40000000
2021-11-08 20:50:04.978167500 1408 250 STARTTLS
2021-11-08 20:50:04.978642500 1408 dispatching MAIL FROM:<reply@bounces.actu-premium.fr> BODY=8BITMIME SIZE=102814
2021-11-08 20:50:04.979701500 1408 (mail) badmailfrom: skip, relay client
2021-11-08 20:50:04.979885500 1408 250 <reply@bounces.actu-premium.fr>, sender OK - how exciting to get mail from you!
2021-11-08 20:50:04.980331500 1408 dispatching RCPT TO:<***@***.net>
2021-11-08 20:50:04.980833500 1408 (rcpt) badrcptto: skip, relay client
2021-11-08 20:50:04.980989500 1408 (rcpt) rcpt_ok: skip, relay client
2021-11-08 20:50:04.981163500 1408 250 <***@***.net>, recipient ok
2021-11-08 20:50:04.981605500 1408 dispatching DATA
2021-11-08 20:50:04.981919500 1408 354 go ahead
2021-11-08 20:50:04.982864500 1408 spooling message to disk
2021-11-08 20:50:05.047722500 1408 (data_post_headers) dkim: skip, DKIM not configured for bounces.actu-premium.fr
2021-11-08 20:50:05.070324500 1408 (data_post) bogus_bounce: pass, not a null sender
2021-11-08 20:50:05.070479500 1408 (data_post) headers: skip, relay client
2021-11-08 20:50:05.206846500 1408 (data_post) virus::clamdscan: pass, clean
2021-11-08 20:50:05.207797500 1408 (queue) logging::logterse: ` 127.0.0.1 localhost ***.net <reply@bounces.actu-premium.fr> <***@***.net> queued <c18d32b7635358ad828ef0602f591210@manager.actu-premium.fr>
2021-11-08 20:50:05.210633500 1409 (queue) queue::qmail_2dqueue: (for 1408) Queuing to /var/qmail/bin/qmail-queue
2021-11-08 20:50:05.377806500 1408 250 Queued! 1636401005 qp 1409 <c18d32b7635358ad828ef0602f591210@manager.actu-premium.fr>
2021-11-08 20:50:05.468123500 1408 dispatching QUIT
2021-11-08 20:50:05.470681500 1408 221 ***.net closing connection. Have a wonderful day.
2021-11-08 20:50:05.470685500 1408 click, disconnecting
Fred Chou

Offline Fredchou

  • *
  • 52
  • +0/-0
  • Use SME server at home
Re: Problème spamassassin sous SME 9.2
« Reply #53 on: November 17, 2021, 09:19:47 AM »
I still get dozens of spams every day. It's quite boring!

Could anyone suggest a "trick" to make my e-mails be scanned by spamassassin while waiting for the official patch?

Thanks!

Fred
Fred Chou

Offline ReetP

  • *
  • 3,732
  • +5/-0
Re: Problème spamassassin sous SME 9.2
« Reply #54 on: November 17, 2021, 09:44:14 AM »
I still get dozens of spams every day. It's quite boring!

Things will get fixed faster if you help rather than complain.

https://wiki.koozali.org/SME_Server:Volunteering

We know it is an issue. Complaining won't fix it. Helping will.

Quote
Could anyone suggest a "trick" to make my e-mails be scanned by spamassassin while waiting for the official patch?

If you followed this thread and bugzilla you would be aware that this is tricky and not a simple fix. There is no trick.

I suggest you check bugs:

10289
10290
10538
11763

Rather than sit and wait for others, get involved and help.

Read these and look at how you can verify these bugs so they can be released, the community can benefit, and you can get the fixes faster.

https://wiki.koozali.org/SME_Server:Documentation:QA:Verification

https://wiki.koozali.org/Verification_Queue

You might even learn something on the way.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #55 on: November 17, 2021, 03:07:25 PM »
en fait au moment ou tu te plaignais aujourd’hui de la situation le bug est fixé depuis hier !

je n’utilise pas fetchmail, mais j’ai passé plusieurs heures sur ce problème comme d’autre avant bénévolement . 

alors il te reste plus qu’a tester le bug. verifier que rien d’autre casse et de preference pas sur un environnement en production.

tu as juste à regarder les derniers bugs mis à jour sur bugs.koozaali.org comcernant qpsmtpd et smeserver-qpsmtpd

Offline ReetP

  • *
  • 3,732
  • +5/-0
Re: Problème spamassassin sous SME 9.2
« Reply #56 on: November 18, 2021, 10:13:22 AM »
Personally I find the sound of crickets quite boring.......
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Fredchou

  • *
  • 52
  • +0/-0
  • Use SME server at home
Re: Problème spamassassin sous SME 9.2
« Reply #57 on: November 20, 2021, 06:13:59 PM »
Bonjour à tous,
Je suis vraiment désolé que mon message précédent ait vexé certains membres de l'équipe de développement. Je ne voulais absolument pas "relancer" l'équipe de développement sur ce bug. Je sais que tout le monde est bénévole et fait ça sur son temps libre.
La prochaine fois, je tournerai mon clavier 7 fois dans mes mains avant de poster mon message. ;-)
Merci pour la mise à jour. Je vais tester le nouveau package.
A bientôt !
Fred
Fred Chou

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #58 on: November 20, 2021, 07:44:18 PM »
On a hâte d'entendre ton retour !

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Problème spamassassin sous SME 9.2
« Reply #59 on: November 20, 2021, 08:58:51 PM »
Bonjour à tous,
Je suis vraiment désolé que mon message précédent ait vexé certains membres de l'équipe de développement. Je ne voulais absolument pas "relancer" l'équipe de développement sur ce bug. Je sais que tout le monde est bénévole et fait ça sur son temps libre.
La prochaine fois, je tournerai mon clavier 7 fois dans mes mains avant de poster mon message. ;-)
Merci pour la mise à jour. Je vais tester le nouveau package.
A bientôt !
Fred

Please excuse my english in a french forum, I am but a descendant of convicts :-)

Finished turning keyboartd, :-) now fredchou your help is needed, see Bugs 10289 and Bug 11763 both have had patches applied to fix the problem you first raised, and rightly so. Please provide a little feedback and add to both that the fix is working or not.

Both packages are in /smeupdates-testing want a user in real world to confirm works or other issue..no need for a full verification just a comment in each bug that its doing what it is designed to do..when confirmed working the rpms will be moved to updates and will flow on to all..

thank you in advance,
--
qui scribit bis legit