From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 394020257792 X-Google-Groups: supmua X-Google-Thread: 3030fda1bf,d65b43b9517108fb,start X-Google-Attributes: gid3030fda1bf,domainid0,public,googlegroup X-Google-NewGroupId: yes X-Received: by 10.194.71.19 with SMTP id q19mr956131wju.5.1416337919634; Tue, 18 Nov 2014 11:11:59 -0800 (PST) X-BeenThere: supmua@googlegroups.com Received: by 10.181.29.33 with SMTP id jt1ls1111244wid.45.canary; Tue, 18 Nov 2014 11:11:59 -0800 (PST) X-Received: by 10.180.189.116 with SMTP id gh20mr3089464wic.2.1416337919251; Tue, 18 Nov 2014 11:11:59 -0800 (PST) Return-Path: Received: from mout.web.de (mout.web.de. [212.227.17.12]) by gmr-mx.google.com with ESMTPS id p14si858946wie.1.2014.11.18.11.11.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Nov 2014 11:11:59 -0800 (PST) Received-SPF: pass (google.com: domain of ruthard.baudach@web.de designates 212.227.17.12 as permitted sender) client-ip=212.227.17.12; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ruthard.baudach@web.de designates 212.227.17.12 as permitted sender) smtp.mail=ruthard.baudach@web.de Received: from localhost ([188.105.206.174]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MEmoQ-1XjfZU36Xy-00G1S3 for ; Tue, 18 Nov 2014 20:11:58 +0100 From: Ruthard Baudach To: supmua Subject: Bug in mbox.rb? Date: Tue, 18 Nov 2014 00:08:03 +0100 Message-Id: <1416264666-sup-9223@ruthard-lappi> User-Agent: Sup/0.20.0 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1416265688-478565-12652-9987-1-=" X-Provags-ID: V03:K0:nTWP4Hk8n8HfL0iaEnEtweiRypST6BGSr/5yTHlAAhxTvZoBO0W aaW35YmXjvFqb3jhYoS08j8vStf0uBYeCByoT3wpVXjfh/MT1MI7MpybJzPxuyHI17oJjDa D+IOEhxeiUR+Yq6Nt4W9QmBgJ7nLX1c51GBC57VQR9/0v1u95tIbXCcpqBxc1rbznXUcwxJ OprNWOZ9tgWQv7UnO9lqw== X-UI-Out-Filterresults: notjunk:1; --=-1416265688-478565-12652-9987-1-= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable If I am not mistaken, both RFC4155 and http://www.qmail.org/man/man5/mbox.html specify that an mbox entry is *terminated* by a blank line. line 117 -124 of lib/sup/mbox.rb reads: def store_message date, from_email, &block need_blank =3D File.exists?(@path) && !File.zero?(@path) File.open(@path, "ab") do |f| f.puts if need_blank f.puts "From #{from_email} #{date.asctime}" yield f end end As far as I understand this, sup puts a blank line *before* the separator line except for the first message. My old sent.mbox is terminated by the last line of the last message, my old inbox.mbox is terminated by a blank line. If I'm not mistaken, this could lead to problems, if the same mbox would be fed by sup and another MDA, e.g. if someone would use the same mbox for in- and outgoing mail (as I did when I had to setup sup anew after upgrading to 0.15. Changing to maildir simultaneously safed me from this bug. Huh!) Changing the lines 117 - 124 of lib/sup/mbox.rb to def store_message date, from_email, &block File.open(@path, "ab") do |f| f.puts "From #{from_email} #{date.asctime}" yield f f.puts end end would take care of this. Do you agree? Shall I submit a patch? O =E2=80=93 of course this would break existing setups with wrong formatt= ed mboxes. Hmmmmmm???? = Yours, Ruthard -- = Please encrypt and sign emails. My PGP-Id: AC5AC6C2 --=-1416265688-478565-12652-9987-1-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJUan/YAAoJEA852hysWsbCiL0H/0WEOzfxSFoqR6MAEHANE1Bs 326pgaosdD4+8DT5nTXYlX4MhhnF51yn4YVuG7uLfjDYTwyVnVAcYvIEb2Oj6JQC DQFIRXNC/b7x/k43UQQmpP82afAL8y+O8Q2JcBrM0ZwJGHCpFCp/I8C7SkwbnUgT 1GV5Seei14YRtX4HlUqOM/PMwridYFbZQuMtwGe0TJsQ5VIa0PCKnNk37oOa4QI7 ctg2W+6JELggnZYwaNzuDofB/LsPmAFLFZ9Eb6yG5ZmujZNvoW7PqQDrYidJPQLV qf7Cwss1VSDFu5CsUdBJAAQ24ucc/+2UXMZZ/uDOzS73OXVfjRIsJbXhb5Yo8nY= =/O0Y -----END PGP SIGNATURE----- --=-1416265688-478565-12652-9987-1-=--