Angus,

The "=" to break lines is part of the so-called "quoted-printable" Content
Transfer Encoding, an alternative to base64 to pass binary content inside
a MIME message suitable to 7-bit transports such as the original SMTP.
It's convenient when there are few non-ASCII characters (e.g., sparse
ISO-8859 characters with umlauts) and/or overlong lines, whereas base64
makes the text unreadable but is more compact for true binaries such as
executables etc. However, in your case you might be able to get away with
plaintext non-MIME messages, because the line length limits (established
in pre-MIME times by RFC822, now updated by RFC2822:
http://www.ietf.org/rfc/rfc2822.txt ) are actually less restrictive:

 [...]
 - Lines of characters in the body MUST be limited to 998 characters,
   and SHOULD be limited to 78 characters, excluding the CRLF.
 [...]

Most MTA's in current use can handle long lines (> 78 chars but <= 998)
just fine.

Regarding uuencode: it's second parameter (or first, if there is just one
and the input is taken from stdin) is actually the remote filename, placed
together with the original attribute bits on the first line for retrieval
at decode time, and superfluous for MIME use (in which case, always pass
"-m" as well to use base64 encoding and remove first and last line). The
encoded output is always sent to stdout, so you should use:

 uuencode -m <myinputfile remotefilename >myoutfile

Cheers --

Enzo


----- Original Message ----- 
From: "Angus Comber" <[EMAIL PROTECTED]>
To: "Discussion of AstLinux - Asterisk on Compact Flash"
<[EMAIL PROTECTED]>
Sent: Thursday, February 23, 2006 2:41 AM
Subject: Re: [Astlinux-users] How to use ssmtp to send an attachment


> I see.
>
> I firstly had problems using uuencode.  ie uuencode -m myinputfile
> encodedfile  didn't work!  Stranglely.  Any ideas why?
>
> But actually all I want to do is email the Master.csv file periodically.
As
> it is text I can make up the email headers, add in the Master.csv text,
add
> a footer and then hey presto - I might actually get it to work!  But
problem
> is each line cannot be longer than 76 characters.  So the MIME rfc says
you
> need to put in a '=' as a soft break.  Any ideas on how to put in a =
and a
> carriage return after the 76th character in each line?
>
> Angus
>
>
>
> ----- Original Message ----- 
> From: "Enzo Michelangeli" <[EMAIL PROTECTED]>
> To: "Discussion of AstLinux - Asterisk on Compact Flash"
> <[EMAIL PROTECTED]>
> Sent: Wednesday, February 22, 2006 12:46 AM
> Subject: Re: [Astlinux-users] How to use ssmtp to send an attachment
>
>
> > ----- Original Message ----- 
> > From: "Angus Comber" <[EMAIL PROTECTED]>
> > To: "Astlinux Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 22, 2006 7:10 AM
> > Subject: [Astlinux-users] How to use ssmtp to send an attachment
> >
> >
> >> Hello
> >>
> >> I can send a standard email using ssmtp.  But how can I attach a
file.
> > I
> >> just want to email the Master.csv file on a regular basis.  What
would
> > be
> >> the easiest way to do this?
> >
> > Well, creating the RFC-822 message is a job for the UA (mail client)
not
> > an MTA like ssmtp. For MIME messages containing attachments doing it
> > manually requires a fair amount of work, especially if the attachment
is
> > binary. Astlinux doesn't have mmencode installed, but Busybox'
> > "uuencode -m" is a possible replacement (just cut off first and last
line
> > of the file sent to stdout). The MIME headers may be handcrafted,
basing
> > your code on a sample MIME message created by a "real" mail client and
> > consulting the documents from http://www.ietf.org/rfc/rfc2045.txt to
> > http://www.ietf.org/rfc/rfc2049.txt to clarify doubts...
> >
> > There is also an old command-line utility called "Metamail" that would
do
> > most of the work for you, but it's not included in Astlinux.
> >
> > Cheers --
> >
> > Enzo
> >
> > _______________________________________________
> > Astlinux-users mailing list
> > [email protected]
> > http://lists.kriscompanies.com/mailman/listinfo/astlinux-users
> >
> > Donations to support AstLinux are graciously accepted via PayPal to
> > [EMAIL PROTECTED]
> >
> >
>
>
>
> _______________________________________________
> Astlinux-users mailing list
> [email protected]
> http://lists.kriscompanies.com/mailman/listinfo/astlinux-users
>
> Donations to support AstLinux are graciously accepted via PayPal to
[EMAIL PROTECTED]
>

_______________________________________________
Astlinux-users mailing list
[email protected]
http://lists.kriscompanies.com/mailman/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to [EMAIL 
PROTECTED]

Reply via email to