| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Before, every test header was tested in a separate archiving run.
|
|
|
|
|
| |
Don't do entire test archiving runs, just call
archivemail.should_archive().
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The test suite used to run a lot of triple tests, by first calling
archivemail.archive() directly, and then running the entire archivemail
script twice, once with long and once with short options. But we already
test option processing seperately, and beyond that, archivemail.main()
essentially just calls archive() for each mailbox in turn. So we just drop
all runs of the entire archivemail script from the test suite, giving it a
huge speed boost (on my old iBook, running the test suite drops from 73 to
5 seconds).
|
| |
|
|
|
|
| |
Use gzip.GzipFile instead.
|
|
|
|
|
| |
This eliminates a lot of copy-and-paste code, and switches from
os.system("gzip <...>") to gzip.GzipFile.
|
|
|
|
|
|
|
| |
os.utime() uses the utimes(2) system call to set file timestamps. utimes(2)
has a microsecond resolution, but stat(2) may return timestamps with
nanosecond resolution. So, the check that we have properly reset the mbox
file timestamp must allow a minor deviation.
|
|
|
|
|
|
|
|
|
|
| |
* Make the finalise() methods spot if they have anything to do
* We used to create the temporary mbox files on demand in the message
processing loop, if we needed to write to them. Now we create them
beforehand, but only if they might be needed (e.g. we don't create an
archive if options.delete_old_mail is set).
* The above combined makes the final committing of the changes simpler (a
*lot* simpler for mboxes), and we can dump the Mbox.leave_empty() method.
|
|
|
|
|
| |
This separates write-only mbox access to the temporary mboxes from the read-only
access to the original mbox.
|
| |
|
|
|
|
|
|
| |
Updated documentation, and added a first simple unittest for this.
Closes: #1764846.
|
| |
|
| |
|
|
|
|
|
| |
bumped version to 0.7.1, and updated copyright.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
required.
|
|
|
|
|
|
|
| |
Should just serve as a last security fallback, since we operate in a safe
temporary directory and everything should be okay anyway, but that may be less
obvious. :-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Derive all testcases that create temporary files from the new class
TestCaseInTempdir, which provides standard fixtures to set up a secure temporary
root directory for tempfiles and cleaning up afterwards. This also simplifies
the code.
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. There *are* race conditions with archivemail, but
they were not subject of that report, and are not that critical.
Also bumped python dependency to version 2.3 since we use tempfile.mkstemp() and
other recent stuff.
|
|
|
|
|
| |
testcase.
|
|
|
|
|
|
|
| |
matching tearDown() methods were already there.
We surely can move more (possibly duplicated) stuff into the setUp() methods
later.
|
|
|
|
|
| |
posix platforms only.
|
|
|
|
|
|
| |
fcntl(2) calls. fcntl locks don't support interlocking within a process, so we
need to fork() to correctly test them.
|
|
|
|
|
| |
Updated copyright notices in archivemail.py and test_archivemail.py.
|
|
|
|
|
|
| |
date directives in the suffix to the current date, but rev. 94 changed that to
the archive cut off date. Based on analysis by Peter Poeml. Thanks, Peter.
|
|
|
|
|
|
| |
older than the unix epoch. (New versions of python return OverFlow
error instead)
|
|
|
|
|
| |
tempfiles. This should be a lot more secure.
|
|
|
|
|
| |
with a completely blank value.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
2.2.
|
| |
|
|
|
|
|
|
| |
Hopefully I haven't gone too overboard with 957 lines of testing code for
a 1100 line program :)
|
|
|
|
|
|
| |
the new option '--date' and fixed a bug where archivemail would complain about
messages older than 1970.
|
| |
|
| |
|
|
|
|
|
|
| |
Added an option '--preserve-unread' to always preserved (don't archive)
unread messages.
|
| |
|
|
|
|
|
|
| |
directly. Removed bzip2 and compress support since they were complicating
things and you don't really need them much anyway.
|
| |
|
|
|
|
|
| |
on original mbox mailboxes have been preserved.
|
|
|
|
|
| |
all existing tests so it looks nicer when run verbosely.
|
|
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.
Renamed unittest script 'test_archivemail' instead of 'archivemail_test'
and added about 20 more tests.
|