Re: Anybody using ListDetector?
Robert Nicholson <[email protected]> Mon, 13 Oct 2003 10:49:25 +1000
| Newsgroups | gmane.comp.lang.perl.modules.mail-audit |
|---|---|
| Message-ID | <[email protected]> |
Never mind folks this tells me all I need to know
sub list_accept {
my $self = shift;
my $dir = shift;
$dir ||= $DEFAULT_DIR;
my $list = new Mail::ListDetector($self->{obj});
if (!(defined $list)) {
return 0;
} else {
my $name = $list->listname;
$name =~ tr/A-Za-z0-9_-//dc;
my $deliver_filename = join '/', $dir, $name;
$self->accept($deliver_filename);
return $deliver_filename;
}
}
On Monday, October 13, 2003, at 10:44 AM, Robert Nicholson wrote:
> Please forgive me I'm new to Maildir and this courierimap imap server
> that my isp is using.
>
> My question is whether or not ListDetector will work with courierimap
> because sub folders on
> this machine appear to be organised thus.
>
> drwx------ 10 users 4096 Oct 12 19:30 .
> drwx------ 12 users 4096 Oct 12 19:29 ..
> -rw-r--r-- 1 users 37 Oct 12 19:21 courierimapsubscribed
> -rw-r--r-- 1 users 52 Oct 12 19:00 courierimapuiddb
> drwx------ 5 users 4096 Oct 12 19:02 .crap
> drwx------ 2 users 4096 Oct 12 19:00 cur
> drwx------ 5 users 4096 Oct 12 19:21 .Folder.subfolder
> drwxr-xr-x 5 users 4096 Oct 12 19:31 .lists.ajug
> drwx------ 2 users 4096 Oct 12 19:00 new
> drwxr-xr-x 5 users 4096 Oct 12 19:15 .spam
> drwx------ 5 users 4096 Oct 12 06:04 .Testing
> drwx------ 2 users 4096 Oct 12 19:31 tmp
>
> .Folder.subfolder
>
> Will ListDetector always try to create a directory for the listname
> under the directory given to list_accept?
>
> For instance this is how my subfolders for mailing lists are created
>
> $mail->accept("$listsDir.$where/");
>
> where my $listsDir = "$mailDir/.lists";
>
> but with list_accept
>
> unless ($mail->list_accept("$mailDir/.lists/")) {
> print LOG "From: $from\nTo: $to\nDate: $date\nSubject: $subject\n
> accepting to folder crap\n\n";
> $mail->accept("$mailDir/.crap/");
> }
>
> So you see I have to provide the .'s and I'm pretty sure ListDetector
> won't do that for listnames. Now obviously
> I could write my Detector to append prefix the listname with . but if
> I specify
>
> list_accept($mailDir/.lists") will it produce the desired
> list_accept($mailDir/./lists.listname") structure or simply
>
> $mailDir/.lists/.listname
>
>
>
>
>
>
>
>
> _______________________________________________
> mail-audit mailing list
> [email protected]
> http://lists.netthink.co.uk/listinfo/mail-audit