<<< Date Index >>>     <<< Thread Index >>>

Re: [mutt 1.3.27i] force base64 encoding from comand line



* Wed May 25 2005 robert guru <sos_linux@xxxxxxxxxxx>
> I want to know how to force mutt to encode any attachment file to Base64 
> encoding,
> i insist that because the receptor program can only deal with the base64 
> encoding.
> I would prefer from the command line option because mutt will be called 
> from a shell script..
> or, if  i have to modifiy a mutt configuration file is ok as a solution..!

I think you can configure your mime.types file (see the manual
section 5.2) to make any attachments application/octet-stream.

If you need even text/plain to be base64, you may make a macro
"macro compose y <edit-encoding>base64\n<send-message>" or
modify sendlib.c:

--- sendlib.c.BAK       Fri May 27 09:35:23 2005
+++ sendlib.c   Fri May 27 09:37:36 2005
@@ -1207,7 +1207,9 @@ static void mutt_set_encoding (BODY *b, 
   if (b->type == TYPETEXT)
   {
     char *chsname = mutt_get_body_charset (send_charset, sizeof 
(send_charset), b);
-    if ((info->lobin && ascii_strncasecmp (chsname, "iso-2022", 8)) || 
info->linemax > 990 || (info->from && option (OPTENCODEFROM)))
+    if (option (OPTFORCEBASE64)
+      b->encoding = ENCBASE64;
+    else if ((info->lobin && ascii_strncasecmp (chsname, "iso-2022", 8)) || 
info->linemax > 990 || (info->from && option (OPTENCODEFROM)))
       b->encoding = ENCQUOTEDPRINTABLE;
     else if (info->hibin)
       b->encoding = option (OPTALLOW8BIT) ? ENC8BIT : ENCQUOTEDPRINTABLE;
--- init.h.BAK  Fri May 27 09:37:43 2005
+++ init.h      Fri May 27 09:40:18 2005
@@ -601,6 +601,11 @@ struct option_t MuttVars[] = {
   ** sent to both the list and your address, resulting in two copies
   ** of the same email for you.
   */
+  { "force_base64",    DT_BOOL, R_NONE, OPTFORCEBASE64, 0 },
+  /*
+  ** .pp
+  ** If you need to encode all text parts to base64, set this option.
+  */
   { "force_name",      DT_BOOL, R_NONE, OPTFORCENAME, 0 },
   /*
   ** .pp
--- mutt.h.BAK  Fri May 27 09:40:39 2005
+++ mutt.h      Fri May 27 09:42:37 2005
@@ -348,6 +348,7 @@ enum
   OPTFCCATTACH,
   OPTFCCCLEAR,
   OPTFOLLOWUPTO,
+  OPTFORCEBASE64,
   OPTFORCENAME,
   OPTFORWDECODE,
   OPTFORWQUOTE,