Webtop Mail - Help with how to delete mail older than a specific date

Hello @support_team , @webtop_team , @lucag

I have updated my Nethserver to the latest version 7.9.2009 and my Webtop is also at the latest version.

Our email server has been running for over 5 years now and is growing. I’ve been asked if Webtop has a way to filter emails by date and delete emails older than the specific date. I’ve looked at Filter and I don’t see where I can create the filter we need. I see in the filter I need to specify using Subject, To, CC, Size, Header, etc. and there is an option to discard the message. I’m not sure if discard means delete. But What I would like to do is perhaps filter by folder to delete emails with a condition of before a date I choose. I realize in my example I would need to continually update the filter to change the date to keep cleaning but that’s ok with me.

Is this possible to do in Webtop? Or is there another way I can bulk delete emails older than a date I specify?

Thank you.

Hi @greavette

You can use ANY mail tool you choose, as Webtop id basically just another IMAP client, where mail is concerned.

I use Thunderbird for my clients, and store the mails in an offline format (A File).
Thunderbird allows filtering until a specific date.

Thunderbird removes the mail from the productive system and moves them into “files” (or delete them straight off).
WebTop re-reads the mail-spool.


Thunderbird needs only IMAP connection, and can provide a local file (If not, can delete them).
Mails are then moved / deleted.

I split mails up by user, and then by year archived.
(In and outgoing)

My 2 cents

1 Like

Hello @Andy_Wismer ,

I really appreciate your input into my question! I had been looking at a WebTop solution only and didn’t think about Thunderbird. I would prefer there was a solution built into WebTop so my users could manage their own folders to the dates they need, but I can install Thunderbird on my server and help manage the cleanup using Thunderbird.

Couple more Questions for you about your comment regarding offline and deleting:

  1. You mention that you use Thunderbird to store mail in an offline format. I’m assuming this is like an offline archive of sorts to remove mail from Nethserver and yet still have access to this older mail in case someone needed it but only from Thunderbird. Is this correct?

  2. Is this a manual process you do or does Thunderbird “offline” mail for you automatically or on a schedule?

  3. You mention you split mail by users and then by year. How do you see all users mail? In WebTop I use sharing to be able to view other mail when necessary. Do you use a sharing in Thunderbird or do you connect to each mail account in Thunderbird to view all mail?

Thank you in advance for any direction you can provide me.

1 Like

Hi @greavette

Thunderbird has a built in mailbox format. As this is all open siurce, it can never be closed.
I use Thunderbird as “holder” for these mail archives. These can be further split up as needed, Thunderbidr itself just defines where the Archive will reside. I put this on a Network drive. No worries this way of backing up PC based data.

I use this process once yearly, then for all users / accounts. Annual Cleanup and Archival, you might call this.

I connect Thunderbird individually to each Account, do the process, then disconnect, and the next account/user. This is a major advantage of IMAP, which both Nethserver and Webtop uses, so why not an Administrative Thunderbird for processes not better handled (yet?) in WebTop or whereever. Thunderbird is really versatile.

As Thunderbirds free and available for all platforms, any user who might need it can install it when needed, and reference the Archive file. You as admin could provide the personal archive of this user if needed.
Thunderbird works together with Outlook and other Mail Programs side by side. Windows require you define one as “master mail App”, but others can co-exist. Same goes for Mac and Linux desktops.

Another Option would be a second VM or Container, running an independant mail system
just for archival purposes. Citadel would be a good, WebTop like All-In-One, uses VERY little resources, and would be ideal, eg together with IMAPsync on NethServer as a “formal” Mail Archive / Hotspare.
A simple DNS switch and IP routing from Firewall, and the second, completly independant from NethServer could go live (Until Neth is fixed or whatever.).
Citadel is unlike most UNIX/Linux Apps, that it has all in a binary basically.

→ Citadel can do LDAP or AD, but as a Backup I prefer something completly independant!

I hope these answer most of your questions.

PM me, if you need more advice.

My 2 cents


Have a look at emClient…

Clients suggested that to me, and several are using this…

Killer Featrure for you:


1 Like

You are root … :wink:
You can write some script that use doveadm.
As in man page:

doveadm expunge -u jane.doe@example.org mailbox Spam savedbefore 2w

I use something like this to archive mail older than N days:

echo "_____________________"
echo "Archivia posta >150 gg"
echo "_____________________"

export Dir="/home/Users/"
export DataOperaz=`date --date "now - 150 days" +%Y-%m-%d`
export DataNomeFold=`date --date "now - 150 days" +%Y-%m`

for i in `grep -v "#" /etc/APF/Expire-Move_mail_USER_LIST-150` ; do

    echo $Dir$i/STORICO/$DataNomeFold

    if [ ! -d $Dir$i/STORICO ]; then
        mkdir $Dir$i/STORICO && chmod 770 $Dir$i/STORICO && chown $i:users $Dir$i/STORICO
         >> $Dir$i/STORICO/$DataNomeFold && chmod 660 $Dir$i/STORICO/$DataNomeFold && chown $i:users $Dir$i/STORICO/$DataNomeFold

        if [ -f $Dir$i/.subscriptions ]; then
            export subscr=`grep "STORICO/$DataNomeFold" $Dir$i/.subscriptions |wc -l`
            if [ $subscr = "0" ]; then
                echo "STORICO/$DataNomeFold" >> $Dir$i/.subscriptions
    doveadm  search -u $i mailbox INBOX BEFORE $DataOperaz |wc -l
    doveadm -v move -u $i $Dir$i/STORICO/$DataNomeFold mailbox INBOX BEFORE $DataOperaz