forked from git://archivemail.git.sourceforge.net/gitroot/archivemail/archivemail

This commit is contained in:
Michael Krayer 2020-05-22 09:47:41 +02:00
commit 62dc691279
18 changed files with 5828 additions and 0 deletions

333
CHANGELOG Normal file
View File

@ -0,0 +1,333 @@
version 0.9.0 - 9 July 2011
* Fixed manpage installation path to be FHS compliant
* Speed up IMAP archiving with the --quiet option
* Ported the manpage from SGML to XML
* Fix test suite failures with Python 2.7. Closes: #3314293.
* IMAP: support international mailbox names containing non-ASCII characters.
* IMAP: handle broken servers sending no untagged SEARCH response.
Closes: #879716, #3213272.
* IMAP: support servers listening on non-standard ports. Closes: #3168416.
version 0.8.2 - 16 October 2010
* IMAP: don't prepend NAMESPACE prefix to INBOX and its children.
Closes: #3083236.
version 0.8.1 - 30 September 2010
* IMAP: fixed handling of LIST replies by the server where the mailbox name
is not a quoted string. (Thanks Karsten Müller)
Version 0.8.0 - 9 August 2010
* Fixed date header parsing to be precise with timezone information. Also,
when writing From_ line timestamps, don't use UTC but local time, without
timezone information.
* To determine the delivery date of a message, archivemail now looks for the
timestamp of the latest 'Received' header before resorting to
'Resent-Date' or 'Date'. This should give much better results when there
is no 'Delivery-date' header, which is still checked first.
(Thanks Andrew Ferrier & Christian Brabandt)
Closes: #1481316, #1764855, Debian bug #272666.
* If present, the 'Resent-date' header now takes precedence over 'Date'.
* IMAP: recognize when a server advertises LOGINDISABLED.
* New option --debug-imap; this just sets imaplib.Debug, thereby dumping
archivemail's chat with the server to stdout.
* Fixed crash with Python 2.5 when archiving an empty maildir.
(Thanks "Aidant") Closes: #1878940.
* New option --all to archive all messages in a mailbox. Closes: #1764846.
* Fixed a crash when archiving maildirs with --days=0. (Thanks John Goerzen)
* IMAP: automatically add NAMESPACE prefix to a mailbox path if necessary.
* Removed the feature to setuid to the mailbox owners when run as root.
This was a bad idea; it's really hard to do safely, if at all possible.
Obsoletes: patch #2783134.
* Replaced some simple minded file operation security checks with more
decent ones. This means we can safely operate in /tmp, for example. The
price is that we no longer accept symlinked files. Obsoletes: patch
#1874868.
* Don't use rename() to update mbox files and the archive, but write the
files directly. This is more fragile, but required for correct mbox
locking, and also for mboxes in mail spool directories where we don't have
permission to create files. It also means that if selinux is enabled,
archivemail now preserves the selinux security context of an mbox.
Closes: #2210732.
* Fixed the test suite to deal with nanosecond file timestamps. These are
provided by ext4 and XFS, for example. Closes: #2043900.
* Cleaned up the test suite, replacing a lot of duplicated code and avoiding
a lot of redundand testing. This speeds up the test suite by a factor of
15 or so.
* mbox locking got completely rewritten. Switched from flock to lockf
locking, which is NFS-safe and portable, and we now lock with lockf first,
then with a dotlock, instead of the other way around. (This is makes
archivemail compatible with Debian systems. ;)
* We now omit the dotlock if we don't have sufficient permissions to create
it in the mbox directory. (The file is still locked with lockf.)
Since we also no longer use rename() to commit changes to an mbox, (see
above) this means archivemail can now operate on mbox files in the system
mail spool. Closes: #855269.
* Refactoring of the mbox classes; much of the code got rewritten.
* The archive now also gets locked while archivemail updates it.
* Various Python language fixes (for example don't use "0" and "1" as
boolean constants).
* Added a lot of test cases for maildir archiving to the test suite.
Maildir testing should now be roughly on par with mbox testing.
* IMAP servers (Dovecot and UW-IMAP at least) may store mailbox meta data
for mboxes in a pseudo message. Such messages are now detected and never
archived. Obsoletes: patch #2210707. (Thanks, "tlhackque")
* New option --prefix, or short -p, to specify an archive name prefix. Like
a suffix specified with the --suffix option, the prefix is expanded with
strftime(). Specifying this option disables the default archive name
suffix. Obsoletes: feature request #604281. (Thanks Serafeim Zanikolas
for an initial patch)
* When archiving a mailbox with a leading dot in the name and with no archive
name prefix specified, archivemail no longer creates hidden archives, but
strips the dot off the archive name. In particular, this makes working
with Maildir++ subfolders more convenient. Closes: feature request
#604281.
* New option --archive-name, or short -a, to hard-code an archive filename.
Like the --suffix and --prefix options, it is expanded with strftime().
This option conflicts with archiving multiple mailboxes. Closes: feature
request #1306538.
* archivemail now expands wildcards in IMAP mailbox names. For example, the
url imaps://user@server/foo/* will expand to all subfolders of foo.
Closes: feature request #1978540. Obsoletes: patch #1918937.
Version 0.7.2 - 9 November 2007
* IMAP: fixed crash by working around python bug #1277098, which is still pending
in python << 2.5.
Version 0.7.1 - 7 November 2007
* Fixed incompatibility with Python 2.5 which broke Maildir handling.
Closes: #1670422
* Username and password in IMAP URLs can now be double-quoted, so it should be
no longer a problem if they contain delimiters like the '@' character.
Closes: #1640878
* Invalid messages/files in Maildirs caused archivemail to silently stop
processing mails and claim it's all done. Now skip these and go ahead.
(Thanks Elan Ruusamäe for tracking this down.) Closes: #1783369.
(The Debian package has a different fix for this problem since 0.6.1-4,
closing Debian bugs #255944 and #305902.)
* Fixed IMAP message flag conversion which was completely broken. (Thanks
Christian Brabandt) Closes: Debian bug #434807
* New option --copy: archive mail, but don't delete it from the mailbox.
This is mainly useful for testing purposes, and complements --delete.
Closes: #981865, #988803, #1764851, Debian bug #434798
* If running as root, only switch the effective uid and gid back if we have
actually switched them before. Closes: #1762907
* The automatic seteuid feature of archivemail is insecure and thus
deprecated; it will be removed from later versions.
* Expand tilde in argument of long option --pwfile. (Thanks Christian
Brabandt) Closes: Debian bug #434813
* archivemail now accepts --days=0
* Fixed crash if --warn-duplicate is used with IMAP (Thanks Christian
Brabandt) Closes: Debian bug #434786 (the Debian package already has a fix)
* When converting from other formats to mbox, archivemail used to preserve
existing 'Status' and 'X-Status' mbox headers; these are now silently
overwritten to ensure they have correct values.
* IMAP: if selecting the mailbox fails, archivemail detects the server's
mailbox hierarchy delimiter, replaces slashes in the mailbox name with the
delimiter and tries again. Closes: #1826757, Debian bug #368112
Version 0.7.0 - 2 November 2006
* Fixed long options --filter-append and --pwfile to accept their arguments.
Closes: #1555935
* Fixed From_ line generation to actually look for the 'Return-path' and
'From' headers. Closes: #1555797
* Fixed IMAP authentication/URL parsing, which wasn't working at all in
v0.6.2. Require username encoded in URL, but be flexible with the password:
handle both --pwfile and URL-encoded password, and fallback to querying the
user if neither is present. Closes: #1555951
* Convert on-the-wire CRLF to native EOL when saving messages from an IMAP
folder. Closes: #1555803
* Updated man page. This also addresses #1555951
* Fixed unittest failure by updating --suffix testcase. Based on analysis by
Peter Poeml. Thanks, Peter.
* Fixed invalid IMAP filter string for large messages (--size option).
(Thanks to the anonymous bug reporter) Closes: #863813
* Fixed IMAP --dry-run so it doesn't download all messages that would be
archived.
* Fixed IMAP --delete which didn't work at all. (Thanks Anand)
Closes: Debian bug #203282
* Terminate each message in newly written mbox with an empty line if the
message source is not an mbox-format folder. (Thanks Chung-chieh Shan)
Closes: Debian bug #250410
* Mangle From_ in message body if the message source is not an mbox-format
folder. (Thanks Chung-chieh Shan) Closes: Debian bug #250402
* Added new option --dont-mangle to turn off From_ mangling.
* Bumped Python dependency to version 2.3.
* Fixed unittest TestMboxExclusiveLock which failed on Solaris. (Thanks Paul
Rodger) Closes: #904652
* Fixed unsafe creation of temporary files in the test suite.
This addresses Debian bug #385253, and reading the BTS log, it seems this
issue was assigned CVE-2006-4245, although I cannot find any further
reference to that CVE. Note that the bug was initially reported to affect
archivemail itself, too. This is not correct. (Thanks Joey Hess)
Closes: Debian bug #385253
* Fixed cleanup of temporary files after test suite failures.
* Fixed dotlocking race condition.
* Stats are now working with IMAP.
* Stats now report the total size of a mailbox and of the archived messages
therefrom.
* Always barf if the archive destination directory is world-writable.
* Distributing man page with the tarball again and fixed distutils setup.
Closes: #1574720 (Thanks Grant Goodyear)
* Improved IMAP error reporting
Version 0.6.2 - 27 June 2006
* add -F/--filter-append option to append an arbitrary string to the IMAP
filter string
* don't delete more than a certain number of messages at a time. The max
command len is limited. Fixes bug 942403 (Archiving large IMAP folders fails)
* IMAP: try CRAM-MD5 login first, if that fails fallback to plain login
* add SSL support per imaps URL (after patch by Tobias Gruetzmacher)
* add -P/--pwfile option to supply the IMAP password, so it does not end up in
the shell history
* Fix SyntaxWarning: assignment to None (bug #843890)
* Use the archive cut date rather than the actual time with the --suffix
option. (Thanks Manuel Estrada Sainz)
Version 0.6.1 - 31 October 2002
* Removed a test rule that we could archive messages older than the
Unix epoch. Newer versions of python now give an overflow error calling
mktime() on dates < 1970 instead of returning a negative number.
Version 0.6.0 - 3 October 2002
* Added IMAP mailbox support. (Thanks Mark Roach)
Version 0.5.1 - 18 September 2002
* Fixed a bug where when running archivemail as root on a non-root mailbox,
the temporary container directory would be created as root before the
seteuid() took place. (Thanks Jay Hesselberth)
Version 0.5.0 - 15 September 2002
* Fixed a bug where mailbox locking would fail under Solaris. (Thanks Mark
Sheller)
* Fixed a bug where archiving maildir mailboxes without a 'Received Date' or
'From' header would fail. (Thanks Hugo van der Merwe)
* Removed yet another bug where messages dated on the Unix epoch would fail.
Version 0.4.9 - 18 August 2002
* Fixed a bug where an exception was thrown if a message was dated exactly
on the Unix epoch.
* Fixed a bug where trailing slashes on the end of maildir/MH mailbox
arguments were being used in the archive name.
Version 0.4.8 - 20 May 2002
* Call mkdir() to create a container directory in which we can place any
created tempfiles
Version 0.4.7 - 9 May 2002
* Fixed a bug where archivemail would abort if it received a date header
with a completely blank value.
Version 0.4.6 - 6 May 2002
* Fixed a bug where the os.rename() calls could fail if we were moving
temporary files across different filesystems/partitions.
Version 0.4.5 - 29 April 2002
* Fixed a bug where if you used the '--delete' option to completely clean
an mbox mailbox you would get a python error.
* Added a lot more testing to test_archivemail.py (test_archivemail.py is
now 37% bigger than archivemail -- scary)
* Added a new '--size' option which allows you to only archive messages
over a certain size.
Version 0.4.4 - 27 April 2002
* Fixed a bug where the long --suffix option was not working (although the
short option, '-s' was).
* Added time-based format directives to the --suffix option, so that you
can do things like specify --suffix='%B%Y' to create archives named
after the current month and year
* Added some more tests to test_archivemail.py
Version 0.4.3 - 26 April 2002
* Fixed a couple of bugs where I was using python version 2.2 syntax that
was giving errors in python v2.0 and v2.1.
* Changed the python requirements for the test script from python version
2.0 to version 2.1. This is because the unittest module is only available
in version 2.1 and above.
Version 0.4.2 - 24 April 2002
* Added the ability to archive messages older than a given absolute date
with the new option '--date'.
* Fixed a bug where archivemail would complain about messages older than
1970. Yes, someone had a 'Date' header with 1967 :)
* Complain if the mailbox to be read does not look like a valid mbox-format
mailbox.
* Added a few more tests to test_archivemail.py
Version 0.4.1 - 21 April 2002
* Don't archive messages that are flagged important unless we are given the
--include-flagged option.
* Fixed a bug where when archiving messages from maildir mailboxes, we were
not preserving the status information contained in the filename suffix to
Status and X-Status mbox headers. This means we forgot if we had read or
replied to the message.
* We now complain if an mbox-format mailbox that is being read changes in
size -- this should not happen, since we have locked these files, but it
is a good sanity check.
* Changed from using the mailbox.PortableUnixMailbox class to read mbox
mailboxes to the mailbox.UnixMailbox class. This fixes bugs where unquoted
'From ' lines in the body of messages were confusing archivemail.
Version 0.4.0 - 17 April 2002
* Added an option --no-compress to make archives but not compress them with
gzip.
* Added an option --preserve-unread to not archive unread messages.
* Added a few more unittests.
Version 0.3.2 - 13 April 2002
* Added a lot more information to the manpage, including examples and
notes.
* Fixed up the README file and archivemail usage message.
* Added an example archivemail shell script that I run from crontab.
Version 0.3.1 - 12 April 2002
* Stopped calling 'gzip' externally and started using the gzip library
so that we can append to a copy of the gzip archive directly.
* Removed 'bzip2' and 'compress' options since they are increasing
complexity without adding much, and needed to be called externally.
Maybe when python gets a bzip2 library I will add back an option to
compress archives using bzip2.
* Included a man page & sgml docbook source.
Version 0.3.0 - 11 April 2002
* We now preserve the last-accessed and last-modified timestamps correctly
* We now preserve the correct permissions on the original mailbox instead
of always mode 600
* Fixed a bug where lockfiles were being created that were not
world-readable
* Made archivemail work better when used as a python module so it can
integrate better with unittest. (... although I still distribute it
without the .py extension - dodgy?)
* Bundled a unit-testing script for archivemail
* Started using a distutils 'setup.py' script for installation.
Version 0.2.1 - 4 April 2002
* Since we might not have a parse-able 'Date-Received' or 'Date' field,
use 5 different ways to guess the date of a message.
* Removed the '--use-mtime' option since it is obsolete -- we will always
use the file modification time for the message if other date-parsing
methods fail.
* Check to see if we are running as root -- if so, change our
effective userid and groupid to that of the original mailbox. This will
make sure any archives or tempfiles we write have the same ownership and
will allow the root user to do "archivemail /var/spool/mail/*"
* Fixed a bug where if you ran 'archivemail.py foo/mbox' it would create
the archive file in the current directory instead of the directory 'foo'.
Version 0.2.0 - 3 April 2002
* Added support for reading from MH mailboxes
* Refuse to proceed if we would be making tempfiles in world-writable
directories
* Clamped down with lots of assert()s checking function parameters
* Complain earlier if we do not have permission to write to the output
directory
* Use the 'Date' field of a message when constructing the 'From_' line
from a maildir/MH mailbox if there is no 'Delivery-Date' field.
Version 0.1.0 - 31 March 2002
* Initial release

341
COPYING Normal file
View File

@ -0,0 +1,341 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

15
FAQ Normal file
View File

@ -0,0 +1,15 @@
1. Why doesn't archivemail support bzip2 compression in addition to gzip?
-------------------------------------------------------------------------
The bzip2 module in Python 2.x is not fully compatible with the gzip module,
and cannot be used with the current implementation of compressed mailbox
support in archivemail. See Python feature request #5863 for details.
2. Can you add a switch to archive mailboxes greater than a certain size?
-------------------------------------------------------------------------
If you are using mbox format mailboxes instead, use the find(1) command instead, it is more flexible:
find $HOME/Mail -type f ! -name '*archive*'

11
MANIFEST.in Normal file
View File

@ -0,0 +1,11 @@
include CHANGELOG
include COPYING
include FAQ
include MANIFEST
include TODO
include NEWS
include archivemail.1
include archivemail.xml
include db2man.xsl
graft examples
include test_archivemail

43
Makefile Normal file
View File

@ -0,0 +1,43 @@
VERSION=$(shell python setup.py --version)
VERSION_TAG=v$(subst .,_,$(VERSION))
TARFILE=archivemail-$(VERSION).tar.gz
HTDOCS=htdocs-$(VERSION)
default:
@echo "no default target"
clean:
rm -rf $(HTDOCS)
test:
python test_archivemail
clobber: clean
rm -rf build dist
rm -f $(HTDOCS).tgz
sdist: clobber doc
python setup.py sdist
tag:
git tag -a $(VERSION_TAG)
doc: archivemail.1 archivemail.html
htdocs: $(HTDOCS).tgz
$(HTDOCS).tgz: index.html archivemail.html RELNOTES style.css manpage.css
install -d -m 775 $(HTDOCS)
install -m 664 $^ $(HTDOCS)
cd $(HTDOCS) && mv archivemail.html manpage.html
tar czf $(HTDOCS).tgz $(HTDOCS)
archivemail.1: archivemail.xml db2man.xsl
xsltproc db2man.xsl archivemail.xml
archivemail.html: archivemail.xml db2html.xsl
xsltproc --output archivemail.html \
db2html.xsl archivemail.xml
tidy -modify -indent -f /dev/null archivemail.html || true
.PHONY: default clean test clobber sdist tag doc htdocs

44
NEWS Normal file
View File

@ -0,0 +1,44 @@
Notable changes in archivemail 0.9.0:
* IMAP: support for international mailbox names containing non-ASCII
characters.
Notable changes in archivemail 0.8.0:
* Removed the feature to setuid to the mailbox owners when run as root.
This was a bad idea; it's really hard to do safely, if at all possible.
Obsoletes: patch #2783134.
* New option --archive-name, or short -a, to hard-code an archive filename.
Like the --suffix and --prefix options, it is expanded with strftime().
This option conflicts with archiving multiple mailboxes. Closes: feature
request #1306538.
* New option --prefix, or short -p, to specify an archive name prefix. Like
a suffix specified with the --suffix option, the prefix is expanded with
strftime(). Specifying this option disables the default archive name
suffix. Obsoletes: feature request #604281. (Thanks Serafeim Zanikolas
for an initial patch)
* New option --all to archive all messages in a mailbox. Closes: #1764846.
* archivemail now expands wildcards in IMAP mailbox names. For example, the
url imaps://user@server/foo/* will expand to all subfolders of foo.
Closes: feature request #1978540. Obsoletes: patch #1918937.
* To determine the delivery date of a message, archivemail now looks for the
timestamp of the latest 'Received' header before resorting to
'Resent-Date' or 'Date'. This should give much better results when there
is no 'Delivery-date' header, which is still checked first.
(Thanks Andrew Ferrier & Christian Brabandt)
Closes: #1481316, #1764855, Debian bug #272666.
* We now omit the dotlock if we don't have sufficient permissions to create
it in the mbox directory. (The file is still locked with lockf.)
Together with more changes under the hood (see below) this means
archivemail can now operate on mbox files in the system mail spool.
Closes: #855269.
* Replaced some simple minded file operation security checks with more
decent ones. This means we can safely operate in /tmp, for example. The
price is that we no longer accept symlinked files. Obsoletes: patch
#1874868.
* The archive now also gets locked while archivemail updates it.
* mbox locking got completely rewritten. Switched from flock to lockf
locking, which is NFS-safe and portable, and we now lock with lockf first,
then with a dotlock, instead of the other way around. (This is makes
archivemail compatible with Debian systems. ;)

63
README Normal file
View File

@ -0,0 +1,63 @@
-----------------------------------------------------------
archivemail - archive and compress old mail in your mailbox
-----------------------------------------------------------
OVERVIEW:
archivemail is a tool written in python(1) for archiving and compressing old
email in mailboxes.
It can move messages older than the specified number of days to a separate
'archive' mbox-format mailbox that is compressed with 'gzip'.
For example, have you been subscribing to the 'linux-kernel' mailing list
for the last 6 years and ended up with an 160-meg mailbox that 'mutt' is
taking a long time to load? 'archivemail' can move all messages that are
older than 6 months to a separate compressed mailbox, and leave you with
just the most recent messages.
'archivemail' can save a lot of disk space and will significantly reduce
overhead on your mail reader. The number of days before mail is considered
'old' is up to you, but the default is 180 days. You can also archive messages
by an absolute date or only archive unread messages.
REQUIREMENTS:
archivemail requires python version 2.3. It also uses some optional python
modules, but these should be pretty much standard; if you get an ImportError
nonetheless, please report it, thanks. (For contact addresses see below.)
Python is available from http://www.python.org/
INSTALLATION:
If you want to test archivemail:
python test_archivemail
To install archivemail, run:
python setup.py install
USE:
For more detailed information and examples, look at the archivemail man page.
The best way to run archivemail is from cron, giving the '-q' option to
archivemail to make it quiet, only printing messages if something went wrong.
Check out the 'examples' directory for an example shell script to be run from
cron.
The archivemail website is at: http://archivemail.sourceforge.net/
If you have any feedback or bug reports about archivemail, you are very
welcome to email the maintainers; as of November 2006, these are:
Nikolaus Schulz <microschulz@web.de>
Peter Poeml <poeml@suse.de>
-- Paul Rodger <paul at paulrodger dot com>, archivemail author
Updated by: Nikolaus Schulz, maintainer

103
TODO Normal file
View File

@ -0,0 +1,103 @@
Integrate --debug-imap option into yet-to-be-implemented -vv switch?
I had the idea to provide separate debugging info levels anyway, see --debug
below.
Gracefully close IMAP connection upon unexptected error (currently archivemail
just terminates).
LOCKING & Co:
* Block signals while writing changed mailbox back.
* Double-check the entire locking code.
Seems like existing archives are not read or validated in any way. New archive
data is blindly appended... Probably okay, but should be documented.
IMAP SEARCH BEFORE disregards time and timezone information. This should at
least be documented. E.g. I've found that '-d 0' didn't match all messages in
an IMAP mailbox. This is because the SEARCH key is (BEFORE 14-Nov-2007) on 14
November, not matching messages that arrived today. (This problem is probably
fixed for most use cases by the --all option.)
Document mbox format issues: link to
http://homepages.tesco.net/~J.deBoynePollard/FGA/mail-mbox-formats.html,
qmail mbox manpage, Debian manpage, RFC 4155. Document what mbox format we can
read, and what we write.
FIXME: we cannot yet parse rfc 2822 addr-spec stuff like quoted local-parts in
return-path addresses.
Minor annoyance: when a From_ line is generated, guess_delivery_time() reports
the used date header a second time.
Check sf.net and Debian BTS for new bugs. Again.
IMAP: ensure mailbox archives are properly named. Currently imap folder names
are mapped like this:
IMAP URL | resulting mbox_archive
------------+------------------------
test.box | test.box_archive.gz
test/box | box_archive.gz
Implement --include-draft. But before, think about it again. (This is feature
request #1569305.)
Implement a fallback if an IMAP server doesn't support SEARCH. (Ouch!)
Add IMAP tests to the testsuite (upload test messages with IMAP "APPEND
date-string"). This should be done without any real network I/O.
Try to port archivemail to email.message and the new mailboxes in Python 2.5.
Is these flexible enough for our needs?
Line out what we want with respect to multiple selection criteria.
Some make sense, but this easily gets too complex, and if only it's a hassle
with adding all the options. Hm.
Reject patch #1036022 "Added option to inverse date compare" after cooling down
because the patch is both stupid (copy+paste code) and broken. Don't see why
anyone should want this/we should support it.
If this is reasonable *at all*, I think we'd better go for all the complexity
to honour _two_ cut off dates (see Debian bug "#184124: archivemail: -D and -d
should not be incompatible", which is a comparably half-baken thought). </rant>
Add --debug or -vv switch, and move the printing of diagnostic info for each
message to --debug.
Perhaps add some more nice stuff like printing of subject, sender...
See tracker #868714 "added stats option to archivemail", which has a point.
Message-Ids are useful for diagnosis, but not very nice to read for humans.
Be a nicer citizen with respect to mailbox locking.
Perhaps prune/shorten IMAP mailbox URLs in messages?
They may be quite long and may contain the sensitive password.
Also shows up in the process list...
Perhaps find a clean, lean replacement for all that clutter in the IMAP urls.
Require --output-dir for IMAP archiving? Otherwise we just drop the archive in
in the current working directory.
Check all items below, which are from the original author. :-)
.archivemailrc support
When you get a file-not-found in the 6th mailbox of 10, it aborts the whole
run. Better to fail gracefully and keep going.
Add more tests (see top of test_archivemail)
We need some better checking to see if we are really looking at a valid
mbox-format mailbox.
Add an option to not cut threads.
Add MMDF mailbox support
Add Babyl mailbox support
Add option to archive depending on mailbox size threshold
- is this a good idea?
Add option to archive depending on number of messages
- is this a good idea?

1951
archivemail Executable file

File diff suppressed because it is too large Load Diff

794
archivemail.xml Normal file
View File

@ -0,0 +1,794 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"file:///usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd" [
<!ENTITY lockf '<citerefentry>
<refentrytitle><emphasis role="bold">lockf</emphasis></refentrytitle>
<manvolnum>2</manvolnum></citerefentry>'>
<!ENTITY gzip '<citerefentry>
<refentrytitle><emphasis role="bold">gzip</emphasis></refentrytitle>
<manvolnum>1</manvolnum></citerefentry>'>
<!ENTITY procmail '<citerefentry>
<refentrytitle><emphasis role="bold">procmail</emphasis></refentrytitle>
<manvolnum>1</manvolnum></citerefentry>'>
<!ENTITY python '<citerefentry>
<refentrytitle><emphasis role="bold">python</emphasis></refentrytitle>
<manvolnum>1</manvolnum></citerefentry>'>
<!ENTITY crontab '<citerefentry>
<refentrytitle><emphasis role="bold">crontab</emphasis></refentrytitle>
<manvolnum>5</manvolnum></citerefentry>'>
<!ENTITY mbox '<citerefentry>
<refentrytitle><emphasis role="bold"><acronym>mbox</acronym></emphasis></refentrytitle>
<manvolnum>5</manvolnum></citerefentry>'>
]>
<refentry>
<docinfo><date>5 July 2011</date></docinfo>
<refmeta>
<refentrytitle>archivemail</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">archivemail user manual</refmiscinfo>
<refmiscinfo class="source">archivemail 0.9.0</refmiscinfo>
</refmeta>
<refnamediv>
<refname>archivemail</refname>
<refpurpose>archive and compress your old email</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>archivemail</command>
<arg><option>options</option></arg>
<arg choice="req" rep="repeat"><replaceable>MAILBOX</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>archivemail</command> is a tool for archiving and compressing old
email in mailboxes.
By default it will read the mailbox <replaceable>MAILBOX</replaceable>, moving
messages that are older than the specified number of days (180 by default) to
a &mbox;-format mailbox in the same directory that is compressed with &gzip;.
It can also just delete old email rather than archive it.
</para>
<para>
By default, <command>archivemail</command> derives the archive filename from
the mailbox name by appending an <filename>_archive</filename> suffix to the
mailbox name. For example, if you run <command>archivemail</command> on a
mailbox called <filename>exsouthrock</filename>, the archive will be created
with the filename <filename>exsouthrock_archive.gz</filename>.
This default behavior can be overridden with command line options, choosing
a custom suffix, a prefix, or a completely custom name for the archive.
</para>
<para>
<command>archivemail</command> supports reading <acronym>IMAP</acronym>,
<acronym>Maildir</acronym>, <acronym>MH</acronym> and
<acronym>mbox</acronym>-format mailboxes, but always writes
<acronym>mbox</acronym>-format archives.
</para>
<para>
Messages that are flagged important are not archived or deleted unless
explicitly requested with the <option>--include-flagged</option> option.
Also, <command>archivemail</command> can be configured not to archive unread
mail, or to only archive messages larger than a specified size.
</para>
<para>
To archive an <acronym>IMAP</acronym>-format mailbox, use the format
<replaceable>imap://username:password@server/mailbox </replaceable> to specify
the mailbox.
<command>archivemail</command> will expand wildcards in
<acronym>IMAP</acronym> mailbox names according to
<citation><acronym>RFC</acronym> 3501</citation>, which says: <quote>The
character "*" is a wildcard, and matches zero or more characters at this
position. The character "%" is similar to "*", but it does not match a
hierarchy delimiter.</quote>
You can omit the password from the <acronym>URL</acronym>; use the
<option>--pwfile</option> option to make <command>archivemail</command> read
the password from a file, or alternatively just enter it upon request.
If the <option>--pwfile</option> option is set, <command>archivemail</command>
does not look for a password in the <acronym>URL</acronym>, and the colon is
not considered a delimiter.
Substitute <replaceable>imap</replaceable> with
<replaceable>imaps</replaceable>, and <command>archivemail</command> will
establish a secure <acronym>SSL</acronym> connection.
See below for more <acronym>IMAP</acronym> peculiarities.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<variablelist>
<varlistentry>
<term><option>-d <replaceable>NUM</replaceable></option></term>
<term><option>--days=<replaceable>NUM</replaceable></option></term>
<listitem><para>Archive messages older than <replaceable>NUM</replaceable>
days. The default is 180. This option is incompatible with the
<option>--date</option> option below.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-D <replaceable>DATE</replaceable></option></term>
<term><option>--date=<replaceable>DATE</replaceable></option></term>
<listitem><para>Archive messages older than <replaceable>DATE</replaceable>.
<replaceable>DATE</replaceable> can be a date string in ISO format (eg
<quote>2002-04-23</quote>), Internet format (<abbrev>eg</abbrev> <quote>23 Apr
2002</quote>) or Internet format with full month names (<abbrev>eg</abbrev>
<quote>23 April 2002</quote>). Two-digit years are not supported.
This option is incompatible with the <option>--days</option> option above.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o <replaceable>PATH</replaceable></option></term>
<term><option>--output-dir=<replaceable>PATH</replaceable></option></term>
<listitem><para>Use the directory name <replaceable>PATH</replaceable> to
store the mailbox archives. The default is the same directory as the mailbox
to be read.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-P <replaceable>FILE</replaceable></option></term>
<term><option>--pwfile=<replaceable>FILE</replaceable></option></term>
<listitem><para>Read <acronym>IMAP</acronym> password from file
<replaceable>FILE</replaceable> instead of from the command line. Note
that this will probably not work if you are archiving folders from
more than one IMAP account.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-F <replaceable>STRING</replaceable></option></term>
<term><option>--filter-append=<replaceable>STRING</replaceable></option></term>
<listitem><para>Append <replaceable>STRING</replaceable> to the
<acronym>IMAP</acronym> filter string.
For <acronym>IMAP</acronym> wizards.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-p <replaceable>NAME</replaceable></option></term>
<term><option>--prefix=<replaceable>NAME</replaceable></option></term>
<listitem><para>Prefix <replaceable>NAME</replaceable> to the archive name.
<replaceable>NAME</replaceable> is expanded by the &python; function
<function>time.strftime()</function>, which means that you can specify special
directives in <replaceable>NAME</replaceable> to make an archive named after
the archive cut-off date.
See the discussion of the <option>--suffix</option> option for a list of valid
<function>strftime()</function> directives.
The default is not to add a prefix.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-s <replaceable>NAME</replaceable></option></term>
<term><option>--suffix=<replaceable>NAME</replaceable></option></term>
<listitem><para>
Use the suffix <replaceable>NAME</replaceable> to create the filename used for
archives. The default is <filename>_archive</filename>, unless a prefix is
specified.
</para>
<para>
Like a prefix, the suffix <replaceable>NAME</replaceable> is expanded by the
&python; function <function>time.strftime()</function> with the archive
cut-off date. <function>time.strftime()</function> understands the following
directives:
<variablelist id="strftime">
<varlistentry><term><code>%a</code></term>
<listitem><simpara>
Locale's abbreviated weekday name.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%A</code></term>
<listitem><simpara>
Locale's full weekday name.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%b</code></term>
<listitem><simpara>
Locale's abbreviated month name.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%B</code></term>
<listitem><simpara>
Locale's full month name.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%c</code></term>
<listitem><simpara>
Locale's appropriate date and time representation.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%d</code></term>
<listitem><simpara>
Day of the month as a decimal number [01,31].
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%H</code></term>
<listitem><simpara>
Hour (24-hour clock) as a decimal number [00,23].
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%I</code></term>
<listitem><simpara>
Hour (12-hour clock) as a decimal number [01,12].
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%j</code></term>
<listitem><simpara>
Day of the year as a decimal number [001,366].
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%m</code></term>
<listitem><simpara>
Month as a decimal number [01,12].
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%M</code></term>
<listitem><simpara>
Minute as a decimal number [00,59].
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%p</code></term>
<listitem><simpara>
Locale's equivalent of either AM or PM.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%S</code></term>
<listitem><simpara>
Second as a decimal number [00,61]. (1)
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%U</code></term>
<listitem><simpara>
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.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%w</code></term>
<listitem><simpara>
Weekday as a decimal number [0(Sunday),6].
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%W</code></term>
<listitem><simpara>
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.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%x</code></term>
<listitem><simpara>
Locale's appropriate date representation.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%X</code></term>
<listitem><simpara>
Locale's appropriate time representation.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%y</code></term>
<listitem><simpara>
Year without century as a decimal number [00,99].
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%Y</code></term>
<listitem><simpara>
Year with century as a decimal number.
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%Z</code></term>
<listitem><simpara>
Time zone name (or by no characters if no time zone exists).
</simpara></listitem>
</varlistentry>
<varlistentry><term><code>%%</code></term>
<listitem><simpara>
A literal <quote>%</quote> character.
</simpara></listitem>
</varlistentry>
</variablelist>
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-a <replaceable>NAME</replaceable></option></term>
<term><option>--archive-name=<replaceable>NAME</replaceable></option></term>
<listitem><para>Use <replaceable>NAME</replaceable> as the archive name,
ignoring the name of the mailbox that is archived.
Like prefixes and suffixes, <replaceable>NAME</replaceable> is expanded by
<function>time.strftime()</function> with the archive cut-off date.
Because it hard-codes the archive name, this option cannot be used when
archiving multiple mailboxes.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-S <replaceable>NUM</replaceable></option></term>
<term><option>--size=<replaceable>NUM</replaceable></option></term>
<listitem><para>Only archive messages that are <replaceable>NUM</replaceable>
bytes or greater.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option></term>
<term><option>--dry-run</option></term>
<listitem><para>
Don't write to any files -- just show what would have been done. This is
useful for testing to see how many messages would have been archived.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-u</option></term>
<term><option>--preserve-unread</option></term>
<listitem><para>
Do not archive any messages that have not yet been read.
<command>archivemail</command> determines if a message in a
<acronym>mbox</acronym>-format or <acronym>MH</acronym>-format mailbox has
been read by looking at the <literal>Status</literal> header (if it exists).
If the status header is equal to <quote><literal>RO</literal></quote> or
<quote><literal>OR</literal></quote> then <command>archivemail</command>
assumes the message has been read.
<command>archivemail</command> determines if a <acronym>maildir</acronym>
message has been read by looking at the filename.
If the filename contains an <quote><literal>S</literal></quote> after
<filename>:2,</filename> then it assumes the message has been read.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<option>--dont-mangle</option>
</term>
<listitem><para>
Do not mangle lines in message bodies beginning with
<quote><literal>From&nbsp;</literal></quote>.
When archiving a message from a mailbox not in <acronym>mbox</acronym>
format, by default <command>archivemail</command> mangles such lines by
prepending a <quote><literal>&gt;</literal></quote> to them, since mail user
agents might otherwise interpret these lines as message separators.
Messages from <acronym>mbox</acronym> folders are never mangled. See &mbox;
for more information.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<option>--delete</option>
</term>
<listitem><para>
Delete rather than archive old mail. Use this option with caution!
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<option>--copy</option>
</term>
<listitem><para>
Copy rather than archive old mail.
Creates an archive, but the archived messages are not deleted from the
originating mailbox, which is left unchanged.
This is a complement to the <option>--delete</option> option, and mainly
useful for testing purposes.
Note that multiple passes will create duplicates, since messages are blindly
appended to an existing archive.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<option>--all</option>
</term>
<listitem><para>
Archive all messages, without distinction.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<option>--include-flagged</option>
</term>
<listitem><para>
Normally messages that are flagged important are not archived or deleted. If
you specify this option, these messages can be archived or deleted just like
any other message.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<option>--no-compress</option>
</term>
<listitem><para>
Do not compress any archives.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<option>--warn-duplicate</option>
</term>
<listitem><para>
Warn about duplicate <literal>Message-ID</literal>s that appear in the input
mailbox.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option></term>
<term><option>--verbose</option></term>
<listitem><para>
Reports lots of extra debugging information about what is going on.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<option>--debug-imap=<replaceable>NUM</replaceable></option>
</term>
<listitem><para>
Set <acronym>IMAP</acronym> debugging level. This makes
<command>archivemail</command> dump its conversation with the
<acronym>IMAP</acronym> server and some internal <acronym>IMAP</acronym>
processing to <literal>stdout</literal>. Higher values for
<replaceable>NUM</replaceable> give more elaborate output. Set
<replaceable>NUM</replaceable> to 4 to see all exchanged
<acronym>IMAP</acronym> commands. (Actually, <replaceable>NUM</replaceable>
is just passed literally to <literal>imaplib.Debug</literal>.)
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-q</option></term>
<term><option>--quiet</option></term>
<listitem><para>
Turns on quiet mode. Do not print any statistics about how many messages were
archived. This should be used if you are running
<command>archivemail</command> from cron.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-V</option></term>
<term><option>--version</option></term>
<listitem><para>
Display the version of <command>archivemail</command> and exit.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-h</option></term>
<term><option>--help</option></term>
<listitem><para>
Display brief summary information about how to run
<command>archivemail</command>.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
<command>archivemail</command> requires &python; version 2.3 or later.
When reading an <acronym>mbox</acronym>-format mailbox,
<command>archivemail</command> will create a lockfile with the extension
<filename class="extension">.lock</filename> so that &procmail; will not
deliver to the mailbox while it is being processed. It will also create an
advisory lock on the mailbox using &lockf;. The archive is locked in the same
way when it is updated.
<command>archivemail</command> will also complain and abort if a 3rd-party
modifies the mailbox while it is being read.
</para>
<para>
<command>archivemail</command> will always attempt to preserve the last-access
and last-modify times of the input mailbox. Archive mailboxes are always
created with a mode of <literal>0600</literal>.
If <command>archivemail</command> finds a pre-existing archive mailbox it will
append rather than overwrite that archive.
<command>archivemail</command> will refuse to operate on mailboxes that are
symbolic links.
</para>
<para>
<command>archivemail</command> attempts to find the delivery date of a message
by looking for valid dates in the following headers, in order of precedence:
<literal>Delivery-date</literal>,
<literal>Received</literal>,
<literal>Resent-Date</literal> and
<literal>Date</literal>.
If it cannot find any valid date in these headers, it will use the
last-modified file timestamp on <acronym>MH</acronym> and
<acronym>Maildir</acronym> format mailboxes, or the date on the
<literal>From_</literal> line on <acronym>mbox</acronym>-format mailboxes.
</para>
<para>
When archiving mailboxes with leading dots in the name,
<command>archivemail</command> will strip the dots off the archive name, so
that the resulting archive file is not hidden.
This is not done if the <option>--prefix</option> or
<option>--archive-name</option> option is used.
Should there really be mailboxes distinguished only by leading dots in the
name, they will thus be archived to the same archive file by default.
</para>
<para>
A conversion from other formats to &mbox; will silently overwrite existing
<literal>Status</literal> and <literal>X-Status</literal> message headers.
</para>
<refsect2>
<title><acronym>IMAP</acronym></title>
<para>
When <command>archivemail</command> processes an <acronym>IMAP</acronym>
folder, all messages in that folder will have their <literal>\Recent</literal>
flag unset, and they will probably not show up as <quote>new</quote> in your
user agent later on.
There is no way around this, it's just how <acronym>IMAP</acronym> works.
This does not apply, however, if you run <command>archivemail</command> with
the options <option>--dry-run</option> or <option>--copy</option>.
</para>
<para>
<command>archivemail</command> relies on server-side searches to determine the
messages that should be archived.
When matching message dates, <acronym>IMAP</acronym> servers refer to server
internal message dates, and these may differ from both delivery time of a
message and its <literal>Date</literal> header.
Also, there exist broken servers which do not implement server side searches.
</para>
<refsect3><title><acronym>IMAP</acronym> <acronym>URL</acronym>s</title>
<para>
<command>archivemail</command>'s <acronym>IMAP</acronym>
<acronym>URL</acronym> parser was written with the <acronym>RFC</acronym> 2882
(<citetitle>Internet Message Format</citetitle>) rules for the
<token>local-part</token> of email addresses in mind.
So, rather than enforcing an <acronym>URL</acronym>-style encoding of
non-<acronym>ascii</acronym> and reserved characters, it allows you to
double-quote the username and password.
If your username or password contains the delimiter characters
<quote>@</quote> or <quote>:</quote>, just quote it like this:
<replaceable>imap://"username@bogus.com":"password"@imap.bogus.com/mailbox</replaceable>.
You can use a backslash to escape double-quotes that are part of a quoted
username or password.
Note that quoting only a substring will not work, and be aware that your shell
will probably remove unprotected quotes or backslashes.
</para>
<para>
Similarly, there is no need to percent-encode non-<acronym>ascii</acronym>
characters in <acronym>IMAP</acronym> mailbox names.
As long as your locale is configured properly, <command>archivemail</command>
should handle these without problems.
Note, however, that due to limitations of the <acronym>IMAP</acronym>
protocol, non-<acronym>ascii</acronym> characters do not mix well with
wildcards in mailbox names.
</para>
<para>
<command>archivemail</command> tries to be smart when handling mailbox paths.
In particular, it will automatically add an <acronym>IMAP</acronym>
<literal>NAMESPACE</literal> prefix to the mailbox path if necessary; and if
you are archiving a subfolder, you can use the slash as a path separator
instead of the <acronym>IMAP</acronym> server's internal representation.
</para>
</refsect3>
</refsect2>
</refsect1>
<refsect1>
<title>Examples</title>
<informalexample>
<para>
To archive all messages in the mailbox <filename>debian-user</filename> that
are older than 180 days to a compressed mailbox called
<filename>debian-user_archive.gz</filename> in the current directory:
<screen>
<prompt>bash$ </prompt><userinput>archivemail debian-user</userinput>
</screen>
</para>
</informalexample>
<informalexample>
<para>
To archive all messages in the mailbox <filename>debian-user</filename> that
are older than 180 days to a compressed mailbox called
<filename>debian-user_October_2001.gz</filename> (where the current month and
year is April, 2002) in the current directory:
<screen>
<prompt>bash$ </prompt><userinput>archivemail --suffix '_%B_%Y' debian-user</userinput>
</screen>
</para>
</informalexample>
<informalexample>
<para>
To archive all messages in the mailbox <filename>cm-melb</filename> that
are older than the first of January 2002 to a compressed mailbox called
<filename>cm-melb_archive.gz</filename> in the current directory:
<screen>
<prompt>bash$ </prompt><userinput>archivemail --date='1 Jan 2002' cm-melb</userinput>
</screen>
</para>
</informalexample>
<informalexample>
<para>
Exactly the same as the above example, using an <acronym>ISO</acronym> date
format instead:
<screen>
<prompt>bash$ </prompt><userinput>archivemail --date=2002-01-01 cm-melb</userinput>
</screen>
</para>
</informalexample>
<informalexample>
<para>
To delete all messages in the mailbox <filename>spam</filename> that
are older than 30 days:
<screen>
<prompt>bash$ </prompt><userinput>archivemail --delete --days=30 spam</userinput>
</screen>
</para>
</informalexample>
<informalexample>
<para>
To archive all read messages in the mailbox <filename>incoming</filename> that
are older than 180 days to a compressed mailbox called
<filename>incoming_archive.gz</filename> in the current directory:
<screen>
<prompt>bash$ </prompt><userinput>archivemail --preserve-unread incoming</userinput>
</screen>
</para>
</informalexample>
<informalexample>
<para>
To archive all messages in the mailbox <filename>received</filename> that
are older than 180 days to an uncompressed mailbox called
<filename>received_archive</filename> in the current directory:
<screen>
<prompt>bash$ </prompt><userinput>archivemail --no-compress received</userinput>
</screen>
</para>
</informalexample>
<informalexample>
<para>
To archive all mailboxes in the directory <filename>$HOME/Mail</filename>
that are older than 90 days to compressed mailboxes in the
<filename>$HOME/Mail/Archive</filename> directory:
<screen>
<prompt>bash$ </prompt><userinput>archivemail -d90 -o $HOME/Mail/Archive $HOME/Mail/*</userinput>
</screen>
</para>
</informalexample>
<informalexample>
<para>
To archive all mails older than 180 days from the given
<acronym>IMAP</acronym> <literal>INBOX</literal> to a compressed mailbox
<filename>INBOX_archive.gz</filename> in the
<filename>$HOME/Mail/Archive</filename> directory, quoting the password and
reading it from the environment variable <envar>PASSWORD</envar>:
</para>
<!-- i'm open to suggestions how to avoid making such a super-long line here. -->
<screen>
<prompt>bash$ </prompt><userinput>archivemail -o $HOME/Mail/Archive imaps://user:'"'$PASSWORD'"'@example.org/INBOX</userinput>
</screen>
<para>
Note the protected quotes.
</para>
</informalexample>
<informalexample>
<para>
To archive all mails older than 180 days in subfolders of <filename
class="directory">foo</filename> on the given <acronym>IMAP</acronym>
server to corresponding archives in the current working directory, reading the
password from the file <filename>~/imap-pass.txt</filename>:
</para>
<screen>
<prompt>bash$ </prompt><userinput>archivemail --pwfile=~/imap-pass.txt imaps://user@example.org/foo/*</userinput>
</screen>
</informalexample>
</refsect1>
<refsect1>
<title>Tips</title>
<para>
Probably the best way to run <command>archivemail</command> is from your
&crontab; file, using the <option>--quiet</option> option.
Don't forget to try the <option>--dry-run</option> and perhaps the
<option>--copy</option> option for non-destructive testing.
</para>
</refsect1>
<refsect1>
<title>Exit Status</title>
<simpara>Normally the exit status is 0. Nonzero indicates an unexpected error.
</simpara>
</refsect1>
<refsect1>
<title>Bugs</title>
<simpara>
If an <acronym>IMAP</acronym> mailbox path contains slashes, the archive
filename will be derived from the basename of the mailbox.
If the server's folder separator differs from the Unix slash and is used in
the <acronym>IMAP</acronym> <acronym>URL</acronym>, however, the whole path
will be considered the basename of the mailbox.
<abbrev>E.g.</abbrev> the two <acronym>URL</acronym>s
<userinput>imap://user@example.com/folder/subfolder</userinput> and
<userinput>imap://user@example.com/folder.subfolder</userinput> will be
archived in <filename>subfolder_archive.gz</filename> and
<filename>folder.subfolder_archive.gz</filename>, respectively, although they
might refer to the same <acronym>IMAP</acronym> mailbox.
</simpara>
<simpara>
<command>archivemail</command> does not support reading
<acronym>MMDF</acronym> or <acronym>Babyl</acronym>-format mailboxes. In fact,
it will probably think it is reading an <acronym>mbox</acronym>-format mailbox
and cause all sorts of problems.
</simpara>
<simpara>
<command>archivemail</command> is still too slow, but if you are running from
&crontab; you won't care. Archiving <acronym>maildir</acronym>-format
mailboxes should be a lot quicker than <acronym>mbox</acronym>-format
mailboxes since it is less painful for the original mailbox to be
reconstructed after selective message removal.
</simpara>
</refsect1>
<refsect1>
<title>See Also</title>
<simplelist type="inline">
<member>&mbox;</member>
<member>&crontab;</member>
<member>&python;</member>
<member>&procmail;</member>
</simplelist>
</refsect1>
<refsect1>
<title><acronym>Url</acronym></title>
<simpara>The <command>archivemail</command> home page is currently hosted at
<ulink type="http" url="http://archivemail.sourceforge.net">sourceforge</ulink>
</simpara>
</refsect1>
<refsect1>
<title>Author</title>
<simpara> This manual page was written by Paul Rodger &lt;paul at paulrodger
dot com&gt;. Updated and supplemented by Nikolaus Schulz
<email>microschulz@web.de</email></simpara>
</refsect1>
</refentry>

10
db2html.xsl Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl"/>
<xsl:param name="html.stylesheet">manpage.css</xsl:param>
<xsl:template name="user.header.content">
<h1>archivemail</h1>
<hr/>
</xsl:template>
</xsl:stylesheet>

29
db2man.xsl Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl"/>
<!-- Use .TP list for the variablelist describing the strtime() directives. -->
<!-- This hack aligns the indented paragraphs horizontally with their -->
<!-- labels. -->
<xsl:template match="variablelist[attribute::id='strftime']/varlistentry">
<xsl:text>.TP&#10;</xsl:text>
<xsl:for-each select="term">
<xsl:variable name="content">
<xsl:apply-templates/>
</xsl:variable>
<xsl:value-of select="normalize-space($content)"/>
<xsl:choose>
<xsl:when test="position() = last()"/> <!-- do nothing -->
<xsl:otherwise>
<!-- * if we have multiple terms in the same varlistentry, generate -->
<!-- * a separator (", " by default) -->
<xsl:value-of select="$variablelist.term.separator"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>

31
examples/archivemail_all Normal file
View File

@ -0,0 +1,31 @@
#!/bin/sh
#
# This is an example shell script I use from my crontab(5) file to selectively
# archive some of my mailboxes. Most of these mailboxes come directly from
# procmail and are in maildir-format -- not that it should really matter.
#
# I probably could have done them all as:
# $ARCMAIL $HOME/Mail/*
# ...if I had enough disk space to keep mail uncompressed for 180 days :)
#
set -e
ARCMAIL="/usr/local/bin/archivemail --quiet --output-dir=$HOME/Mail/Archive/ "
$ARCMAIL --days 14 $HOME/Mail/debian-user \
$HOME/Mail/linux-kernel \
$HOME/Mail/python-list \
$HOME/Mail/spam-l
$ARCMAIL --days 30 --delete $HOME/Mail/duplicates
$ARCMAIL --days 90 $HOME/Mail/bugtraq \
$HOME/Mail/debian-devel \
$HOME/Mail/debian-mentors \
$HOME/Mail/spam
$ARCMAIL $HOME/Mail/cm-melb \
$HOME/Mail/exsouthrock \
$HOME/Mail/received \
$HOME/Mail/sent \
$HOME/Mail/vim

192
index.html Normal file
View File

@ -0,0 +1,192 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type"
content="text/html;charset=us-ascii">
<title>archivemail &ndash; a tool for archiving and compressing old email</title>
<link title="archivemail style" rel=stylesheet href="style.css"
type="text/css">
<style type="text/css">
/*<![CDATA[*/
.command {font-weight: bold;}
.example {
/*background-color: #e0e0e0;*/
padding: 0 2em;
}
#status {
float: right;
width: 10em
margin-left: 4em;
margin-top: 1.3em;
padding: 3ex;
border: 1px solid #777777;
line-height: 160%;
}
/*span.mail {text-decoration: underline;}*/
/*]]>*/
</style>
</head>
<body>
<h1>archivemail</h1>
<hr>
<div id="status">
<strong>Latest version: 0.9.0</strong><br>
Released on 2011-07-09
</div>
<h2>What is it?</h2>
<p>
<span class="command">archivemail</span> is a tool for archiving and compressing
old email in mailboxes.
It moves messages older than the specified number of
days to a separate <a title="mbox(5) man page"
href="http://www.qmail.org/man/man5/mbox.html">mbox format</a> mailbox that is
compressed with <span class="command">gzip</span>.
It can also just delete old email rather than archive it.
<h2>What can it do for me?</h2>
<p>
Maybe some of your mailboxes are quite large (eg, over 10,000 messages) and
they are taking a while to load in your mail reader. Perhaps they are taking
up too much space on your disk. Archiving old messages to a separate,
compressed mailbox will mean:
<ol>
<li>Your mail reader will get a huge performance boost loading and reading
your mail.
<li>You will be taking up less disk space, since old mail will be compressed.
(Mail usually compresses quite nicely.)
<li>You won't be confronted with semi-obsolete mail all the time.
</ol>
<p>
You can also use <span class="command">archivemail</span> as a simple backup
tool.
<h2>Features overview</h2>
<ul>
<li>Supports archiving
<a title="about IMAP" href="http://www.imap.org/">IMAP</a>,
<a title="mbox(5) man page" href="http://www.qmail.org/man/man5/mbox.html">mbox</a>,
<a title="MH FAQ" href="http://www.faqs.org/faqs/mail/mh-faq/">MH</a> and
<a title="maildir(5) man page"
href="http://www.qmail.org/man/man5/maildir.html">Maildir</a> format
mailboxes.
<li>Old mail can be either archived or just deleted.
<li>The age in days that is considered old is configurable &ndash; it defaults
to 180 days.
You can also set an absolute limit date.
<li>Messages that are flagged important are not archived or deleted unless
explicitely requested.
<!--<li>You can specify an option so that unread mail is never archived.-->
<li>Can be configured to preserve unread mail.
<li>Can be configured to only archive messages over a given byte size.
<li>Stores the compressed archive mailboxes in a directory of
your choice, with an extension of your choice.
<li>Easy read-only testing, not touching your valuable data.
<li>Supports IMAPS/SSL.
<li>When archiving IMAP mailboxes, the message selection can be refined by
extending the underlying IMAP <code>SEARCH</code> command with arbitrary
search keys (you will have to cope with the raw IMAP protocol, though).
</ul>
<h2>Documentation</h2>
<p>
The <a href="manpage.html">archivemail manpage</a> is the primary documentation
for <span class="command">archivemail</span>.
To see what has changed in the latest version, check the <a
href="RELNOTES">release notes</a>.
If you want to have a closer look at the current development status, here's the
<a title="changelog in git HEAD" href=
"http://archivemail.git.sourceforge.net/git/gitweb.cgi?p=archivemail/archivemail;a=blob;f=CHANGELOG;hb=HEAD">
CHANGELOG</a> and the <a title="TODO list in git HEAD" href=
"http://archivemail.git.sourceforge.net/git/gitweb.cgi?p=archivemail/archivemail;a=blob;f=TODO;hb=HEAD">
TODO list</a>, fresh from the repository.
<h2>Where can I get it?</h2>
<p>
You can grab the latest version of <span class="command">archivemail</span>
directly from the <a
href="http://sourceforge.net/project/showfiles.php?group_id=49630">archivemail
download area</a> at Sourceforge.
There should be up-to-date binary RPM packages at the
<a href="http://software.opensuse.org/download/server:/mail/">OpenSUSE build
service</a> for SUSE Linux and Fedora Core.
Also, many Linux distributions provide packages; e.g. there is a
<a href="http://packages.debian.org/unstable/archivemail">Debian
package</a>.
<p>
<span class="command">archivemail</span> is written in Python, and hacking it is
easy and fun; you can check out the source from the git repository with
the following command:
<div class="example">
<kbd>git clone git://archivemail.git.sourceforge.net/gitroot/archivemail/archivemail</kbd>
</div>
<p>
See also the short <a href="http://sourceforge.net/scm/?type=git&amp;group_id=49630">
introduction to git access</a> at sourceforge.
<!-- 2007-11-06: this site has problems, and I cannot read the mentioned article.
<h3>Articles</h3>
<p>
Emmanuel Seyman wrote an
<a href="http://muttfr.org/gen.php3/2002/11/20/108,1,0,0,1.php3">article
about archivemail</a> for <a href="http://www.muttfr.org/">muttfr.org</a>, a
French website about <a href="http://www.mutt.org/">mutt</a>.
-->
<h2>Getting involved</h2>
<ul>
<li>Visit the <a
href="http://sourceforge.net/tracker/?group_id=49630">archivemail
tracker</a> to browse and/or submit bug reports and feature requests.
<li>You can subscribe to the <a
href="http://lists.sourceforge.net/lists/listinfo/archivemail-user">archivemail-user
mailing list</a>.
This is a low traffic, subscribers-only list.
<li>Check out the <a href="http://sourceforge.net/projects/archivemail/">project page
for archivemail</a> at Sourceforge for a general overview.
</ul>
<h2>Requirements</h2>
<p>
<span class="command">archivemail</span> requires Python 2.3 or newer.
It also uses some optional python modules, but these should be pretty much
standard; if you get an ImportError nonetheless, please
<a title="jump to the archivemail tracker"
href="http://sourceforge.net/tracker/?group_id=49630">report it</a>, thanks.
<h2>License</h2>
<p>
This software is licensed under the terms of the
<a href="http://www.gnu.org/licenses/licenses.html#GPL">GNU GPL</a>, either
version 2 of the license, or any later version.
<h2>Credits</h2>
<p>
<span class="command">archivemail</span> was written by Paul Rodger
<code>&lt;paul <em>at</em> paulrodger <em>dot</em>
com&gt;</code>
and is currently maintained by Peter Poeml <code>&lt;poeml
<em>at</em> suse <em>dot</em> de&gt;</code>, Nikolaus Schulz <code><a href=
"mailto:microschulz@web.de">&lt;microschulz@web.de&gt;</a></code>
and Brandon Knitter.
<hr>
<p>
<!-- sourceforge logo start -->
<a href="http://sourceforge.net">
<!-- white: -->
<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=49630&amp;type=2"
width="125" height="37"
alt="SourceForge.net Logo">
<!-- blue:
<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=49630&amp;type=4"
width="125" height="37"
alt="SourceForge.net Logo">
-->
</a>
<!-- sourceforge logo end -->
</body>
</html>

15
manpage.css Normal file
View File

@ -0,0 +1,15 @@
@import "style.css";
h2 {
font-variant: small-caps;
font-size: 170%;
}
.informalexample {
margin-bottom: 1.2em;
}
div.informalexample .screen {
margin-left: 2ex;
}
a#strftime + dl dt { float: left; margin: 0.3ex 0; width: 1.5em; }
a#strftime + dl dd { float: left; margin: 0.3ex 0; margin-left: 1.2em; width: 90%; }
dt { clear: left; }

33
setup.py Executable file
View File

@ -0,0 +1,33 @@
#! /usr/bin/env python
import sys
def check_python_version():
"""Abort if we are running on python < v2.0"""
too_old_error = """This program requires python v2.0 or greater.
Your version of python is: %s""" % sys.version
try:
version = sys.version_info # we might not even have this function! :)
if (version[0] < 2):
print too_old_error
sys.exit(1)
except AttributeError:
print too_old_error
sys.exit(1)
# define & run this early - 'distutils.core' requires Python >= 2.0
check_python_version()
from distutils.core import setup
setup(name="archivemail",
version="0.9.0",
description="archive and compress old email",
license="GNU GPL",
url="http://archivemail.sourceforge.net/",
author="Paul Rodger",
author_email="paul@paulrodger.com",
maintainer="Nikolaus Schulz, Peter Poeml",
maintainer_email="nikosch@users.sourceforge.net, poeml@users.sourceforge.net",
scripts=["archivemail"],
data_files=[("share/man/man1", ["archivemail.1"])],
)

49
style.css Normal file
View File

@ -0,0 +1,49 @@
body {
padding: 2%;
line-height: 130%;
margin: 0;
/*color: #036;*/
}
h1 {
font-size: 220%;
font-weight: bold;
padding: 0 0 0.4em 0.1em;
/*margin: 0 0 0.5em 0; */
margin: 0;
/*border-bottom: 2px solid black;*/
}
hr {
border: 1px #b8b8b8 solid;
}
h1 + hr {
margin-top: 0;
margin-bottom: 1.7em;
}
h2 {
margin: 1em 0 0.8em 0;
padding: 0;
font-size: 150%;
}
img {border: none;}
a {
text-decoration: underline;
}
a:link {
/*color: #0073c7;*/
color: blue;
background-color: inherit;
}
a:visited {
/*color: #5A88B5;*/
color: #844084;
background-color: inherit;
}
/*
a:hover,
a:active {
color: #0073c7;
background-color: #f0f0f0;
}
*/

1771
test_archivemail Executable file

File diff suppressed because it is too large Load Diff