LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-30-2009, 06:19 AM   #1
Felipe
Member
 
Registered: Oct 2006
Posts: 294

Rep: Reputation: 31
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

Last edited by Felipe; 04-30-2009 at 07:31 AM.
 
Old 04-30-2009, 06:31 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,005
Blog Entries: 54

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
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.
 
Old 04-30-2009, 06:49 AM   #3
Felipe
Member
 
Registered: Oct 2006
Posts: 294

Original Poster
Rep: Reputation: 31
Thanks for your answer.

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



Thanks
 
Old 04-30-2009, 06:59 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,005
Blog Entries: 54

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
I'm pretty sure (al)pine allows for custom headers in ~/.pinerc.
 
Old 04-30-2009, 07:29 AM   #5
Felipe
Member
 
Registered: Oct 2006
Posts: 294

Original Poster
Rep: Reputation: 31
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?
 
Old 04-30-2009, 08:44 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,005
Blog Entries: 54

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
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.
 
Old 03-18-2012, 07:24 AM   #7
jamilsalem
LQ Newbie
 
Registered: Mar 2012
Posts: 1

Rep: Reputation: Disabled
Exclamation 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
 
Old 03-13-2013, 08:34 AM   #8
paulibox
LQ Newbie
 
Registered: Mar 2013
Posts: 1

Rep: Reputation: Disabled
Lightbulb

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

Last edited by paulibox; 03-13-2013 at 08:37 AM. Reason: just formating
 
  


Reply

Tags
charset, sendmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
configure sendmail sumer Linux - Newbie 1 03-29-2009 11:24 AM
How to configure the charset in console? pujolasdf Linux - Software 2 04-12-2005 10:35 PM
how to configure sendmail juanb Linux - Software 0 09-19-2004 08:49 AM
configure sendmail Red Squirrel Linux - Software 5 04-12-2004 04:31 PM
fluxbox: configure charset with mozilla ? nautilus_1987 Linux - General 3 09-06-2002 02:17 PM


All times are GMT -5. The time now is 06:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration