Re: Spaces is message ids

Elizabeth Mattijsen <[email protected]> Fri, 21 May 2004 13:36:35 +0200
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <f0610051fbcd399e452f4@[192.168.56.6]>
At 10:52 +0000 5/21/04, Rich Caller wrote:
>I've only just started looking at these modules while looking into a 
>problem with perlwebmail and am not an expert in mail.
>
>   What was happening was that some messages where not being read 
>properly.  A bit of investigation indicated that these where 
>messages where the message id contained a space and was not 
>contained in <> and that the point of failure was the find method. 
>A quick check of the relevent messages seemed to indicate that 
>spaces where being replaces by +.
>
>So I modified the find function in Mail::Box to be....
>sub find($)
>{   my ($self, $msgid) = (shift, shift);
>     my $msgids = $self->{MB_msgid};
>
>     if($msgid =~ m/\<([^>]*)\>/s)
>     {   $msgid = $1;
>         $msgid =~ s/\s//gs;
>     }
>     else
>     {
>         $msgid =~ s/\s/+/gs;
>     }
>
>     $self->scanForMessages(undef, $msgid, 'EVER', 'ALL')
>         unless exists $msgids->{$msgid};
>
>     $msgids->{$msgid};
>}
>
>Thoughts, comments, better fixes please.....

Mark's on holiday for the next few weeks.

Your fix seems to be in order, on casual inspection.  However, I 
wonder whether spaces are allowed in message ID's at all.  And if 
they're not, the question becomes whether Mail::Box should adher to 
the RFC's, or should adapt to what's really out there.


Liz