summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-05-17 14:51:57 -0600
committerEduardo Chappa <chappa@washington.edu>2015-05-17 14:51:57 -0600
commit2c5b8f86507ffae788e49a161175faea21066a24 (patch)
tree28002a40435e8981b3b316880311dd59c3c7b7e2 /pith
parentc321daf6cf4a68fbe5166584fbf7d3b738d4c291 (diff)
downloadalpine-2c5b8f86507ffae788e49a161175faea21066a24.tar.xz
* Add the Control-R subcommand to the save command for attachments.
This subcommand toggles if the saving will be done in binary mode for text attachments. When a user saves an attachment using binary mode it will be saved as it was sent, otherwise the attachment will be transformed to UTF-8 for further transformation through internal and user defined filters for saving.
Diffstat (limited to 'pith')
-rw-r--r--pith/detach.c11
-rw-r--r--pith/detach.h2
-rw-r--r--pith/pine.hlp20
3 files changed, 28 insertions, 5 deletions
diff --git a/pith/detach.c b/pith/detach.c
index 0e0a07be..9befeb72 100644
--- a/pith/detach.c
+++ b/pith/detach.c
@@ -202,7 +202,7 @@ detach(MAILSTREAM *stream, /* c-client stream to use */
}
/* convert all text to UTF-8 */
- if(is_text){
+ if(is_text & !(flags & DT_BINARY)){
charset = parameter_val(body->parameter, "charset");
/*
@@ -261,7 +261,9 @@ detach(MAILSTREAM *stream, /* c-client stream to use */
* a multipart segment since an external handler's going to have to
* make sense of it...
*/
- if(is_text || body->type == TYPEMESSAGE || body->type == TYPEMULTIPART)
+ if((is_text & !(flags & DT_BINARY))
+ || body->type == TYPEMESSAGE
+ || body->type == TYPEMULTIPART)
gf_link_filter(gf_nvtnl_local, NULL);
/*
@@ -296,7 +298,7 @@ detach(MAILSTREAM *stream, /* c-client stream to use */
FILTLIST_S *p, *aux = NULL;
size_t count;
- if(aux_filters){
+ if(aux_filters && !(flags & DT_BINARY)){
/* insert NL conversion filters around remaining aux_filters
* so they're not tripped up by local NL convention
*/
@@ -336,7 +338,8 @@ detach(MAILSTREAM *stream, /* c-client stream to use */
for( ; aux_filters->filter ; aux_filters++)
gf_link_filter(aux_filters->filter, aux_filters->data);
- gf_link_filter(gf_nvtnl_local, NULL);
+ if(!(flags & DT_BINARY))
+ gf_link_filter(gf_nvtnl_local, NULL);
}
if((status = gf_pipe(gc, pc)) != NULL){ /* Second pass, sheesh */
diff --git a/pith/detach.h b/pith/detach.h
index 5fb0db4c..1ba90730 100644
--- a/pith/detach.h
+++ b/pith/detach.h
@@ -57,7 +57,7 @@ extern FETCH_READC_S *g_fr_desc;
*/
#define DT_NODFILTER (long) 0x10000
#define DT_NOINTR (long) 0x20000
-
+#define DT_BINARY (long) 0x40000
/* exported protoypes */
char *detach_raw(MAILSTREAM *, long, char *, gf_io_t, int);
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 08e57b91..e0411029 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -181,11 +181,14 @@ Additions include:
<UL>
<LI> Ignore message from smtp server after a successful authentication
challenge.
+
<LI> If SSLDIR is defined somehow, do not disable S/MIME if the
SSLCERTSDIR is not found.
+
<LI> When Alpine sends an attachment, it will set the boundary attribute
in lower case, as some SMTP servers, such as those of libero.it
reject messages if the boundary attribute is in uppercase.
+
<LI> SMIME: The ^E command that gives infromation on the certificate
is only available for messages that have a signed or encrypted
part.
@@ -232,6 +235,14 @@ Additions include:
<LI> Change in logic in imap_set_password function to make Alpine ask if
a user wants to save a password before reading the password file.
+
+ <LI> Add the Control-R subcommand to the save command for attachments.
+ This subcommand toggles if the saving will be done in binary mode
+ for text attachments. When a user saves an attachment using binary
+ mode it will be saved as it was sent, otherwise the attachment will
+ be transformed to UTF-8 for further transformation through internal
+ and user defined filters for saving.
+
</UL>
@@ -6724,6 +6735,15 @@ This subcommand will only be visible if the message actually has attachments.
You may also View the attachment list and save individual attachments from
there.
<P>
+If you are SAVING a text part (text/plain, text/html, etc.) you can use
+the Control-R subcommand to toggle if saving will be done in binary mode,
+meaning that the attachment will be decoded, but will not be transformed
+to UTF-8 for further processing (either in internal filters, or user
+supplied filters.) This is useful in case you either want to preserve
+the text as it was encoded originally to you, or the attachment was
+incorrectly attached (the attachment is not of text type) and you need
+the original text to process the attachment.
+<P>
You may cancel the Export operation by typing &quot;^C&quot; after exiting
this help.
<P>