Mail is delivered in spam folder of roundcubemail if nethserver-mail2-filter is not installed

mail2

(Mark Verlinde) #1

NethServer release 7.5.1804
Modules: nethserver-mail2-server nethserver-roundcubemail

NOTE:
This could be a quirk of my test setup, domain (and email addresses) are local FQDN’s (ie @example.lan). They are well known in the DNS’es of the test environment.

All the local mail send from one test user to another with roundcubemail ends up in the spamfolder if you only installed nethserver-mail2-server nethserver-roundcubemail.
This is solved by unchecking (Configuration) Email>Mailboxes Move to "Junk" folder

to reproduce:
yum install nethserver-mail2-server nethserver-roundcubemail
make to users and send mail with roundcubemail from user1 to user2

Possible causes:
Looking at the templates this two cached my eyes:
etc/e-smith/templates/etc/postfix/master.cf/40spam_training
etc/e-smith/templates/etc/dovecot/dovecot.conf/50spamfolder

Still need to get familiar with the mail2 module and could be completely wrong with the following:
Amavis-new was a dependency and configured in mail-common; In mail2 this largely shifted to the mail2-filter module. The mail2-server module still expects spam handling to be in place…

Installed nethserver modules:

nethserver-backup-config.noarch                       2.1.0-1.ns7                    @nethserver
nethserver-base.noarch                                3.4.1-1.ns7                    @nethserver-updates
nethserver-cgp.noarch                                 2.1.3-1.ns7                    @nethserver-base
nethserver-collectd.noarch                            3.0.7-1.ns7                    @nethserver-updates
nethserver-dc.x86_64                                  1.5.3-1.ns7                    @nethserver-updates
nethserver-diagtools.noarch                           1.0.2-1.ns7                    @nethserver
nethserver-dnsmasq.noarch                             1.6.6-1.ns7                    @nethserver
nethserver-duc.noarch                                 1.4.3-1.ns7                    @nethserver
nethserver-firewall-base.noarch                       3.4.1-1.ns7                    @nethserver-updates
nethserver-hosts.noarch                               1.2.2-1.ns7                    @nethserver
nethserver-httpd.noarch                               3.2.6-1.ns7                    @nethserver-updates
nethserver-httpd-admin.noarch                         2.3.2-1.ns7                    @nethserver-updates
nethserver-httpd-virtualhosts.noarch                  3.2.6-1.ns7                    @nethserver-updates
nethserver-lang-en.noarch                             1.2.12-1.ns7                   @nethserver-updates
nethserver-letsencrypt.noarch                         1.1.6-1.ns7                    @nethserver
nethserver-lib.noarch                                 2.2.8-1.ns7                    @nethserver-updates
nethserver-lsm.noarch                                 1.2.3-1.ns7                    @nethserver
nethserver-mail-smarthost.noarch                      1.0.1-1.ns7                    @nethserver
nethserver-mail2-common.noarch                        2.2.5-1.ns7                    @nethserver-updates
nethserver-mail2-server.noarch                        2.2.5-1.ns7                    @nethserver-updates
nethserver-mysql.noarch                               1.1.3-1.ns7                    @nethserver-base
nethserver-nethforge-release.noarch                   7-2.ns7                        @nethserver
nethserver-ntp.noarch                                 1.1.3-1.ns7                    @nethserver
nethserver-openssh.noarch                             1.2.2-1.ns7                    @nethserver
nethserver-phonehome.noarch                           1.3.0-1.ns7                    @nethserver
nethserver-php.noarch                                 1.2.0-1.ns7                    @nethserver
nethserver-release.noarch                             7-8.ns7                        @nethserver
nethserver-roundcubemail.noarch                       1.2.9-1.ns7                    @nethserver-base
nethserver-samba.noarch                               4.1.0-1.ns7                    @nethserver-base
nethserver-smartd.noarch                              1.1.0-1.ns7                    @nethserver
nethserver-sssd.noarch                                1.4.0-1.ns7                    @nethserver-updates
nethserver-subscription.noarch                        3.1.0-1.ns7                    @nethserver
nethserver-vsftpd.noarch                              1.1.0-1.ns7                    @nethserver-base
nethserver-yum.noarch                                 1.4.1-1.ns7                    @nethserver

Rspamd does not run if antivirus is disabled
(Stéphane de Labrusse) #2

This is done by /etc/e-smith/templates//var/lib/nethserver/sieve-scripts/before.sieve/10junkmail a sieve filter is set.


(Mark Verlinde) #3

Thanks, will look in to this, as said

:grinning:


(Stéphane de Labrusse) #4

maybe you directed me to an issue, thank anyway :slight_smile:


(Stéphane de Labrusse) #5

issue confirmed :slight_smile: a bug report is needed


(Stéphane de Labrusse) #6

(Stéphane de Labrusse) #7

please, would you mind to verify the issue in github


(Mark Verlinde) #8

Done, see comment on in nethserver-dev


(Stéphane de Labrusse) #9

good found :slight_smile:


(Stéphane de Labrusse) #10

please could you test again the sieve script epansion with the nethserver-mail2-filter installation

signal-event nethserver-mail2-filter-update could do the trick also


(Mark Verlinde) #11

Tomorrow i do some real tests: on fresh install it looks good!

 yum install --enablerepo=nethserver-testing nethserver-mail2-server

cat /var/lib/nethserver/sieve-scripts/before.sieve
# ================= DO NOT MODIFY THIS FILE =================
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at NethServer official site: https://www.nethserver.org
#
#

#
# 10junkmail
#

# -- enabled (move marked SPAM messages into junkmail folder)
require ["fileinto", "mailbox"];
if header :contains "X-Spam-Flag" "YES" {
    fileinto :create "Junk";
    stop;
}


 yum install --enablerepo=nethserver-testing nethserver-mail2-filter

  cat /var/lib/nethserver/sieve-scripts/before.sieve
# ================= DO NOT MODIFY THIS FILE =================
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at NethServer official site: https://www.nethserver.org
#
#

#
# 10junkmail
#

# -- enabled (move marked SPAM messages into junkmail folder)
require ["fileinto", "mailbox"];
if header :contains "X-Spam-Flag" "YES" {
fileinto :create "Junk";
stop;
}

# -- enabled (move spam subject to junkmail folder)
if header :contains "subject" "***SPAM***" {
   fileinto :create "Junk";
   stop;
}

(Mark Verlinde) #12

For the error if you install the filter package without server package;

this is what i meant / came up with:

Still need to test, for discussion if it would be acceptable.

cc @davidep


(Stéphane de Labrusse) #13

error in log messages is never acceptable :), I shared with @davidep, the easier solution should be to move the template to nethserver-mail2-common, it is a require of nethserver-mail2-filter


(Mark Verlinde) #14

Oke, should I close the PR ?


(Stéphane de Labrusse) #15

don’t know your solution is/should be workable, at least it is easier that to move the template…but it is a workaround, it does not solve the fact we call a template file not present in the rpm

@davidep ?


(Stéphane de Labrusse) #16

OT but it is good to see you on the deck :smiley:


(Davide Principi) #17

The solve the template conflict we could

  1. define an empty template for before.sieve in mail-common (just a comment-only fragment explaining why is it there)
  2. expand it in mail-filter and mail-server where needed

The real template is bound to mail-server, because sieve filters live with dovecot


(Mark Verlinde) #18

oke will close the PR and make a new one as you sugested

should this comment be visible after expansion or just a comment in the code it self? ie
(a)

{
  # return an empty sieve-script if no local mail-server is installed
}

(b)

# 99 end of sieve-scripts

(Stéphane de Labrusse) #19

an empty template can be with only this

#
# this is an empty template
#