Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 132381
Status: new
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: Nobody in particular
Requestors: radomirpolach [...] protonmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Re: append_string fails to get id from APPEND in more complex answer
Date: Sun, 19 Apr 2020 14:35:58 +0000
To: "bug-Mail-IMAPClient [...] rt.cpan.org" <bug-Mail-IMAPClient [...] rt.cpan.org>
From: Ing. Radomír Polách <radomirpolach [...] protonmail.com>
Fix of last line: my $ret = $data =~ m#\s+(\d+)\s*\]\s+APPEND# ? $1 : $self; Ing. Radomír Polách ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Sunday, April 19, 2020 4:34 PM, Ing. Radomír Polách <radomirpolach@protonmail.com> wrote: Show quoted text
> I am having answers like these: > > 20 APPEND Folders/Test (\Seen) "09-Apr-2020 12:21:44 +0000" {3032}+ send literal > * 1 EXISTS > * OK [UNSEEN 0] > * 1 FETCH (FLAGS (\Seen nonjunk) UID 7) > 20 OK [APPENDUID 5 7] APPEND successful > > This coauses this line: > my $ret = $data =~ m#\s+(\d+)\]# ? $1 : $self; > To produce 0 from [UNSEEN 0]. > > Needs to be replace with a least something like: > my $ret = $data =~ m#\s+(\d+)\]\s+APPEND# ? $1 : $self; > > But I can image more complex answers, for example spaces after id: > 20 OK [APPENDUID 5 7 ] APPEND successful > > So maybe even: > my $ret = $data =~ m#\s+(\d+)\s+\]\s+APPEND# ? $1 : $self; > > The current regular expression is extremely fragile. > > Ing. Radomír Polách