Discussions of development and use of the Sup email client
 help / color / mirror / Atom feed
* Bug in mbox.rb?
@ 2014-11-17 23:08 Ruthard Baudach
  2014-11-19  9:03 ` [sup] " Gaute Hope
  0 siblings, 1 reply; 7+ messages in thread
From: Ruthard Baudach @ 2014-11-17 23:08 UTC (permalink / raw)
  To: supmua

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

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 = 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 – of course this would break existing setups with wrong formatted
mboxes.

Hmmmmmm???? 

Yours,

Ruthard

-- 

Please encrypt and sign emails.
My PGP-Id: AC5AC6C2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-23  9:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17 23:08 Bug in mbox.rb? Ruthard Baudach
2014-11-19  9:03 ` [sup] " Gaute Hope
2014-11-19 16:53   ` Ruthard Baudach
2014-11-19 20:54     ` Ruthard Baudach
2014-11-20 17:48     ` Gaute Hope
2014-11-21 19:29       ` Ruthard Baudach
2014-11-23  9:58         ` Gaute Hope

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox