Hi Jens, You complan about the 2048 Bytes sounds realy weird, because base64 encoded attachment should not have (-> please read the RFC's) more then 72 Bytes per line.
If you modify the source code you schould know, that some MTA's can reject such messages do to a violation of the RFC's. courier-mta reject by default or convert the faulty mail to an attachment which the is send to the originating recipient depending on its configuration. Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant Am 2009-05-20 07:12:21, schrieb Jens-Dietrich Möller: > Package: ssmtp > Version: 2.62-1 > Severity: normal > Tags: patch > X-Debbugs-CC: jensdietrich.moel...@auerswald.de > > Hello *, > > I am using ssmtp to send emails from an embedded system. So I grabbed that > ssmtp_2.62.orig.tar.gz from your debian package server and compiled it on my > own. What I do with it is to send emails containing attachements of several > megabytes. Well, I already found at least one problem: > > If the base64 encoded attachement data is NOT split into lines of less than > 2048 characters, the buffer-handling in ssmtp looses data. > > So I applied the following patch: > > diff -u -r -N ssmtp/ssmtp.c ssmtp-neu/ssmtp.c > --- ssmtp/ssmtp.c 2008-03-06 21:01:22.000000000 +0100 > +++ ssmtp-neu/ssmtp.c 2009-05-19 14:01:17.000000000 +0200 > > */ > ssize_t smtp_write(int fd, char *format, ...) > { > - char buf[(BUF_SZ + 1)]; > + char buf[(BUF_SZ + 3)]; > va_list ap; > ssize_t outbytes = 0; > > va_start(ap, format); > - if(vsnprintf(buf, (BUF_SZ - 2), format, ap) == -1) { > + if(vsnprintf(buf, (BUF_SZ + 1), format, ap) == -1) { > die("smtp_write() -- vsnprintf() failed"); > } > va_end(ap); > > > With this, I do not need to split the attachement into small lines and slow > down the transmission. BTW: Do you know the original author of this code? > Whom do I have to contact for code contribution? > > Thanks so far, > > Jens Möller > > To: ani...@debian.org > santi...@debian.org ------------------------ END OF REPLIED MESSAGE ------------------------ -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ ##################### Debian GNU/Linux Consultant ##################### <http://www.tamay-dogan.net/> Michelle Konzack <http://www.can4linux.org/> Apt. 917 <http://www.flexray4linux.org/> 50, rue de Soultz Jabber linux4miche...@jabber.ccc.de 67100 Strabourg/France IRC #Debian (irc.icq.com) Tel. DE: +49 177 9351947 ICQ #328449886 Tel. FR: +33 6 61925193
signature.pgp
Description: Digital signature