>>>>>>>> On Thu, July 27, 2023 9:57 pm, Paul Lesniewski wrote: >>>>>>>>>> I am writing to report an issue with SquirrelMail 1.4.23-svn. >>>>>>>>>> We have a Linux server with the following environment : >>>>>>>>>> 1. Apache/2.4.39 with OpenSSL/1.1.1l >>>>>>>>>> 2. PHP 7.3.4 >>>>>>>>>> 3. squirrelmail-20190221_0201-SVN.locales.tar.bz2 >>>>>>>>>> 4. Six SquirrelMail plugins >>>>>>>>>> compatibility-2.0.16-1.0 >>>>>>>>>> html_mail-2.3-1.4 >>>>>>>>>> tnef_decoder-1.0-1.4.0 >>>>>>>>>> undelete-2.0-1.4.0 >>>>>>>>>> view_as_html-3.8 >>>>>>>>>> vlogin-3.10.2-1.2.7 >>>>>>>>>> 5. access two IMAP servers >>>>>>>>>> one runs "Panda IMAP 2010.417" (built from Alpine-2.26 >>>>>>>>>> package) >>>>>>>>>> one runs "Microsoft Exchange IMAP4" >>>>>>>>>> This copy of SquirrelMail works perfectly. >>>>>>>>>> Recently, we upgraded SquirrelMail to >>>>>>>>>> "squirrelmail-20230725_0200-SVN.stable.tar.bz2". >>>>>>>>>> Exactly the same configurations are applied to the new tree. >>>>>>>>>> The "<path to squirrelmail>/src/configtest.php" reports no >>>>>>>>>> error. >>>>>>>>>> Users login are successful but the right frame shows the >>>>>>>>>> following >>>>>>>>>> error >>>>>>>>>> : >>>>>>>>>> # Connect to Panda IMAP >>>>>>>>>>> ERROR: Bad or malformed request. >>>>>>>>>>> Query: FETCH 1,32 (FLAGS UID RFC822.SIZE INTERNALDATE >>>>>>>>>>> BODY.PEEK[HEADER.FIELDS >>>>>>>>>>> (Date To Cc From Subject X-Priority Importance Priority >>>>>>>>>>> Content-Type >>>>>>>>>>> )]) >>>>>>>>>>> Server responded: Syntax error in header fields >>>>>>>>>> # Connect to Microsoft Exchange >>>>>>>>>>> ERROR: Bad or malformed request. >>>>>>>>>>> Query: FETCH >>>>>>>>>>> 23448:23449,23537,24173,24213,24402,24433,24452,24468,24505,24637,24673:24676 >>>>>>>>>>> (FLAGS UID RFC822.SIZE INTERNALDATE BODY.PEEK[HEADER.FIELDS >>>>>>>>>>> (Date >>>>>>>>>>> To >>>>>>>>>>> Cc >>>>>>>>>>> From >>>>>>>>>>> Subject X-Priority Importance Priority Content-Type )]) >>>>>>>>>>> Server responded: Command Argument Error. 11 >>>>>>>>> I just enabled the "info" plugin, went to Options --> IMAP server >>>>>>>>> information, enabled the first three example commands, and >>>>>>>>> entered >>>>>>>>> a >>>>>>>>> cut-and-paste of the command from your report, adjusting the >>>>>>>>> requested >>>>>>>>> IDs >>>>>>>>> for my inbox count... as an example: >>>>>>>>> FETCH 1710:1712,1716 (FLAGS UID RFC822.SIZE INTERNALDATE >>>>>>>>> BODY.PEEK[HEADER.FIELDS (Date To Cc From Subject X-Priority >>>>>>>>> Importance >>>>>>>>> Priority Content-Type )]) >>>>>>>>> The server didn't have any problems with this command. Can you >>>>>>>>> please >>>>>>>>> use >>>>>>>>> the "info" plugin to further diagnose? Can you sniff the IMAP >>>>>>>>> traffic >>>>>>>>> for >>>>>>>>> an older instance that is working as well as the new installation >>>>>>>>> and >>>>>>>>> compare how the commands look different? >>>>>>>> You can also open up functions/imap_messages.php and find both >>>>>>>> instances >>>>>>>> of $extra_small_header_fields in the FETCH commands (approximately >>>>>>>> lines >>>>>>>> 750 and 752) and remove it and the space before it. There is a >>>>>>>> chance >>>>>>>> that >>>>>>>> your IMAP servers are being fussy about one extra space. If you >>>>>>>> can >>>>>>>> confirm that is the issue, I can issue a fix. >>>>>>> >>>>>>> Yes, removing $extra_small_header_fields for FETCH in >>>>>>> "functions/imap_messages.php" solves the problem immediately if no >>>>>>> plugin is used. >>>>>>> >>>>>>> When I put back the plugin "vlogin", users cannot login (in both >>>>>>> implementations). >>>>>>> >>>>>>> What other workaround is required ? >>>>>> >>>>>> Please first apply this patch and try it again "the right way" (you >>>>>> can >>>>>> also wait to grab the next nightly build tarball) >>>>>> >>>>>> https://sourceforge.net/p/squirrelmail/code/14991/ >>>>>> >>>>>> Otherwise, the vlogin problem sounds unrelated and would need logs >>>>>> and >>>>>> further diagnosis. >>>>> >>>>> The patch does not help. >>>> >>> About your "official" patch, I am sorry to inform you that it really >>> does not work. >>> For the patch to work, the string "$extra_small_header_fields" must be >>> removed from the two FETCH lines, as you have said at the beginning. >> >> Did you apply the patch as given from the original unmodified file or do >> it by hand? There should not be any extra spaces in the resulting FETCH >> command. Can you please output the contents of >> $extra_small_header_fields >> just above where it is being used to ensure it is empty? You can do that >> with something such as: >> echo "<hr>extra_small_header_fields:<br>"; >> var_dump($extra_small_header_fields); echo "<hr>"; > > The patch was applied to the original "functions/imap_messages.php" file. > > Your codes are inserted just above the "if ($internaldate) {" block. > The output is : > | ---------------------------------------- > | extra_small_header_fields: > | string(1) " " > | ---------------------------------------- > | ERROR: > | ERROR: Bad or malformed request. > | Query: FETCH > 2375,2381,2385,2421,2448,2451,2454,2457,2463,2467,2469,2508,2510,2534,2547 > (FLAGS UID RFC822.SIZE INTERNALDATE BODY.PEEK[HEADER.FIELDS (Date To > Cc From Subject X-Priority Importance Priority Content-Type )]) > | Server responded: Syntax error in header fields Are you using a newer version of the Message Flags plugin? I'm not sure anyone should be populating $extra_small_header_fields In any case, I added one more safety against what you have shown here: https://sourceforge.net/p/squirrelmail/code/14992/ Do you mind testing to ensure this closes the issue? Thanks for your help, -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php ----- squirrelmail-users mailing list Posting guidelines: http://squirrelmail.org/postingguidelines List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx List archives: http://news.gmane.org/gmane.mail.squirrelmail.user List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users