mainGNU Mailutils - Support: sr #109866, Cannot set the encoding of message...

 
 

sr #109866: Cannot set the encoding of message body in MIME composition

Submitter:  None
Submitted:  Thu 01 Aug 2019 10:34:11 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  gray
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 08 Aug 2019 05:06:29 PM UTC, comment #6: 

I've tested with Mailutils 3.4 (Ubuntu 18.04 default) and it worked fine.

The encoding settings are applied as informed to both the attachment and the message body.

Thanks.

Gabriel Marques <gabriel_agm>
Tue 06 Aug 2019 01:12:28 PM UTC, comment #5: 

I've tried with no success, but the server where the script is being executed has an Ubuntu 16.04 installed. This means the mailutils version there is  2.99.99, and as you said some options were introduced in v3.2

The attachment encoding follow the options in the command line just fine, though.

I'was trying to update this package without breaking the server but had no luck so far, as I have no physical access to it and the "IT crowd" asked one week for a distro upgrade.

You can close the ticket as you gave me all the information required and no bug on the recent mailutils was identified.
It will take some time for me to test an up-to-date version, but I'll comment the results once done. Thanks.

Gabriel Marques <gabriel_agm>
Tue 06 Aug 2019 06:37:53 AM UTC, comment #4: 

Hi Gabriel,

Have you tried this? Can I close the issue?

Sergey Poznyakoff <gray>
Group administrator
Sat 03 Aug 2019 05:50:31 AM UTC, comment #3: 

Hi Gabriel,

Message body is affected by non-consumed --content-* options, i.e. options that are not followed by --attach or --attach-fd
options. Following your initial example:

   echo "special char: ção" | \
     mail --content-type='text/plain; charset=iso-8859-2' --attach MYFILE \
          --content-type='text/plain; charset=utf-8' -email is unavailable-

The MYFILE will be attached with charset iso-8859-2 and the actual mail body will have charset utf-8.

Hope that helps.

Sergey Poznyakoff <gray>
Group administrator
Fri 02 Aug 2019 08:58:44 PM UTC, comment #2: 

I've tried without the -a option, by using --content-type "text/plain; charset=UTF-8" after reading the wiki, before asking for help.
But as you said, the options affect all files attached after them. So, not the message body.

But in a MIME composition the message body text is the first multipart chunk, for which I cannot set the encoding.

So it seems this is a missing feature. Thanks for the support, though.

Gabriel Marques <gabriel_agm>
Fri 02 Aug 2019 12:18:38 PM UTC, comment #1: 

Hi,
Please don't use the -a option to modify any 'content-*' headers. There are special options for that purpose: --content-type, --content-name and --content-filename. The options affect all files attached after them in the command line and can be used multiple times to set different types or names for different attachments (the options appeared in mailutils 3.2). For details, please refer to this article: http://mailutils.org/wiki/Mail:_sending_attachments.

Sergey Poznyakoff <gray>
Group administrator
Thu 01 Aug 2019 10:34:11 PM UTC, original submission:  

Hello,
I'm trying to send automatic messages trough a script in an Ubuntu system, but the message encoding gets all damaged when an attachment is added.
Sending like this:
echo "special char: ção" | mail -s "hello" -a "content-type:text/plain; charset=UTF-8" --encoding
works.

But when I attach something it changes to MIME, and the encoding of the body cannot be set. It produces this in the first MIME chunk:

--326320393-1564695563=:14589
Content-ID: <20190801183923.14589@sixhw.certi.org.br>
Content-Type: text/plain
Content-Type: text/plain; charset=UTF-8

Removing the hand made header added with -a leaves only the first text/plain (no encoding).

I've bypassed the issue by sending a space as message body, and the body as a text attachment:
echo " " | mail -s "hello" --content-type "text/plain; charset=UTF-8" -A /tmp/body

And thunderbird shows the attachment content. But other clients may not.

Any help is appreciated.
using mail (GNU Mailutils) 2.99.99


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gabriel_agm (Posted a comment)
  • -email is unavailable- added by gray (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-11 gray StatusReady For Test Done
        Open/ClosedOpen Closed
    2019-08-03 gray StatusWorks For Me Ready For Test
    2019-08-02 gray StatusNone Works For Me
        Assigned toNone gray

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code