Koozali.org: home of the SME Server

Problème spamassassin sous SME 9.2

Offline Fredchou

  • *
  • 52
  • +0/-0
  • Use SME server at home
Re: Problème spamassassin sous SME 9.2
« Reply #30 on: October 15, 2021, 10:13:06 AM »
Voici les templates modifiés sur mon serveur :

Code: [Select]
#/sbin/e-smith/audittools/templates
/etc/e-smith/templates-custom/90rsync: MANUALLY_ADDED, ADDITION
/etc/e-smith/templates-custom/etc/services/90rsync: MANUALLY_ADDED, ADDITION
/etc/e-smith/templates-custom/etc/mail/spamassassin/local.cf/85_LOCALS: MANUALLY_ADDED, ADDITION
/etc/e-smith/templates-custom/etc/openldap/slapd.conf/95logs: MANUALLY_ADDED, ADDITION
/etc/e-smith/templates-custom/etc/php.ini/30ErrorHandling: MANUALLY_ADDED, OVERRIDE
/etc/e-smith/templates-custom/etc/smb.conf/50printers: MANUALLY_ADDED, OVERRIDE
/etc/e-smith/templates-custom/etc/smb.conf/11winsServer: MANUALLY_ADDED, OVERRIDE
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts40ACME: MANUALLY_ADDED, ADDITION

Ma config de sme-fetchmail a été "héritée" de mon serveur SME9. Comme toi, je soupçonne des templates qui auraient été modifiés avant la migration vers SME 10 pour corriger certains problèmes...

Par contre, je ne comprends pas pourquoi fetchmail est activé (dans le server manager + je reçois bien mes e-mails) et pourquoi le statut de fetchmail est "disabled" dans la base de configuration...  :-(

Merci encore pour votre aide ! :-)
Fred Chou

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Problème spamassassin sous SME 9.2
« Reply #31 on: October 15, 2021, 03:11:32 PM »
You really should attempt to understand these things before installing them.

There is a difference between the basic fetchmail built in to Koozali SME, and the smeserver-fetchmail contribution that gives enhanced functionality.

Please read the notes you pasted above:

Quote
Nom             : smeserver-fetchmail
Description    : sme server enhancement to make fetchmail more useable

Quote
Par contre, je ne comprends pas pourquoi fetchmail est activé (dans le server manager + je reçois bien mes e-mails) et pourquoi le statut de fetchmail est "disabled" dans la base de configuration...

On the other hand, I do not understand why fetchmail is activated (in the server manager + I receive my e-mails well)

Both of these things cannot be true.

Code: [Select]
cat /etc/fetchmail (without passwords etc)

Code: [Select]
cat /etc/startmail
...
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 #32 on: October 20, 2021, 10:23:45 AM »
I think I understand the difference between fetchmail tool and smeserver-fetchmail contrib. But I thought the contrib would automatically activate the fetchmail program. That's why I find strange that fetchmail service is "disabled" in SME config and that e-mails downloading is activated in the server manager...

Code: [Select]
cat /etc/fetchmail
#   Mail N1 Account for : fred
/usr/bin/fetchmail -l40000000 -d0 --silent --syslog --fetchmailrc - <<EOF
set postmaster "postmaster@mydomain.net"
set bouncemail
set no softbounce
set properties ""
poll pop.free.fr with proto POP3 timeout 300 and options uidl no dns
  user '****' smtpaddress mydomain.net with password '****' is fred here fetchall
  smtphost 127.0.0.200/25
  antispam 550
EOF

Code: [Select]
cat /etc/startmail
# This service has been flagged as 'disabled'
# in the e-smith services database.

# FetchMails dedicated connection; just call fetchmail to get things started
/bin/su - qmailr -s /bin/bash -c \
        "FETCHMAILHOME=/var/lock/fetchmail /etc/fetchmail"

I will try to activate manually the fetchmail service in SME config.
Fred Chou

Offline Fredchou

  • *
  • 52
  • +0/-0
  • Use SME server at home
Re: Problème spamassassin sous SME 9.2
« Reply #33 on: October 20, 2021, 12:13:31 PM »
I have set e-mail reception to "ETRN" in the server manager. Fetchmail is now "enabled" in SME config. IP adress 127.0.0.200 has been added to file /var/service/qpsmtpd/config/forcespamcheck. But my e-mails still aren't scanned by spamassin (no "X-spam" headers in my e-mails).
Fred Chou

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Problème spamassassin sous SME 9.2
« Reply #34 on: October 20, 2021, 01:01:21 PM »
So you better show your new fetchmail file - we can't tell much without seeing it.
...
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 #35 on: October 20, 2021, 02:55:18 PM »
Is that what you call "fetchmail file"?

Code: [Select]
cat /etc/fetchmail
# ETRN configuration; fetchmail sends ETRN command to flush mail from remote mail server:
/usr/bin/fetchmail --syslog --silent --protocol ETRN --fetchdomains mydomain.net mail.myisp.xxx > /dev/null 2>&1

#   Mail N1 Account for : fred
/usr/bin/fetchmail -l40000000 -d0 --silent --syslog --fetchmailrc - <<EOF
set postmaster "postmaster@mydomain.net"
set bouncemail
set no softbounce
set properties ""
poll pop.free.fr with proto POP3 timeout 300 and options uidl no dns
  user 'fredchou' smtpaddress mydomain.net with password '****' is fred here fetchall
  smtphost 127.0.0.200/25
  antispam 550
EOF
Fred Chou

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Problème spamassassin sous SME 9.2
« Reply #36 on: October 20, 2021, 11:03:50 PM »
please excuse my use of english here, its all I have :-)

Doing some more testing on the fetchmail contrib, suspect something is not quite right...will report back shortly, certainly the sme9 version is not behaving as it should sme9 version is not enabling/disabling from the server-manager panel

[root@sme9 ~]# config show FetchMails
FetchMails=service
Routing=YES
RoutingNNTP=YES
RoutingSMTP=YES
status=disabled
timeout=60
version=1.6-15.el6.sme

above is smeserver-fetchmail config,
status is not changing when panel is toggled..need to dig about the contrib and also look at sme10 version
« Last Edit: October 20, 2021, 11:08:12 PM by TerryF »
--
qui scribit bis legit

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Problème spamassassin sous SME 9.2
« Reply #37 on: October 20, 2021, 11:34:59 PM »
See https://bugs.koozali.org/show_bug.cgi?id=11058 this is the issue, you can do a manual enable

[root@sme10testvm2 ~]# config setprop FetchMails status enabled
[root@sme10testvm2 ~]# config show FetchMails
FetchMails=service
    Routing=YES
    RoutingNNTP=YES
    RoutingSMTP=YES
    status=enabled
    timeout=60
    version=1.6-20.el7.sme

and the deed is done..my bad for not looking further when doing another Bug

need to revert my patch, later today and fix the root issue


« Last Edit: October 21, 2021, 12:51:08 AM by TerryF »
--
qui scribit bis legit

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Problème spamassassin sous SME 9.2
« Reply #38 on: October 21, 2021, 01:40:19 AM »
new rpm in /smetest  smeserver-fetchmail-1_6-21_el7_sme

note the different Config dbs, fetchmail (stanard sme) and FetchMails (smeserver-fetchmail)

Issue is server-manager panel enable/disable is not working

You can set manually from the cli

[root@sme10testvm2 ~]# config setprop FetchMails status enabled
[root@sme10testvm2 ~]# config show FetchMails
FetchMails=service
    Routing=YES
    RoutingNNTP=YES
    RoutingSMTP=YES
    status=enabled
    timeout=60
    version=1.6-20.el7.sme

and do a  # expand-template /var/service/qpsmtpd/config/forcespamcheck  /var/service/qpsmtpd/config/forcespamcheck will be populated as expected


--
qui scribit bis legit

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #39 on: October 21, 2021, 05:24:56 AM »
after the fix,
contribs should allow filtering of fetched mails but core fetched mails will not be filtered. 

i am wondering if we should make the /var/service/qpsmtpd/config/forcespamcheck always with 127.0.0.200 or at least a core fragment that will display it wether fetchmail or FetchMails are enabled. 


Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Problème spamassassin sous SME 9.2
« Reply #40 on: October 21, 2021, 05:34:05 AM »
i am wondering if we should make the /var/service/qpsmtpd/config/forcespamcheck always with 127.0.0.200 or at least a core fragment that will display it wether fetchmail or FetchMails are enabled.

yes to this, I was confused as to the different DBs whether enabled or disabled..
--
qui scribit bis legit

Offline Fredchou

  • *
  • 52
  • +0/-0
  • Use SME server at home
Re: Problème spamassassin sous SME 9.2
« Reply #41 on: October 29, 2021, 10:08:13 AM »
Sorry for answering late, I was busy during the last days...

Regarding bug https://bugs.koozali.org/show_bug.cgi?id=11058:

- I have applied the new patch (1.6 - 21.e17.sme).
- I have set the "SMTP retrieving mode" in the "e-mail" panel of the server manager.
- Fragment "127.0.0.200" is present in file "cat /var/service/qpsmtpd/config/forcespamcheck".
- I got "smtphost 127.0.0.200/25" & "antispam 550" in my "/etc/fetchmail" file.
- I got status "disabled" in my fecthmail config.
- I got status "enabled" in my FetchMails config.
- I have activated the "debug" mode in fetchmail pannel.
- I got this in "/var/log/maillog":
Code: [Select]
Oct 29 10:30:05 serveur-sme fetchmail[9384]: 1 message pour *** dans pop.free.fr (1863 octets).
Oct 29 10:30:05 serveur-sme fetchmail[9384]: POP3> LIST 1
Oct 29 10:30:05 serveur-sme fetchmail[9384]: POP3< +OK 1 1863
Oct 29 10:30:05 serveur-sme fetchmail[9384]: POP3> RETR 1
Oct 29 10:30:05 serveur-sme fetchmail[9384]: POP3< +OK message follows
Oct 29 10:30:05 serveur-sme fetchmail[9384]: lecture du message ***@pop.free.fr:1 parmi 1 (1863 octets)Essai de connexion avec 127.0.0.200/25...connecté.
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 220 ***.net ESMTP
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP> EHLO ***.net
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 250-***.net Hi localhost [127.0.0.1]
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 250-PIPELINING
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 250-8BITMIME
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 250-SIZE 40000000
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 250 STARTTLS
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP> MAIL FROM:<***@free.fr> BODY=8BITMIME SIZE=1863
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 250 <***@free.fr>, sender OK - how exciting to get mail from you!
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP> RCPT TO:<***@***.net>
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 250 <***@***.net>, recipient ok
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP> DATA
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 354 go ahead
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP>. (EOM)
Oct 29 10:30:05 serveur-sme fetchmail[9384]: SMTP< 250 Queued! 1635496205 qp 9386 <2e511c7a-facc-fef6-1c6a-b9e62a053c3d@free.fr>
Oct 29 10:30:05 serveur-sme fetchmail[9384]:  éliminé
Oct 29 10:30:05 serveur-sme fetchmail[9384]: POP3> DELE 1
Oct 29 10:30:06 serveur-sme fetchmail[9384]: POP3< +OK message 1 marked for deletion
Oct 29 10:30:06 serveur-sme fetchmail[9384]: POP3> QUIT
Oct 29 10:30:06 serveur-sme fetchmail[9384]: POP3< +OK deleted 1 message(s)
Oct 29 10:30:06 serveur-sme fetchmail[9384]: SMTP> QUIT
Oct 29 10:30:06 serveur-sme fetchmail[9384]: SMTP< 221 ***.net closing connection. Have a wonderful day.
- Got this in "/var/log/qpsmtpd/current":
Code: [Select]
2021-10-29 10:30:05.302225500 9385 Accepted connection 0/40 from 127.0.0.1 / localhost
2021-10-29 10:30:05.310007500 9385 Connection from localhost [127.0.0.1]
2021-10-29 10:30:05.607607500 9385 (connect) relay: pass, octet match in relayclients (127.0.0.)
2021-10-29 10:30:05.608047500 9385 220 ***.net ESMTP
2021-10-29 10:30:05.608818500 9385 dispatching EHLO ***.net
2021-10-29 10:30:05.610271500 9385 250-***.net Hi localhost [127.0.0.1]
2021-10-29 10:30:05.610298500 9385 250-PIPELINING
2021-10-29 10:30:05.610320500 9385 250-8BITMIME
2021-10-29 10:30:05.610348500 9385 250-SIZE 40000000
2021-10-29 10:30:05.610374500 9385 250 STARTTLS
2021-10-29 10:30:05.610997500 9385 dispatching MAIL FROM:<***@free.fr> BODY=8BITMIME SIZE=1863
2021-10-29 10:30:05.611979500 9385 (mail) badmailfrom: skip, relay client
2021-10-29 10:30:05.612156500 9385 250 <***@free.fr>, sender OK - how exciting to get mail from you!
2021-10-29 10:30:05.612688500 9385 dispatching RCPT TO:<***@***.net>
2021-10-29 10:30:05.613175500 9385 (rcpt) badrcptto: skip, relay client
2021-10-29 10:30:05.613366500 9385 (rcpt) rcpt_ok: skip, relay client
2021-10-29 10:30:05.613548500 9385 250 <***@***.net>, recipient ok
2021-10-29 10:30:05.614037500 9385 dispatching DATA
2021-10-29 10:30:05.614368500 9385 354 go ahead
2021-10-29 10:30:05.615344500 9385 spooling message to disk
2021-10-29 10:30:05.657479500 9385 (data_post_headers) dkim: skip, DKIM not configured for free.fr
2021-10-29 10:30:05.680216500 9385 (data_post) bogus_bounce: pass, not a null sender
2021-10-29 10:30:05.680401500 9385 (data_post) headers: skip, relay client
2021-10-29 10:30:05.699440500 9385 (data_post) virus::clamdscan: pass, clean
2021-10-29 10:30:05.700380500 9385 (queue) logging::logterse: ` 127.0.0.1 localhost ***.net <***@***.fr> <***@***.net> queued <2e511c7a-facc-fef6-1c6a-b9e62a053c3d@free.fr>
2021-10-29 10:30:05.703427500 9386 (queue) queue::qmail_2dqueue: (for 9385) Queuing to /var/qmail/bin/qmail-queue
2021-10-29 10:30:05.933411500 9385 250 Queued! 1635496205 qp 9386 <2e511c7a-facc-fef6-1c6a-b9e62a053c3d@***.fr>
2021-10-29 10:30:06.155378500 9385 dispatching QUIT
2021-10-29 10:30:06.155950500 9385 221 carofred.net closing connection. Have a wonderful day.
2021-10-29 10:30:06.157464500 9385 click, disconnecting
2021-10-29 10:30:06.235492500 8167 cleaning up after 9385

My e-mails received directly with SMTP are scanned by spamassassin.
My e-mails received with fetchmail from external POP server are still not scanned by spamassassin !  :sad: (no headers)

In which log should I look to understand what happens wrong?

Thanks again for your help!
« Last Edit: October 29, 2021, 12:36:19 PM by Fredchou »
Fred Chou

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #42 on: October 29, 2021, 12:40:17 PM »
something wrong.
the connection is detected from 127.0.0.1 not 127.0.0.200

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Problème spamassassin sous SME 9.2
« Reply #43 on: October 29, 2021, 12:57:08 PM »
seen, I will patch and roll a update if needed, looking back at old patches, the ip  $OUT  = "\n127.0.0.200\n"  goes back to 2018 in sme9

« Last Edit: October 29, 2021, 01:00:34 PM by TerryF »
--
qui scribit bis legit

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problème spamassassin sous SME 9.2
« Reply #44 on: October 29, 2021, 01:10:51 PM »
ok will not work


because in spamassassin the test is on remote_ip.  however the option in fetchmail does not specify from where it tries to send but to where. 


there is no way i see to set fetchmail to send from a dedicated ip. so we must find a way in qpsmtpd to check on what ip it recieve the connexion.