[MG] Difference feed setup

Michael Allan mike at zelea.com
Mon Mar 7 00:15:06 EST 2011


Conseo, re your last:
http://u.zelea.com/var/cache/irc/metagov/11-03/06

If mstor doesn't use FileLock, you'll probably have to wrap it:
http://download.oracle.com/javase/6/docs/api/java/nio/channels/FileLock.html
Otherwise it isn't safe to read the mbox file, because the MTA may not
be finished writing it.  Postfix (for example) uses fcntl locks.
Those are compatible with Java's FileLock, assuming the code actually
uses it.

On second thought, I think we're on the wrong track.  We gave up too
easily on maildir.  Here's another approach:

    for( each file in 'new' directory )
    {
        // all files in here are unseen, of course

        in = new InputStream( file );

        message = new javax.mail.internet.MimeMessage( in );

        process( message ); // parse it to database, or whatever

        FileX.renameFrom( file, file in 'cur' directory );
          // move it to 'cur' directory
    }

What do you think?  We don't need JavaMail to move local mail files,
we just move them ourselves.

-- 
Michael Allan

Toronto, +1 416-699-9528
http://zelea.com/



Originally posted to the mailing list of the Metagovernment Project:
http://metagovernment.org/mailman/listinfo/start_metagovernment.org



More information about the Votorola mailing list