patch-libs_maildrop_deliver_C 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. $OpenBSD: patch-libs_maildrop_deliver_C,v 1.1 2014/06/05 21:04:51 giovanni Exp $
  2. maildrop adds a newline to mbox files before delivering new messages.
  3. This effectively alters the final message in the mbox, causing a
  4. running mutt (and maybe other MUAs) with that mbox open to freak out
  5. and lose unsaved state [1]. The maildrop folks prefer to keep this
  6. (out of spec) behaviour to keep from breaking users working
  7. configurations as well as to avoid problems caused by other out of
  8. spec mail delivery agents (which may aberrantly neglect to leave a
  9. blank line at the end of the mbox) [2].
  10. This patch disables this behaviour of maildrop allowing an MUA to
  11. gracefully handle the delivery of new mail to an open folder.
  12. [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=132411
  13. [2] http://markmail.org/message/w5mwn3jpmn3qeo5x
  14. --- libs/maildrop/deliver.C.orig Sun Aug 25 20:54:20 2013
  15. +++ libs/maildrop/deliver.C Fri Oct 4 15:36:27 2013
  16. @@ -230,15 +230,7 @@ Buffer b;
  17. {
  18. format_mbox.Init(1);
  19. - if ((stat_buf.st_size > 0 &&
  20. - mio.write(
  21. -#if CRLF_TERM
  22. - "\r\n", 2
  23. -#else
  24. - "\n", 1
  25. -#endif
  26. - ) < 0) ||
  27. - format_mbox.DeliverTo(mio))
  28. + if (format_mbox.DeliverTo(mio))
  29. {
  30. dotlock.truncate();
  31. log(mailbox, -1, format_mbox);