Re: Handling 'Maildir' folder

[email protected] Tue, 27 Apr 2004 20:35:35 +0200
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <[email protected]>
So... I overlooked the obvious.  It works with the following:

[In the init phase:]

    my $folder = Mail::Box::Maildir->new( 'folder' => $incomingFolder,
                                                           'folderdir' => $incomingFolderLocation,
                                                           'create' => 1,
                                                           'access' => 'rw',
                                                           'remove_when_empty' => 0 ) ;

[In each round:]

    $folder->read ;   # <--- This one!
    foreach my $msg ( $folder->messages( '!seen' ) ) {
       $msg->label( 'seen' => 1 ) ;
       &process( $msg ) ;
    }
    $folder->write ;


I think I missed it because I was too quick to follow the advice in the 
documention:

 [...] Do not call "read()" yourself: it will be called for you [...]


Best regards,

Gilles