Bug 3571

Summary: recipient list lost and truncated
Product: Claws Mail (GTK 2) Reporter: Ricardo Mones <mones>
Component: UI/Compose WindowAssignee: users
Status: RESOLVED FIXED    
Severity: major    
Priority: P3    
Version: 3.13.1   
Hardware: PC   
OS: Linux   
URL: https://bugs.debian.org/801854
Attachments:
Description Flags
MH draft message triggering the bug
none
Message view with truncated list of recipients
none
Compose window with truncated list of recipients none

Description Ricardo Mones 2015-11-28 17:29:39 UTC
Created attachment 1610 [details]
MH draft message triggering the bug

This was reported originally at Debian bug #801854 as a problem with an incoming mail. But I've checked and Claws Mail itself can generate a mail which cannot read later :-(

To summarise the problem: if the size of the recipient list exceeds certain size the list of addresses generated in the compose window is lost.

Steps to reproduce:

* Open compose window
* Add a large number of recipients or not so large but with large addresses¹.
* Save to drafts
* Optional: check the MH file and verify that the list is correctly saved
* Reopen or reedit drafted message

Current result in message view after reopening:
* The list is truncated at some point, no address boundaries are respected.

Current result in compose window after reediting:
* The list of recipients appears incomplete, last address is truncated at some point. Rest of addresses are completely lost.

Expected result: complete list of addresses on both windows.

Attached a mail created with CM which triggers the bug.

¹ Large seems to mean over 8192 bytes of recipients, though not confirmed, because of the BUFSIZE size found on some buffer used by the intermediate functions.
Comment 1 Ricardo Mones 2015-11-28 17:31:02 UTC
Created attachment 1611 [details]
Message view with truncated list of recipients
Comment 2 Ricardo Mones 2015-11-28 17:31:29 UTC
Created attachment 1612 [details]
Compose window with truncated list of recipients
Comment 3 wwp 2017-01-13 09:27:24 UTC
Even displaying the draft message w/o opening it for edition shows truncated recipients list. Investigating..
Comment 4 users 2017-01-16 16:45:03 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2017-01-16 16:45:03.254801283 +0100
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=1e61dd9a91481b33bceaf39cda057dfb2ffa8a30
Merge: 087e046 989b3a3
Author: Colin Leroy <colin@colino.net>
Date:   Mon Jan 16 16:45:02 2017 +0100

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=989b3a3f51c691b0bb0fd48521063a8c76d269ce
Author: wwp <wwp@free.fr>
Date:   Mon Jan 16 16:35:13 2017 +0100

    Fix bug 3571, 'recipient list lost and truncated'
    by replacing lots of fixed-size buffers with dynamically
    allocated ones.
    Also enforce checks by adding or fixing few sanity tests,
    fix returned value of some functions in some tricky cases.