Re: command line deletion of files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/29/2016 11:27 AM, Shawn Bakhtiar via Info-cyrus wrote:
Good morning,

trying to get rid of some emails that have large attachments (i.e. videos sent over email, or cd images, etc...)

Would it be proper to

rm -rf /var/spool/imap/u/username/mailbox/4321.

then

reconstruct -rf user.username

Or is there a more "proper" way using cyrus?

Not sure about deleting a single message but you can use ipurge to delete messages based on size. Good to use in a script to parses the mail spool.





IPURGE(8) IPURGE(8)

 *

NAME
ipurge - delete mail from IMAP mailbox or partition based on age or size

SYNOPSIS
       ipurge [ -f ] [ -C config-file ] [ -x ] [ -X ] [ -i ] [ -s ] [ -o ]
              [ -d days | -b bytes | -k Kbytes | -m Mbytes ]
              [ mailbox-pattern...  ]

DESCRIPTION
Ipurge deletes messages from the mailbox(es) specified by mailbox-pattern that are older or larger than specified by the -d, -b, -k or -m options. If no mailbox-pattern is given, ipurge works on all mailboxes. If the -x option is given, the message age and size MUST match exactly those specified by -d, -b, -k or -m. The are no default
       values, and at least one of -d, -b, -k or -m MUST be specified.

Ipurge by default only deletes mail below shared folders, which means that mails in mailbox(es) below INBOX.* and user.* stay untouched. Use the option -f to also delete
       mail in mailbox(es) below these folders.

Ipurge reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

OPTIONS
       -f     Force deletion of mail in all mailboxes.

       -C config-file
              Read configuration options from config-file.

       -d days
              Age of message in days.

       -b bytes
              Size of message in bytes.

       -k Kbytes
              Size of message in Kbytes (2^10 bytes).

       -m Mbytes
              Size of message in Mbytes (2^20 bytes).

-x Perform an exact match on age or size (instead of older or larger).

       -X     Use delivery time instead of Date: header for date matches

-i Invert match logic: -x means not equal, date is for newer, size is for smaller

       -s     Skip over messages that have the \Flagged flag set.

       -o     Only purge messages that have the \Deleted flag set.







Thanks,
Shawn

----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


begin:vcard
fn:Patrick Boutilier
n:Boutilier;Patrick
org:;Nova Scotia Department of Education
adr:;;2021 Brunswick Street;Halifax;NS;B3K 2Y5;Canada
email;internet:boutilpj@xxxxxxxxxxx
title:WAN Communications Specialist
tel;work:902-424-6800
tel;fax:902-424-0874
version:2.1
end:vcard

----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux