]> Sergey Matveev's repositories - public-inbox.git/commitdiff
watch_maildir: allow '-' in mail filename
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 8 Feb 2018 03:32:05 +0000 (03:32 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 8 Feb 2018 03:32:05 +0000 (03:32 +0000)
Hostnames can contain '-' and this allows public-inbox-watch(1)
to work on machines which generate Maildir files with '-' in
them.

lib/PublicInbox/WatchMaildir.pm

index a3fab428fc3a4c14bfa3ef33fa4690bfabf20c8d..403b6cf951d8e1b4b18a7ad4a68615c410166f81 100644 (file)
@@ -170,7 +170,7 @@ sub _force_mid {
 sub _try_path {
        my ($self, $path) = @_;
        my @p = split(m!/+!, $path);
-       return if $p[-1] !~ /\A[a-zA-Z0-9][\w:,=\.]+\z/;
+       return if $p[-1] !~ /\A[a-zA-Z0-9][\-\w:,=\.]+\z/;
        if ($p[-1] =~ /:2,([A-Z]+)\z/i) {
                my $flags = $1;
                return if $flags =~ /[DT]/; # no [D]rafts or [T]rashed mail