From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 394020257792 X-Google-Groups: supmua X-Google-Thread: 3030fda1bf,d65b43b9517108fb X-Google-Attributes: gid3030fda1bf,domainid0,public,googlegroup X-Google-NewGroupId: yes X-Received: by 10.112.147.131 with SMTP id tk3mr10350651lbb.2.1416416043609; Wed, 19 Nov 2014 08:54:03 -0800 (PST) X-BeenThere: supmua@googlegroups.com Received: by 10.181.13.138 with SMTP id ey10ls1224997wid.21.canary; Wed, 19 Nov 2014 08:54:03 -0800 (PST) X-Received: by 10.180.19.42 with SMTP id b10mr2113850wie.0.1416416043285; Wed, 19 Nov 2014 08:54:03 -0800 (PST) Return-Path: Received: from mout.web.de (mout.web.de. [212.227.17.11]) by gmr-mx.google.com with ESMTPS id gk3si18199wib.1.2014.11.19.08.54.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Nov 2014 08:54:03 -0800 (PST) Received-SPF: pass (google.com: domain of ruthard.baudach@web.de designates 212.227.17.11 as permitted sender) client-ip=212.227.17.11; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ruthard.baudach@web.de designates 212.227.17.11 as permitted sender) smtp.mail=ruthard.baudach@web.de Received: from localhost ([188.105.206.38]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0LrarZ-1Xwjax0pbh-013KP8; Wed, 19 Nov 2014 17:54:02 +0100 From: Ruthard Baudach To: Gaute Hope Cc: supmua Subject: Re: [sup] Bug in mbox.rb? In-reply-to: <1416387515-astroid-1-m2ak1advzy-2022@strange> References: <1416264666-sup-9223@ruthard-lappi> <1416387515-astroid-1-m2ak1advzy-2022@strange> Date: Wed, 19 Nov 2014 17:53:07 +0100 Message-Id: <1416415410-sup-6292@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="=-1416415990-556726-16938-5509-2-=" X-Provags-ID: V03:K0:4C79p9M33yc7n5B9xF8R1o9IEa69ddPiSFNlvHugxILHocPIGLb 7l/wdllCuvg3hYr91Afk3DWc3VKJ8gNWpy+nIibF+V+FF+s05y/2hZ70hiUrD7Bp08cKqxQ vGEtn+w1xfGlFBYTaQAs3Z17xbYdU2NQQDJPC4SURQLXIKCsPYZCGVP97L3CbQOMewAYT2d i2myBuHgvHVhBw3VmD4WA== X-UI-Out-Filterresults: notjunk:1; --=-1416415990-556726-16938-5509-2-= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable >=3D=3D Ausz=C3=BCge aus der Nachricht von Gaute Hope vom 2014-11-19 10:= 03: > Excerpts from Ruthard Baudach's message of November 18, 2014 0:08: > > 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 wo= uld > > be fed by sup and another MDA, e.g. if someone would use the same mbo= x > > for in- and outgoing mail (as I did when I had to setup sup anew afte= r > > upgrading to 0.15. Changing to maildir simultaneously safed me from t= his > > 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 for= matted > > mboxes. > > = > > Hmmmmmm???? = > = > haven't looked at the details yet, but nice catch. > = > oh.. that would be baad. breaking existing setups is a > out-of-the-question though. Consequently; we need tests for whatever > change fixing this introduces (have a look at the test folder). > = > I think a fix should; = > - fix existing mboxes (on next write) > - don't break on any existing mboxes > - conform to standards > - include tests of all these points > - RMail has a mbox parser (i think) which perhaps could be used for > testing, i think sup included its own for performance reasons. > = > = > gaute I think 1) It's a minor bug, it would only cause problems if one would intermingle in- and outgoing mail. Does it has to be fixed? 2) I could either just fix it, write a script to fix wrongly formatted mboxes, and the next release would need a WARNING RUN SUP_FIX_MBOXES prior to using it after update. 3) I could check the mbox everytime a message is added and add a empty line as needed. Would increase disk usage. I couldn't make any sense of the test dir in the source code, probably fo= r lack of knowledge, not because of lack of sense;-) Could you point me to some documentation on testing the sup team is using? Yours, Ruthard -- = Dr. Ruthard Baudach Speckertsweg 36a 97209 Veitsh=C3=B6chheim ---- Emails bitte verschl=C3=BCsseln und signieren. Meine PGP-Id: AC5AC6C2 --=-1416415990-556726-16938-5509-2-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJUbMr2AAoJEA852hysWsbChd4H/3gZR46WMOnQmRhSaKRbsluJ 4NQD68abtepN/zYAqFv/yq5P/FazWgBJHjXL9E73Xh02ez3vpNo3AxHDRthjVwhb MjkbRceGhFepihP+f0UHQMvsTE8X1uWPL4Vb6M09RpDN4MnccA+aOdJl6Ma28feQ KKgJu09NBq27n1u1PRdwdKKhkFIKgUJOMutU3+1em1IHwTrHNsCZSrYbyAmOmb0W 6sj3OMwtxO8MKpfqDGVEEmPMnofCISXw10Ek3qNG96+nM6Bd/nZsjndYgxgDhtPs rFhKwCjse4Y67EYMvKe3dWzFnqFZ9ZeMBLadz3DqX6wZy/z/kubYL/B841KK1DA= =+Co/ -----END PGP SIGNATURE----- --=-1416415990-556726-16938-5509-2-=--