Obsolete Releases > SME 8.x Contribs

a bash routine for deleting email placed in the trash folder of all users

<< < (2/4) > >>

mmccarn:
I found this note here in the contribs forum:
http://forums.contribs.org/index.php/topic,47275.msg233222.html#msg233222

And some notes about adding plugins to dovecot to delete expired messages, but only starting with dovecot v1.1 (or 1.2):
http://wiki1.dovecot.org/Plugins/Expire

And several mentions of 'doveadm' (from dovecot v2.x):
http://wiki2.dovecot.org/Tools/Doveadm/Expunge

dovecot --version returns 1.0.7 on my SME 8 server

janet:
larieu


--- Quote ---On mobile phones (Android/iPhone/RIM(BB) ) I wasn't able to find a purge option
--- End quote ---

On iPhone there is an option of how long to keep mail in folders after deleted.
It's in the setup for each mail account (IMAP) in my case.
Settings, Mail, select account, Advanced, Deleted Messages Remove (or similar), choose Never, One day, One week, One month, 
Remember to save when exiting (select Done I think).

This may vary slightly depending on iPhone model
I expect other phones have a similar feature

In other workstation type email clients I usually select the option to Purge when leaving IMAP folders.

purvis:
There are not a lot of emails messages or users on our system for me to really figure what is happening to the email system.
We create a trash folder for emails that are deleted to be sent to when they are deleted while using the webmail web pages access.
Mostly on windows desktops, we use a email notifier that uses pop3 protocol. So our emails are deleted from the system immediate using that email notifier.
While looking over the emails that where in the trash folders, I noticed in the file name of those emails a "P" after the first period in the file name. The first character in the file name was
as "1" and in my testing, it will be a "1" for many many years to come from what I have been able recognize.

If the "P" character in the file name after the first period stands for purged(deleted) and I do not know that for sure, but assuming it is.
You should be able to modify the line where the find command is and possibly use the +mtime option to find files where the creation date is x number of days old.
Then you could make use of script to keep those deleted files to a manageable number and then have those mobile users make to change for any days less.

larieu:
mary

I have tried that
but from my knowledge if the default setting of "show only last 30 days" is overpassed the phone will not take into account older emails

And this is a "user side" setting (not all users will do it, and definitely users which don't care will take no action)

looking again in what mmcarn posted  I have seen a parallel discussion in SME 7 forum

http://forums.contribs.org/index.php/topic,47275.0.html

where someone pointed that files are marked with an T at the end (which is true)
I've seen this also but I found not trusted info on dovecot site

If this is true the deleting script should be like this


--- Code: ---find /home/e-smith/files/users/*/Maildir/ -type f -name "*T" -mtime +10 -delete
--- End code ---

purvis:
Code for a bash file


--- Code: ---find  /home/e-smith/files/users/*/Maildir/ -name "1*.*.$HOSTNAME:2*T" -type f -mtime +30 -delete

--- End code ---

http://cr.yp.to/proto/maildir.html

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version