Ildar,
the best thing to do to debug SMTP (if possible): 1. Turn off encryption 2. tcpdump -ni eth0 -s 2000 -w /tmp/smtp.pcap 3. if any, replace private info from the file with "xxxx"
I did that and got a file of several hundred lines (well, after converting to text with tcpdump -r, actually) most of which I do not understand at the first glance. They might contain private data, the might not – if there is no other way, I will go back there, but for now I am going to look for an easier way.
Pawel,
Yes, you are interested in the file containing EHLO. Is the session encrypted? (Look for starttls in that file). Running strace -s8192 will print long string, but only if the session is unencrypted.
I was able to turn off encryption and tried this. The log files shows, that Balsa does indeed convert the single dot to two dots and sends the whole message:
write(12, "Date: Tue, 25 Oct 2011 16:03:33 +0200\r\nFrom: Carlos Franke <carlos_franke lavabit com>\r\nSubject: tessst\r\nTo: carlos_franke lavabit com\r\nX-Mailer: Balsa 2.4.10\r\nMessage-Id: <1319551418.22664.0@Gaufrier>\r\nMIME-Version: 1.0\r\nContent-Type: multipart/signed; protocol=\"application/pgp-signature\";\r\n\tmicalg=PGP-SHA1; boundary=\"=-UCesP8ARTLj0ae/rIXux\"\r\n\r\n--=-UCesP8ARTLj0ae/rIXux\r\nContent-Type: text/plain; charset=UTF-8; DelSp=Yes; Format=Flowed\r\nContent-Disposition: inline\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n\r\nkann ich nat=C3=BCrlich versuchen, so fr=C3=BCh wie m=C3=B6glich da zu sein=\r\n..\r\n\r\nasdfkjadf=C3=B6kas=\r\n\r\n--=-UCesP8ARTLj0ae/rIXux\r\nContent-Type: application/pgp-signature\r\n\r\n-----BEGIN PGP SIGNATURE-----\r\nVersion: GnuPG v2.0.18 (GNU/Linux)\r\n\r\niEYEABECAAYFAk6mwboACgkQ4K8q+2fhBpd/vgCfTOSMu5cRtB5Z6Di/YBc54DnD\r\nypAAn0f3vFFfsJcfSTvqQzAPKJKFT1WT\r\n=aHwK\r\n-----END PGP SIGNATURE-----\r\n\r\n--=-UCesP8ARTLj0ae/rIXux--\r\n.\r\n", 933) = 933
A few lines later there is a line beginning with "read(" which contains the mail contents, in which, however, there i s a single dot on the line (followed by the rest of the message). I can of course provide other lines of the log file. Just now I did not want to scan all of it for authentication data which I would rather keep to myself.
I also tried mail-file-so from libesmtp as you adviced. (I had to add a From line to the test-mail to make the Lavabit server accept it.) Guess what? The mail gets cut off at the first occurence of a single dot on a line! For the record, the original mail looked like this:
Hello world! .. . ..This is a test .More lines End of test--- And this is what came through: Hello world! .In the strace-logfile, there appears to be no line beginning with "write(" which would contain the mail content. There is however a "read(" line with the content, in which the single dot is n o t converted to two dots.
Eventually I tried sending a mail with the following contents through Lavabit using Balsa:
test . test– and it got cut off. So it most definitely is not a linewrap issue. But somehow Balsa and Lavabit disagree on how to handle dots… What do you think, should I notify the Lavabit administrators, or could this still be a bug of Balsa?
Attachment:
pgpIEokELud8d.pgp
Description: PGP signature