LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How can I configure sendmail charset? (http://www.linuxquestions.org/questions/linux-software-2/how-can-i-configure-sendmail-charset-722676/)

Felipe 04-30-2009 06:19 AM

How configure sendmail charset? or a comand line client allowing to specify charset?
 
hallo:

I'm trying to send a mail with special characters (spanish characters: ).

If I send it from Outlook, a tag in header is added with:
Content-Type: text/plain; charset="iso-8859-1"
and its displayed fine in Outlook and Kontact.

If I send it form Kontact, a tag in header is added with:
Content-Type: text/plain; charset="utf-8"
and its displayed fine in Outlook and Kontact.

But if I send it from command line, with:
echo "Message *" | mail -s "Test" user@dom.com

No tag header is included and it's displayed wrong in Kontact and Outlook.

Tryed with
O DefaultCharSet=iso-8859-1
and
O DefaultCharSet=utf-8
in sendmail.cf and restarted service but no tag added.


Please, can you tell me how to configure sendmail to add a header to specify charset?

Thanks

Felipe

unSpawn 04-30-2009 06:31 AM

As far as I know adding headers that work on the message (as opposed to encapsulation like say datestamps and MTA routing) are not the domain of the MTA but the MUA (client). If you telnet to a MTA you would find that for instance a subject line is just a line in the message body. So either use a capable MUA or script in the right header yourself, for instance using a "here" document.

Felipe 04-30-2009 06:49 AM

Thanks for your answer.

And any command line client like mail where I can specify content-type header?



Thanks

unSpawn 04-30-2009 06:59 AM

I'm pretty sure (al)pine allows for custom headers in ~/.pinerc.

Felipe 04-30-2009 07:29 AM

Hallo:

Tried with
echo "body of message" | pine user@dom.com
but message is not sent. A screen is opened requesting to fill up the rest of the fields.

I'm looking for a non interactive mail client sender allowing me to configure the charset.

Any suggestion?

unSpawn 04-30-2009 08:44 AM

Apparently there's a patch needed to make use of (al)pine as non-interactive commandline mailer. You can try mutt or any other CLI MUA your distro comes with (fill in your LQ details, search your distro's repo's) or try composing a message submitting it to your MTA using, say, a "here" document.

jamilsalem 03-18-2012 07:24 AM

How configure sendmail charset?
 
Hi:

I'm trying to send a mail with special characters (Brasilian characters: ... ).

How can I configure sendmail charset? I am using Slackware 13 .

Please, anyone could me help?

Thanks

paulibox 03-13-2013 08:34 AM

Hi!
I'm sure this is still important for someone.

Try following example I made. In my case it helped a lot.

Code:

MailFile=/tmp/MailFile
MailBdy=/tmp/utf8testmail
Sender=sender@domain.com
Recipient=recipient@domain.net

echo "This is what I want to send." > $MailFile
echo "It contains special characters as following" >> $MailFile
echo "ľščťžĽŠČŤŽ or řŘ or or " >> $MailFile

#e-mail header
        echo From: $Sender > $MailBdy
        echo Subject: "$Subj - Unicode (UTF-8)" >> $MailBdy
        echo To: $Recipient >> $UsrMailBdy
        echo 'Content-Type: text/plain; charset="utf-8"' >> $MailBdy
        echo "">> $MailBdy
#e-mail body
        cat $MailFile >> $MailBdy

#converting created file from one encodind to the other
        iconv -f WINDOWS-1250 -t UTF-8 $MailBdy > $MailBdy.eml

        /usr/sbin/sendmail -t < $MailBdy.eml

rm $MailBdy.*
rm $MailFile



All times are GMT -5. The time now is 07:15 PM.