Public Junk folder and RSPAMD training?

NethServer Version: 8
Module: mail

I am migrating my current mail server to NethServer 8 and have configured my mail instance to allow unsolicited emails and store them in the default Junk folder.

I want this to be a catch all account.

I am wondering if items in the Public Junk folder are also auto learned as spam when received/put there (and perhaps.possibly as ham when removed from it when I forgot to setup an alias).

I have tried to find information on this in the documentation but have not found details on the public Junk folder.

1 Like

migrating from where ?

from what I tested, only when you drop an email to the junk folder of the user is training rspamd, if you check the log, the public folder is useless, what do you think @davidep

Jan 02 10:08:24 ns8-leader dovecot[1480903]: imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=582140, secured, session=
Jan 02 10:08:25 ns8-leader dovecot[1480903]: imap(stephane)<582140>: copy from INBOX: box=Public/Junk, uid=26, msgid=<325ecea080025431e75189525286b44d@swift.generated>, from=FORCES <infos@news.laformationpourtous.com>, subject=Vos salariés méritent une vraie montée en compétences !, flags=()
Jan 02 10:08:25 ns8-leader dovecot[1480903]: imap(stephane)<582140>: expunge: box=INBOX, uid=30648, msgid=<325ecea080025431e75189525286b44d@swift.generated>, from=FORCES <infos@news.laformationpourtous.com>, subject=Vos salariés méritent une vraie montée en compétences !, flags=(\Seen)
Jan 02 10:08:25 ns8-leader dovecot[1480903]: imap(stephane)<582140>: Disconnected: Logged out in=207 out=2166 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
Jan 02 10:08:37 ns8-leader dovecot[1480903]: imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=582152, secured, session=<58kADmRHYuAKBQQB>
Jan 02 10:08:38 ns8-leader dovecot[1480903]: imap(stephane)<582152><58kADmRHYuAKBQQB>: Disconnected: Logged out in=435 out=4938 deleted=0 expunged=0 trashed=0 hdr_count=3 hdr_bytes=6 body_count=0 body_bytes=0
Jan 02 10:08:43 ns8-leader dovecot[1480903]: imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=582164, secured, session=
Jan 02 10:08:43 ns8-leader dovecot[1480903]: imap(stephane)<582164>: Disconnected: Logged out in=399 out=4856 deleted=0 expunged=0 trashed=0 hdr_count=3 hdr_bytes=6 body_count=0 body_bytes=0
Jan 02 10:08:45 ns8-leader dovecot[1480903]: imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=582176, secured, session=
Jan 02 10:08:45 ns8-leader dovecot[1480903]: imap(stephane)<582176>: Disconnected: Logged out in=164 out=1443 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
Jan 02 10:08:47 ns8-leader dovecot[1480903]: imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=582188, secured, session=
Jan 02 10:08:47 ns8-leader dovecot[1480903]: imap(stephane)<582188>: Disconnected: Logged out in=390 out=35871 deleted=0 expunged=0 trashed=0 hdr_count=2 hdr_bytes=8002 body_count=2 body_bytes=24554
Jan 02 10:08:54 ns8-leader dovecot[1480903]: imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=582200, secured, session=
Jan 02 10:08:54 ns8-leader rspamd[4540]: (controller) ; csession; rspamd_task_load_message: loaded message from zstd compressed stream; compressed: 7800; uncompressed: 28816
Jan 02 10:08:54 ns8-leader rspamd[4540]: (controller) ; csession; rspamd_message_parse: loaded message; id: <9f14d21d.AUcAAImmlugAAc7K73QAAWn_8RQAAAIRvt8AG48oAAA3ZwBpVnTP@mailjet.com>; queue-id: ; size: 28816; checksum: <11f6d7a2423ca43a8d1edc658f208c90>
Jan 02 10:08:54 ns8-leader rspamd[4540]: (controller) ; csession; rspamd_mime_part_detect_language: detected part language: fr
Jan 02 10:08:54 ns8-leader rspamd[4540]: (controller) ; csession; rspamd_mime_part_detect_language: detected part language: fr
Jan 02 10:08:54 ns8-leader rspamd[4540]: (controller) ; csession; rspamd_controller_learn_fin_task: <127.0.0.1> learned message as spam: ``9f14d21d.AUcAAImmlugAAc7K73QAAWn_8RQAAAIRvt8AG48oAAA3ZwBpVnTP@mailjet.com
Jan 02 10:08:54 ns8-leader dovecot[1480903]: imap(stephane)<582200>: copy from Public/Junk: box=Junk, uid=4973, msgid=<9f14d21d.AUcAAImmlugAAc7K73QAAWn_8RQAAAIRvt8AG48oAAA3ZwBpVnTP@mailjet.com>, from=Caroline Coppey <info@caroline-coppey.com>, subject=2026, flags=(\Seen)
Jan 02 10:08:54 ns8-leader dovecot[1480903]: imap(stephane)<582200>: expunge: box=Public/Junk, uid=24, msgid=<9f14d21d.AUcAAImmlugAAc7K73QAAWn_8RQAAAIRvt8AG48oAAA3ZwBpVnTP@mailjet.com>, from=Caroline Coppey <info@caroline-coppey.com>, subject=2026, flags=(\Seen)
Jan 02 10:08:54 ns8-leader dovecot[1480903]: imap(stephane)<582200>: Disconnected: Logged out in=202 out=1938 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=`
2 Likes

From other open source Small Business Servers (ClearOS and SME Server/Koozali). I seem to remember you being active in the SME Server (currently Koozali) community in the past if not mistaken.

True, we are a lot from SME Server or from ClearOS

Welcome here @jmartens

1 Like

The spam learning actions are configured here and, as already mentioned by Steph, they are triggered only by the user’s Junk folder:

https://github.com/NethServer/ns8-mail/blob/0043f042fb50fd2b37ef7af968d73feca166ba93/dovecot/usr/local/lib/templates/local.conf#L156-L164

As an idea, you could define similar actions for Public/Junk as well. To do so, try extending the plugins {} section as explained in the documentation:

https://github.com/NethServer/ns8-mail/blob/main/README.md#dovecot-custom-configuration

For reference, see the official Dovecot 2.3 documentation on imapsieve mailbox configuration:

https://doc.dovecot.org/2.3/settings/pigeonhole-ext/imapsieve/#pigeonhole_setting-imapsieve_mailboxXXX_name

Note that we’ll soon upgrade to Dovecot 2.4, and the configuration format is expected to change.