Question

My .procmailrc (really simple):

:0c
| $HOME/send_sms.sh "`formail -xFrom:`" "`formail -xSubject:`"

So, sender named "mail@domain.com" sends message with subject "Subject test ąść". The script "send_sms.sh" receives:

Sender: =?UTF-8?Q?mail@domain.com?= <mail@domain.com>

Subject: =?UTF-8?Q?Subject_test_=C4=85=C5=9B=C4=87?=

How should I modify my .procmailrc to get clear text? Or convert this in my script send_sms.sh ?

Was it helpful?

Solution

http://metacpan.org/pod/Email::MIME::RFC2047::Decoder has a simple RFC2047 decoder in Perl. You should perhaps only decode strings which are in a character set you can support, but all your examples are in UTF-8, so if your script supports sending UTF-8 in SMS, you should be fine. For other character sets, perhaps you can convert into UTF-8 in a separate step before sending.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top