From 076f1322ba8fd0386760fc68a9df9efd34afe4a6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 14 Sep 2021 19:35:28 +0000 Subject: uri_imap: handle '/' as an IMAP hierarchy separator 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 Link: https://public-inbox.org/meta/20210914175025.eq7s2shkc323itaf@meerkat.local/ --- xt/net_writer-imap.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xt') diff --git a/xt/net_writer-imap.t b/xt/net_writer-imap.t index 0a4cea68..f1228090 100644 --- a/xt/net_writer-imap.t +++ b/xt/net_writer-imap.t @@ -19,7 +19,8 @@ require_mods('Mail::IMAPClient'); 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 '/'; -- cgit v1.2.3-24-ge0c7