Results 1 to 2 of 2

Thread: Charset problem with mailx

  1. #1
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Question Charset problem with mailx

    Hi

    I run into a problem with charsets and mailx.

    My setup is:

    SuSE-11-1, LANG=de_CH, Console using iso-8859-1 (no UTF-8)

    Task: Apache (user wwwrun) sends email from a *.cgi script which is a bash script. German language with umlauts is used. The relevant part of the script looks like this:

    Code:
    echo "$MSG" | env MAILRC=/dev/null \
    ttycharset=iso-8859-1 sendcharsets=iso-8859-1 \
    mailx -n -s "$SUBJ" \
    -a "${DOC}.pdf" \
    -c "someone@domain.ch" -r "someone@domain.ch" \
    recipient@domain.ch
    Looking at the received message with pine shows:

    Code:
    Parts/Attachments:
       1 Shown    11 lines  Text (charset: UTF-8)
       2   OK     31 KB     Application
    Pine's display character set is set to ISO-8859-1. Looking at the mailbox file reveals that the message is indeed encoded in UTF-8. However, the text fed into mailx is iso-8859-1.

    Any ideas what I can do to send messages in the iso-8859-1 character set?

  2. #2
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: Charset problem with mailx

    Ok, responding to myself

    The solution is as simple as this: mailx in SuSE-11.1 is broken. Upgrading to the latest version 12.4 of Heirloom mailx solves the problem. Sources can be found at Heirloom mailx.

    Correct usage would be:

    Code:
    echo "Some message" | mailx -s "The subject" -a attachment.pdf -S ttycharset=iso-8859-1 -S sendcharsets=iso-8859-1 -S encoding=8bit mail.user@domain.tld

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •