Untested at the moment(*), but we were inadvertantly truncating
mailbox names with '/' due to our work-in-progress handling of
"/;UID=$NUM" parameter.
(*) strangely, my dovecot instance doesn't allow '/' by default,
so the change to xt/net_writer-imap.t is untested.
Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Link: https://public-inbox.org/meta/20210914175025.eq7s2shkc323itaf@meerkat.local/
my ($self) = @_;
my (undef, undef, $path) = uri_split($$self);
$path =~ s!\A/+!!;
my ($self) = @_;
my (undef, undef, $path) = uri_split($$self);
$path =~ s!\A/+!!;
- $path =~ s![/;].*\z!!; # [;UIDVALIDITY=nz-number]/;UID=nz-number
+ $path =~ s!/?;.*\z!!; # [;UIDVALIDITY=nz-number]/;UID=nz-number
$path eq '' ? undef : $path;
}
$path eq '' ? undef : $path;
}
my $cred = bless { username => $uri->user, password => $uri->password };
is($cred->{username}, undef, 'user is undef in array context');
is($cred->{password}, undef, 'password is undef in array context');
my $cred = bless { username => $uri->user, password => $uri->password };
is($cred->{username}, undef, 'user is undef in array context');
is($cred->{password}, undef, 'password is undef in array context');
+$uri = PublicInbox::URIimap->new('imap://u@example.com/slash/separator');
+is($uri->mailbox, 'slash/separator', "`/' separator accepted");
require_ok 'PublicInbox::NetWriter';
my $host = (split(/\./, hostname))[0];
my ($base) = ($0 =~ m!\b([^/]+)\.[^\.]+\z!);
require_ok 'PublicInbox::NetWriter';
my $host = (split(/\./, hostname))[0];
my ($base) = ($0 =~ m!\b([^/]+)\.[^\.]+\z!);
-my $folder = "INBOX.$base-$host-".strftime('%Y%m%d%H%M%S', gmtime(time)).
+my $SEP = $ENV{IMAP_SEPARATOR} || '.';
+my $folder = "INBOX$SEP$base-$host-".strftime('%Y%m%d%H%M%S', gmtime(time)).
"-$$-".sprintf('%x', int(rand(0xffffffff)));
my $nwr = PublicInbox::NetWriter->new;
chop($imap_url) if substr($imap_url, -1) eq '/';
"-$$-".sprintf('%x', int(rand(0xffffffff)));
my $nwr = PublicInbox::NetWriter->new;
chop($imap_url) if substr($imap_url, -1) eq '/';