Enhancement #2290

Non-spam messages in SpamFolder are retained indefinitely

Added by Davide Principi almost 8 years ago. Updated over 7 years ago.

Status:CLOSEDStart date:10/24/2013
Priority:NormalDue date:10/25/2013
Assignee:-% Done:

100%

Category:nethserver-mail-server
Target version:v6.5-beta3
Resolution: NEEDINFO:No

Description

/etc/cron.daily/nethserver-mail-spam-expunge cronjob deletes messages older than SpamRetentionTime and marked as spam from the INBOX or the junkmail folder.

This rule does not match messages moved manually to SpamFolder to train the Bayes filter.

Expected behaviour is to expunge any message in SpamFolder older than SpamRetentionTime, assuming everything in SpamFolder is spam.

Associated revisions

Revision 2f00e389
Added by Davide Principi almost 8 years ago

Expunge SPAM messages older than the retention time period. Refs #2290

If SpamFolder is not defined, only old messages with X-Spam-Flag: YES
header are expunged from the INBOX folder. Otherwise any message
older than the retention time period is expunged from the given
SpamFolder.

Revision ac8ae1b7
Added by Giacomo Sanchietti over 7 years ago

squidclamav.conf template: redirect output to c-icap. Refs #2290

History

#1 Updated by Davide Principi almost 8 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

#2 Updated by Davide Principi almost 8 years ago

  • Due date set to 10/25/2013
  • Assignee set to Davide Principi
  • Start date set to 10/24/2013

#3 Updated by Davide Principi almost 8 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#4 Updated by Davide Principi almost 8 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Test environment

  • System date must be present (>=2013-10-25)
  • Install @nethserver-mail group
  • Create a test user account user01, first name First, last name User
  • Create a test mail domain vboxnet0.tld
  • Extract amavis mail sample spam mail messages:
        # cd /root
        # perl -pe 's/./chr(ord($&)^255)/sge' </usr/share/doc/amavisd-new-2.8.0/test-messages/sample.tar.gz.compl | zcat | tar xvf -
    

Test case 1

  • Inject samples into user01 mailbox. Note that this command bypasses amavis checks and executes spamassassin as a pipe filter:
        # for F in sample-*.txt; do cat $F  | spamassassin | sendmail -i user01 ; done
    
  • Check that two INBOX messages have [SPAM] substring in subject field:
        # doveadm search -u user01 mailbox INBOX subject [SPAM] | wc -l
    2
    
  • Execute the cronjob manually:
        # /etc/cron.daily/nethserver-mail-spam-expunge
    
  • Count again. Must be 0:
        # doveadm search -u user01 mailbox INBOX subject [SPAM] | wc -l
    0
    
Test case 2
  • In Mail UI module, Mailbox tab, enable Move to "junkmail" folder checkbox, then save.
  • Inject samples into user01 mailbox:
        # for F in sample-*.txt; do cat $F  | spamassassin | sendmail -i user01 ; done
    
  • Check that two messages in junkmail folder have [SPAM] substring in subject field:
        # doveadm search -u user01 mailbox junkmail subject [SPAM] | wc -l
    2
    
  • Move all messages containing "amavisd" in subject into junkmail. There should be two messages with present date, and one very old message of such type:
        # doveadm move -u user01 junkmail SUBJECT amavisd MAILBOX INBOX
        # doveadm fetch -u user01 "date.sent" mailbox junkmail not deleted
    date.sent: 2003-07-23 21:30:00 (+0200)
    date.sent: 2003-07-23 21:30:00 (+0200)
    date.sent: 2004-04-14 18:36:33 (+0200)
    date.sent: 2013-10-25 15:23:36 (+0000)
    date.sent: 2013-10-25 15:23:40 (+0000)
    
  • Execute the cronjob manually:
        # /etc/cron.daily/nethserver-mail-spam-expunge
    
  • Count again. Old messages must have been expunged:
        # doveadm fetch -u user01 "date.sent" mailbox junkmail not deleted
    date.sent: 2013-10-25 15:23:36 (+0000)
    date.sent: 2013-10-25 15:23:40 (+0000)
    

#5 Updated by Davide Principi almost 8 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-mail-server-1.4.6-1.0git2f00e389.ns6.noarch.rpm

#6 Updated by Giacomo Sanchietti over 7 years ago

  • Assignee set to Giacomo Sanchietti

#7 Updated by Giacomo Sanchietti over 7 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

Test case 1:

[root@test ~]#  doveadm search -u user1 mailbox INBOX subject [SPAM] | wc -l
2
[root@test ~]# /etc/cron.daily/nethserver-mail-spam-expunge
[root@test ~]#  doveadm search -u user1 mailbox INBOX subject [SPAM] | wc -l
0

Test case 2:

[root@test ~]# doveadm fetch -u user1 "date.sent" mailbox junkmail not deleted
date.sent: 2013-12-10 14:43:04 (+0000)
date.sent: 2013-12-10 14:43:06 (+0000)

[root@test ~]# doveadm search -u user1 mailbox junkmail subject [SPAM] | wc -l
0

Marking as VERIFIED.

#8 Updated by Davide Principi over 7 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

In nethserver-updates:
nethserver-samba-1.4.0-1.ns6.noarch.rpm
nethserver-directory-1.3.0-1.ns6.noarch.rpm
nethserver-dnsmasq-1.1.0-1.ns6.noarch.rpm
nethserver-shorewall-1.0.3-1.ns6.noarch.rpm
nethserver-mail-server-1.5.0-1.ns6.noarch.rpm
nethserver-mail-filter-1.1.4-1.ns6.noarch.rpm
nethserver-nethgui-1.3.0-1.ns6.noarch.rpm
nethserver-base-1.5.0-1.ns6.noarch.rpm
nethserver-lib-1.4.0-1.ns6.noarch.rpm
nethserver-httpd-admin-1.1.0-1.ns6.noarch.rpm
nethserver-yum-1.2.0-1.ns6.noarch.rpm
nethserver-ntopng-1.1.0-1.ns6.noarch.rpm

Also available in: Atom PDF