linux-il  

Re: HTML email question

Yedidyah Bar-David
Wed, 28 Nov 2007 08:10:31 -0800

On Wed, Nov 28, 2007 at 05:40:33PM +0200, Hetz Ben Hamo wrote:
> Hi,
> 
> On Nov 28, 2007 4:53 PM, Oded Arbel <[EMAIL PROTECTED]> wrote:
> >
> > On Wed, 2007-11-28 at 15:36 +0200, Hetz Ben Hamo wrote:
> > > I'm trying to write a very simple shell script which creates a simple
> > > hebrew text file, which is then being sent by email using sendmail.
> >
> > > echo "Subject: =?UTF-8 úéøáòá äòãåä=" >> mail.txt
> >
> > Read RFC 1522 on how to encode non-7bit text into headers. you can use
> > either base64 or quoted-printable to "ascii armor" your text and it
> > requires a special format as Lior Okman noted.
> >
> 
> Oh boy, I love those RFC's (specially when they mention 1 thing, and
> the real world has other things) :)

That's not true. A very small and inaccurate test I did with various
clients showed that all common ones can be configured to obey these RFCs
and they behave correctly when getting a complying message. The problems
arise when a client is configured to not be compliant and sends emails
that the other side, in order to parse, needs to play some heuristics.

> Anyway, I was wondering about a small issue which I cannot seem to
> find why it happens here..
> 
> see this:
> 
> $ cat shalom.txt
> hello world
> $ base64 shalom.txt > shalom.enc
> $ base64 -d shalom.enc
> hello world
> base64: invalid input
> 
> Anyone knows why it's "invalid input" ?

No idea, but as others suggested - I'd do this with a P-language, not
sh. Usually their builtin MIME etc. library functions are much easier to
work with. Google for your favourite one plus 'mime mail tutorial' and I
think you'll get some good intros.
-- 
Didi


================================================================To unsubscribe, 
send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]