Hi,

version:                1.2.5
menu:                   n.a.
command:                n.a.
new config options:     set maildir_tmp_clean
                        set maildir_tmp_clean_interval
bug that it fixes:      non-compliance to maildir specification


        I've put together a simple patch following mutt coding
style to implement older than 36 hours files' tmp cleaning.
        djb's maildir specification clearly states:

[begin of quote from maildir specification]

        The reader is also expected to look through the tmp directory
        and to clean up any old files found there.  A file in tmp
        may be safely removed if it has not been  accessed  in 36
        hours.

[end of quote]


        Before the discussion arises, mutt should comply to the
maildir specification. It does not matter if some local installation
does not seem to mind the non-compliance. It is a simple requirement
and an easy one to implement. Why not comply, then? Do not flame
me, I am just stating an opinion.
        I am proposing my patch but any other that does the trick
is fine by me. :) I just would like to see this implemented.
        Input and suggestions welcome. The patch applies against
mutt 1.2.5. It can be found at

http://people.freebsd.org/~lioux/mutt_maildir_tmp_clean-1.2.5-2001022100.tar.bz2
MD5 (mutt_maildir_tmp_clean-1.2.5-2001022100.tar.bz2) = 
2c55edc5600f99cce077fb7ea712788a

or

http://people.freebsd.org/~lioux/mutt_maildir_tmp_clean-1.2.5-2001022100.tar.gz
MD5 (mutt_maildir_tmp_clean-1.2.5-2001022100.tar.gz) = 7b15031d918e09de35f1e13cc71c3ea5

        The informative README.TXT packaged inside the tar follows
at the end of this email. There is also a TODO file, if you want
to contribute code to do any of those, please do.
        Please, contribute with both suggestions and ideas on how
to improve this patch. Simply reviewing and helping proofing it
is already a great help. :)
        A side issue. I packaged the main code files with a BSD
style license, if that is illegal, I'll gladly remove it. However,
before anyone says it is illegal, please check the files in question:
maildir_clean_dir.[ch]. They are files separated from the main mutt
distribution. Bear in mind that I am not a license expert.
        I apologize for any trouble.

        Thanks,

ps: I am not subscribed to this list, so please CC: me
when you reply.
        
-- 
Mario S F Ferreira - UnB - Brazil - "I guess this is a signature."
lioux at ( freebsd dot org | linf dot unb dot br )
flames to beloved [EMAIL PROTECTED]

------

# $Header: /home/lioux/cvsroot/mutt/maildir-patch/1.2.5/README.TXT,v 1.5 2001/02/21 
06:23:47 lioux Exp $

Mutt 1.2.5 does not implement the complete maildir specification.
It ignores details regarding the handling of maildir tmp directories.

[begin of quote from maildir specification]

        The reader is also expected to look through the tmp directory
        and to clean up any old files found there.  A file in tmp
        may be safely removed if it has not been  accessed  in 36
        hours.

[end of quote]

1) What the patch does?
o Implements thist last item of the specification which has
been left out of mutt maildir handling implementation

2) How? How the patch does it?
o Checks the tmp directory and stores the time stamp of the oldest
message below the 36 hours old watermark.

o If there are no messages, stores zero as the time stamp.

o Erases any messages older than 36 hours. This time watermark can
be selected within one minute precision through a configure file
option. If the watermark value is either equal or below zero, the
maildir specification value will be used instead.

o DEFAULTS:
        - patch disabled
        - time watermark: 36 hours = 36 * 60 minutes

o These are the muttrc options:
  
set maildir_tmp_clean=yes
set maildir_tmp_clean_interval=desire_time_watermark_in_minutes

o At each mh_check_mailbox cycle, this code does

        if (difftime(rightnow,oldest_message)>watermark)
                checks_directory_for_over_watermark_files;

        checks_directory_for_over_watermark_files() {
                remove_any_files_over_watermark;
        }

3) How do I install it?
o Copy both maildir_clean_dir.c and maildir_clean_dir.h to mutt
directory

o Apply each of the following patches:
        - patch-Makefile.am
        - patch-Makefile.in
        - patch-globals.h
        - patch-init.h
        - patch-mh.c
        - patch-mutt.h

o configure and build the port as usual

4) How do I test it?
o Just add a file to any tmp maildir directory. Then, use
an utility such as "touch" to set a date older than 36
hours (or, whatever the watermark is set).

o Open this maildir folder.

o Check to see if the file has been erased.

-------
# $Header: /home/lioux/cvsroot/mutt/maildir-patch/1.2.5/TODO,v 1.2 2001/02/21 07:01:15 
lioux Exp $

1) Consider what to do when a message date is in the future. Perhaps,
nothing.

2) Make it faster, perhaps replace all function variable copies
with relative references

3) Do the polling also when -Z is defined.

-- 
Mario S F Ferreira - UnB - Brazil - "I guess this is a signature."
lioux at ( freebsd dot org | linf dot unb dot br )
flames to beloved [EMAIL PROTECTED]

Reply via email to