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.50.243 with SMTP id f19mr5088508lbo.1.1416387776188; Wed, 19 Nov 2014 01:02:56 -0800 (PST) X-BeenThere: supmua@googlegroups.com Received: by 10.180.88.170 with SMTP id bh10ls43060wib.19.canary; Wed, 19 Nov 2014 01:02:55 -0800 (PST) X-Received: by 10.195.17.134 with SMTP id ge6mr3850573wjd.2.1416387775861; Wed, 19 Nov 2014 01:02:55 -0800 (PST) Return-Path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com. [74.125.82.50]) by gmr-mx.google.com with ESMTPS id l4si61573wif.2.2014.11.19.01.02.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 01:02:55 -0800 (PST) Received-SPF: none (google.com: eg@gaute.vetsj.com does not designate permitted sender hosts) client-ip=74.125.82.50; Authentication-Results: gmr-mx.google.com; spf=none (google.com: eg@gaute.vetsj.com does not designate permitted sender hosts) smtp.mail=eg@gaute.vetsj.com Received: by mail-wg0-f50.google.com with SMTP id k14so211960wgh.23 for ; Wed, 19 Nov 2014 01:02:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:subject:to:references:in-reply-to :user-agent:message-id:mime-version:content-type :content-transfer-encoding; bh=pTVG2xRu+Fkuk3Odup4yuXOd7xg45L/fRTwsp3t0Ygs=; b=QlGhac19sh5L8CZq1hYVAmR27++TUEO8NpQ4A8SW0VP0EfqjFMJQaX/2x+OfcoSew9 6ujOF7CfmkPpqA+Ic6E0OSqIVby0nPKkyErJGncmBPN5w73QJRjJn/IHfSQiNf4rWz2R tc2NZQf2IkQBJGId5Sm9D1T9v21r7AfxSmfl+wb8DDdnZRAkyFe4LyIOQdg1oZXLri3v 0QgZGddYogf24yQ9QoXGy6AwpOI5+pfv3Z7X0EVLgT4tNxTksi7pxQKWBnz26zcEpiKD gB50AfUu/UqMWK6u2L8GGmyxp++3DAuIasN+roHsgns+X0wSnLWG45xD9g27GmgAKTnH 4t1w== X-Gm-Message-State: ALoCoQlNQckBodQdmKWNkAAdImZNRREypxDrX3e2QogGaEhGQfk1KRhLOYkxfiYr/qadKsdL3UjD X-Received: by 10.180.91.70 with SMTP id cc6mr3610816wib.5.1416387775502; Wed, 19 Nov 2014 01:02:55 -0800 (PST) Return-Path: Received: from localhost (216.89-20-249.enivest.net. [89.20.249.216]) by mx.google.com with ESMTPSA id bc1sm1294506wib.16.2014.11.19.01.02.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Nov 2014 01:02:54 -0800 (PST) Date: Wed, 19 Nov 2014 09:03:06 +0000 From: Gaute Hope Subject: Re: [sup] Bug in mbox.rb? To: supmua , Ruthard Baudach References: <1416264666-sup-9223@ruthard-lappi> In-Reply-To: <1416264666-sup-9223@ruthard-lappi> User-Agent: astroid/vc24d4330 (https://github.com/gauteh/astroid) Message-Id: <1416387515-astroid-1-m2ak1advzy-2022@strange> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable 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. >=20 > line 117 -124 of lib/sup/mbox.rb reads: >=20 > 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 >=20 > As far as I understand this, sup puts a blank line *before* the > separator line except for the first message. >=20 > My old sent.mbox is terminated by the last line of the last message, my > old inbox.mbox is terminated by a blank line. >=20 > 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!) >=20 > Changing the lines 117 - 124 of lib/sup/mbox.rb to >=20 > 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 >=20 > would take care of this. >=20 > Do you agree? >=20 > Shall I submit a patch? >=20 > O =E2=80=93 of course this would break existing setups with wrong formatt= ed > mboxes. >=20 > Hmmmmmm????=20 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;=20 - 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 =