After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 60874 - forward and postpone/continue problems
forward and postpone/continue problems
Status: VERIFIED FIXED
Product: balsa
Classification: Other
Component: general
1.2.x
Other All
: Normal enhancement
: ---
Assigned To: Balsa Maintainers
Balsa Maintainers
Depends on:
Blocks: 52604
 
 
Reported: 2001-09-21 10:25 UTC by albrecht.dress
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
gzipped-patch-package (9.07 KB, application/octet-stream)
2001-09-21 10:33 UTC, albrecht.dress
Details

Description albrecht.dress 2001-09-21 10:25:37 UTC
The current handling of the forward and postpone/continue features of balsa has the following problems:

* postpone/continue: If a message containes attachments which are not of type text, they will be lost upon continue. All text parts, both the "real" text and text attachments, will be glued together as new text part.

* forward: almost the same problem. All text parts are forwarded together, any other attachment is lost. However, here the problem is a little different, as some people prefer exactly this kind of forwarding. An other proper way of forwarding a message is attaching it completely "as is" with mime type message/rfc822 as described in RFC 2046.
Comment 1 albrecht.dress 2001-09-21 10:33:01 UTC
Created attachment 5653 [details]
gzipped-patch-package
Comment 2 albrecht.dress 2001-09-21 10:36:02 UTC
Here is a quite big patch which tries to fix these points... 

* postpone/continue now works as expected. No attachment is lost,
  their filenames are kept, and only the first text/plain part is
  considered to be the "real" text of the message. 

* the `forward' menu entries are replaced by `forward attached' and
  `forward quoted'. `Forward quoted' works exactly as the current
  implementation. `Forward attached' takes the complete message "as
  is" and attaches it as message/rfc822 according to RFC 2046. In the
  latter case, there is no chance whatsoever to change this attachment
  in any way.

As most users (like me ;-)) will prefer either one way or the other,
it is possible to set the "default forward action" for the forward
button to one of these methods in the preferences->mail 
options->outgoing notebook (I am not really happy with the button 
label, maybe someone with better knowledge of englich might help 
there?).



CODE DETAILS
============

Basically, we need a possibility to force the mime type of an 
attachment (as there is no way to detect that an attachment is a 
message/rfc822) and an alternative method to save attachments from a 
postponed message to temp files in order to keep the original names 
(remember that it is not possible to attach something in memory to a 
message, and that a user might attach several different files with the 
same basename). The latter problem is solved by creating a temporary 
folder for each file in which the file is saved with the original 
name.


libmutt stuff
-------------

* libmutt/sendlib.c:
If an attachment has the disposition type `inline', don't include the 
filename (see RFC 2183).


libbalsa stuff
--------------

* libbalsa/body.[hc]
Always define the field mime_type in the _LibBalsaMessageBody 
structure (was already used for the MDN reply feature). If it is != 
NULL, force this mime type, otherwise try to determine it as before 
(from the file name and/or contents).

* libbalsa/message.[hc]
Add function libbalsa_message_save() which saves the complete message 
"as is" in a file. This is mostly a copy of other routines (like 
libbalsa_message_copy), does almost no error checking, and might 
therefore need further improvement.

* libbalsa/mime.[hc]
Make function process_mime_part() extern instead of static (needed 
later in src/sendmsg-window.c).

* libbalsa/send.c
- Don't make body->mime_type BALSA_MDN_REPLY-dependent (see above).
- Check if body->mime_type is set and use it in this case for 
postponing and sending.
- If the mime type is message/rfc822, force the encoding to 8 bit and 
the disposition to inline (this might be expanded later to handle mor 
mime types this way).
- Some smaller changes (remove duplicated statement, lock/unlock mutt 
around calling mutt functions).


balsa stuff
-----------

* src/balsa-app.h
Added a gboolean forward_attached to the balsa_app structure to select 
if the forward button should attach or quote the message.

* src/balsa-index.[hc]
Replace the balsa_message_forward() callback function by three new 
ones to handle quoted, attached and default forwarding.

* src/sendmsg-window.[hc] (the main bunch of changes...)
- Replace the SEND_FORWARD element of SendType by SEND_FORWARD_ATTACH 
and SEND_FORWARD_QUOTE.
- Change the definition of add_attachment() to take two additional 
parameters (flag if it is a temp file in an own subfolder which is 
removed after processing, and the forced mime type).
- Introduces a struct which describes the filename of an attachment 
(the only thing which was there before), a field for the forced mime 
type, and a flag if the file should be deleted after sending or not. 
The last field is needed as libmutt (?) can delete temp files, but not 
folders. Therefore an "attachment destructor" is defined which does 
this (see below).
- New function destroy_attachment() to free this structure and, if 
necessary, unlink the file and delete the temp directory.
- add_attachment() checks if a special mime type was forced and sets 
the struct (instead of only the filname) as icon_data. Also connects 
to the destroy handler to free temp stuff.
- Some changed calls to add_attachment().
- continueBody() takes only the first text/plain part with a NULL 
filename of the postponed message as message text and adds all other 
parts as attachments.
- quoteBody() does not quote the mail upon SEND_FORWARD_ATTACH but 
inserts some header information instead.
- sendmsg_window_new() saves the original message and attaches it as 
message/rfc822 for SEND_FORWARD_ATTACH.
- bsmsg2message(): always duplicate the attachment's filename as the 
destroy method will take care of freeing it.
- some changed calls to bsmsg2message().

* src/main-window.c
- Replace the forward_message_cb() callback function by three new ones 
to handle quoted, attached and default forwarding.
- New/changed menu definitions.

* src/main.c
Small changes due to changed add_attachment() prototype.

* src/message-window.c
- Replace the forward_message_cb() callback function by three new ones 
to handle quoted, attached and default forwarding.
- New/changed menu definitions.

* src/pref-manager.c
Added togggle button to define the `default' forward behaviour 
(forward button).

* src/save-restore.c
Handle forward_attached from balsa_app structure.
Comment 3 Pawel Salek 2001-09-22 16:59:51 UTC
Thanks for such a detailed description.

The patch is in (with minor changes: the original version would on
continuing messages with empty text body since process_mime_part would
return NULL).
Comment 4 Pawel Salek 2001-10-15 07:03:58 UTC
I realized some documentation of the menu options and preference
configurations would be appreciated to avoid questions on balsa-list.
Comment 5 Pawel Salek 2002-04-25 08:43:58 UTC
balsa-1.3.5 and 2.0.0 released, closing this report for good.