Mail::Server::IMAP4::List(3pm) | User Contributed Perl Documentation | Mail::Server::IMAP4::List(3pm) |
Mail::Server::IMAP4::List - folder related IMAP4 answers
my $imap = Mail::Server::IMAP4::List->new ( folders => $folders # Mail::Box::Identity , inbox => $inbox # Mail::Box , delimiter => '#' ); my $imap = Mail::Server::IMAP4::List->new(user => $user); print $imap->list(...); # for LIST command
-Option --Default delimiter '/' folders <from user> inbox <from user> user <undef>
example: setting-up an IMAP4 delimiter
sub delim($) { my $path = shift; my ($delim, $root) = $path =~ m/^(#news\.)/ ? ('.', $1) = $path =~ m!^/! ? ('/', '/') : ('/', ''); wantarray ? ($delim, $root) : $delim; } my $list = Mail::Server::IMAP4::List->new(delimiter => \&delim, ...); print $list->delimiter('abc/xyz'); # returns a / (slash) and '' print $list->delimiter('#news.feed'); # returns a . (dot) and $news. print $list->delimiter(''); # returns default delimiter
example: using IMAP list
my $imap = Mail::Server::IMAP4::List->new(delimiter => \&delim, ...); local $" = ';'; my @lines = $imap->list('', ''); # returns the default delimiter print ">@{$lines[0]}<"; # >(\Noselect);/;< my @lines = $imap->list('#news',''); # specific delimiter print ">@{$lines[0]}<"; # >(\Noselect);.;< my @lines = $imap->list('top/x/', '%'); print ">@$_<," foreach @lines; # >();/;/tmp/x/y<,>(\Marked);/;/tmp/x/z<
See
This module is part of Mail-Box-IMAP4 distribution version 3.007, built on June 13, 2019. Website: http://perl.overmeer.net/CPAN/
Copyrights 2001-2019 by [Mark Overmeer]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
2022-12-01 | perl v5.36.0 |