MAN page from PLD archivemail-0.6.1-3.noarch.rpm
ARCHIVEMAIL
Section: (1)
Updated: 03 October 2002
Index NAME
archivemail - archive and compress your old email
SYNOPSIS
archivemail [ options] MAILBOX ...
DESCRIPTION
archivemail is a tool written in python(1) for archiving andcompressing old email in mailboxes.
By default it will read the mailbox MAILBOX, moving messagesthat are older that the specified number of days (180 by default) to ambox-format mailbox in the same directory that is compressedwith gzip(1).
archivemail supports reading IMAP,Maildir, MH and mbox-formatmailboxes, but it will always write archive files to mbox-formatmailboxes that are compressed with gzip(1).
archivemail has some support for being run as the root user onuser mailboxes. When running as root, it will seteuid(2) to the owner of themailbox it is reading, creating any archive files as that user.
OPTIONS
- -d NUM, --days=NUM
- Archive messages older than NUM days. The default is 180. This option is incompatible with the--date option below.
- -D DATE, --date=DATE
- Archive messages older than DATE.DATE can be a date string in ISO format (eg '2002-04-23'), Internet format (eg '23 Apr 2002') or Internet format with full month names (eg '23 April 2002'). Two-digit years are not supported.This option is incompatible with the --days option above.
- -o PATH, --output-dir=PATH
- Use the directory name PATH to store themailbox archives. The default is the same directory as the mailbox to beread.
- -s NAME, --suffix=NAME
- Use the suffix NAME to create the filename used for archives. The default is _archive. For example, if yourun archivemail on a mailbox calledexsouthrock, the archive will be createdwith the filename exsouthrock_archive.gz.
NAME is run through the python(1) time.strftime()function, which means that you can specify any of the following specialdirectives in NAME to make archives named after the currentdate:
- •
- %a Locale's abbreviated weekday name.
- •
- %A Locale's full weekday name.
- •
- %b Locale's abbreviated month name.
- •
- %B Locale's full month name.
- •
- %c Locale's appropriate date and time representation.
- •
- %d Day of the month as a decimal number [01,31].
- •
- %H Hour (24-hour clock) as a decimal number [00,23].
- •
- %I Hour (12-hour clock) as a decimal number [01,12].
- •
- %j Day of the year as a decimal number [001,366].
- •
- %m Month as a decimal number [01,12].
- •
- %M Minute as a decimal number [00,59].
- •
- %p Locale's equivalent of either AM or PM.
- •
- %S Second as a decimal number [00,61]. (1)
- •
- %U Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.
- •
- %w Weekday as a decimal number [0(Sunday),6].
- •
- %W Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.
- •
- %x Locale's appropriate date representation.
- •
- %X Locale's appropriate time representation.
- •
- %y Year without century as a decimal number [00,99].
- •
- %Y Year with century as a decimal number.
- •
- %Z Time zone name (or by no characters if no time zone exists).
- •
- %% A literal "%" character.
- -S NUM, --size=NUM
- Only archive messages that are NUM bytes orgreater.
- -n, --dry-run
- Don't write to any files -- just show what would have been done. This isuseful for testing to see how many messages would have been archived.
- -u, --preserve-unread
- Do not archive any messages that have not yet been read. archivemaildetermines if a message in a mbox-format orMH-format mailbox has been read by looking at theStatus header (if it exists). If the statusheader is equal to 'RO' or 'OR' then archivemail assumes themessage has been read. archivemail determines if amaildir message hasbeen read by looking at the filename. If the filename contains an 'S' after :2, then it assumes the message has been read.
- --delete
- Delete rather than archive old mail. Use this option with caution!
- --include-flagged
- Normally messages that are flagged important are not archived or deleted. Ifyou specify this option, these messages can be archived or deleted just likeany other message.
- --no-compress
- Do not compress any archives using gzip(1).
- --warn-duplicate
- Warn about duplicate Message-IDs that appear in the inputmailbox.
- -v, --verbose
- Reports lots of extra debugging information about what is going on.
- -q, --quiet
- Turns on quiet mode. Do not print any statistics about how many messages werearchived. This should be used if you are running archivemail fromcron.
- -V, --version
- Display the version of archivemail and exit.
- -h, --help
- Display brief summary information about how to run archivemail.
NOTES
archivemail requires python(1) version 2.0 or later.
To archive an IMAP-format mailbox, use the the formatimap://username:password@server/mailbox to specify themailbox.
When reading an mbox-format mailbox, archivemail willcreate a lockfile with the extension .lock so thatprocmail will not deliver to the mailbox while it is being processed. It willalso create an advisory lock on the mailbox using flock(2).archivemail will also complain and abort if a 3rd-party modifies themailbox while it is being read.
archivemail will always attempt to preserve the mode,last-access and last-modify times of the input mailbox. However, archivemailboxes are always created with a mode of 0600.
If archivemail finds a pre-existing archive mailbox itwill append rather than overwrite that archive.
archivemail attempts to find the delivery date of a message bylooking for valid dates in the following headers, in order of precedence: Delivery-date,Date andResent-Date.If it cannot find any valid date in these headers, itwill use the last-modified file timestamp on MH andMaildir format mailboxes, or the date on the From line on mbox-format mailboxes.
archivemail will refuse to operate on mailboxes that are symbolic links or create tempfiles or archives in world-writable directories.
EXAMPLES
To archive all messages in the mailbox debian-user thatare older than 180 days to a compressed mailbox calleddebian-user_archive.gz in the current directory:
bash$ archivemail debian-user
To archive all messages in the mailbox debian-user thatare older than 180 days to a compressed mailbox calleddebian-user_April_2002.gz (where the current month andyear is April, 2002) in the current directory:
bash$ archivemail --suffix '_%B_%Y' debian-user
To archive all messages in the mailbox cm-melb thatare older than the first of January 2002 to a compressed mailbox calledcm-melb_archive.gz in the current directory:
bash$ archivemail --date'1 Jan 2002' cm-melb
Exactly the same as the above example, using an ISO date format instead:
bash$ archivemail --date=2002-01-01 cm-melb
To delete all messages in the mailbox spam thatare older than 30 days:
bash$ archivemail --delete --days=30 spam
To archive all read messages in the mailbox incoming thatare older than 180 days to a compressed mailbox calledincoming_archive.gz in the current directory:
bash$ archivemail --preserve-unread incoming
To archive all messages in the mailbox received thatare older than 180 days to an uncompressed mailbox called received_archive in the current directory:
bash$ archivemail --no-compress received
To archive all mailboxes in the directory $HOME/Mail that are older than 90 days to compressed mailboxes in the$HOME/Mail/Archive directory:
bash$ archivemail -d90 -o $HOME/Mail/Archive $HOME/Mail/*
TIPS
Probably the best way to run archivemail is from your crontab(5)file, using the --quiet option.
Don't forget to try the --dry-run option for non-destructivetesting.
EXIT STATUS
Normally the exit status is 0. Nonzero indicates an unexpected error.
BUGS
There is no support yet for reading MMDF orBabyl-format mailboxes. In fact, archivemail willprobably think it is reading an mbox-format mailbox and causeall sorts of problems.
archivemail is still too slow, but if you are running from crontab(5)you won't care. Archiving maildir-format mailboxes should bea lot quicker than mbox-format mailboxes since it is lesspainful for the original mailbox to be reconstructed after selective message removal.
SEE ALSO
python(1), gzip(1), mutt(1), procmail(1)
URL
The archivemail home page is currently hosted at sourceforge <URL:http://archivemail.sourceforge.net>
AUTHOR
Paul Rodger <paul at paulrodger dot com>
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- OPTIONS
- NOTES
- EXAMPLES
- TIPS
- EXIT STATUS
- BUGS
- SEE ALSO
- URL
- AUTHOR
This document was created byman2html,using the manual pages.