Re: SquirrelMail adds line feed character to attachments

Stefan G <[email protected]> Tue, 27 Aug 2024 21:08:36 +0000
Newsgroups gmane.mail.squirrelmail.user
Message-ID <AM9PR08MB5969A71BF47F02FEB7F5E8D6D0942@AM9PR08MB5969.eurprd08.prod.outlook.com>
Hi Dwok,

Yes, pretty sure. I connect to the same IMAP-server from OSX Mail, and it d=
oes not have this issue.

What I did find out is that if I disable the function 'mime_print_body_line=
s()', the downloaded file is 1 byte consisting of 0x0a. So my interpretatio=
n of this (which might be incorrect) is that the 0x0a is not generated by t=
he code that processes/decodes the attachment, but by another part of the c=
ode.

Best, Stefan

-----

Hi Stefan,

2024.Augusztus 27.(K) 13:41 id=F5pontban Stefan G ezt =EDrta:
> Hi Paul,
>
> I looked into this, and it turns out I was wrong in my conclusion that
> text files are not affected.
>
> It now seems that when sending text files (but not other file types)
> SquirrelMail strips boths 0x0a and 0x0d 0x0a from the end of the file.
> When downloading files through SquirrelMail, it will add a 0x0a. So when I
> send a text file through SquirrelMail to myself that ended on a 0x0a, when
> I download it it will have the same size but the 0x0a has moved from the
> end to the start. If it ended on 0x0d 0x0a it will be one byte shorter and
> will also start with 0x0a.
>
> When I send a pdf to myself through SquirrelMail (which also ends with
> 0x0a), the 0x0a at the end does not get removed. When downloading the
> attachment, a 0x0a does get added to the beginning. JPEG's end with 0xff
> 0xd9, and they get a 0x0a added to the beginning as well when downloading
> while they are send correctly.
>
> So to summarize:
> - the issue with downloading attachments now seems independent of
> file-type and whether the file ends on 0x0a, 0x0d 0x0a or something else.
> - when sending an attachment something specific to text does seem to
> happen, and both 0x0a and 0x0d 0x0a get stripped from the end of the file.

Are you sure, that these symptoms are squirrel only and doesn't happen
with other IMAP clients?

Dwok
--
dr T=F3th Attila, Radiol=F3gus, 06-20-825-8057
Attila Toth MD, Radiologist, +36-20-825-8057

>
> Best, Stefan
>
>
>
> On Mon, August 26, 2024 6:40 pm, Stefan G wrote:
>> Hi all,
>>
>> I just noticed that SquirrelMail adds a line feed character to files
>> when
>> downloading attachments. This does not happen when sending attachments.
>> The attachments are correctly stored on the server: for example in OSX
>> Mail and iOS Mail there is no problem with the same attachments. The
>> problem is browser-independent (tested on various OSX and Windows web
>> browsers). The problem is also independent of the attachment type
>> (except
>> for plain text attachment, with the exception of plain text attachments.
>> Since I don't use my webmail often I have no idea when the problem
>> started; I think somewhere in the first half of this year. The problem
>> occurs both with the newest version of SquirrelMail and an older version
>> I
>> tried from 2017, so it probably has to do with some sort of
>> incompatibility of the code with newer versions of php.
>>
>> Software: Debian 11, Dovecot 2.3. 13, php 7.4, SquirrelMail 1.4. 23 SVN.
>>
>> Curious if anyone has an idea on how to fix this. It's driving me nuts
>> :).
>
> Sorry, also might be helpful to know if it's a \n or a \r\n  on the end
>
> --
> 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: [email protected]
> List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
> List info (subscribe/unsubscribe/change options):
> https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
>
> -----
> squirrelmail-users mailing list
> Posting guidelines: http://squirrelmail.org/postingguidelines
> List address: [email protected]
> List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
> List info (subscribe/unsubscribe/change options):
> https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
>




-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge=
.net/lists/listinfo/squirrelmail-users

-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge=
.net/lists/listinfo/squirrelmail-users