All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mads Martin Jørgensen" <mmj@mmj.dk>
To: mlmmj@mlmmj.org
Subject: Re: [mlmmj] Mail loss on failed mmap
Date: Fri, 13 May 2011 17:31:17 +0000	[thread overview]
Message-ID: <4DCD6AE5.4050104@mmj.dk> (raw)
In-Reply-To: <201105131519.27505.thomas.jarosch@intra2net.com>

On 13/05/11 15.19, Thomas Jarosch wrote:

> I recently had lost "big" emails containing attachments
> while running them through mlmmj 1.2.15. Here's the relevant log output:
>
> -------------------------
>   May 2 14:33:55 /usr/bin/mlmmj-send[13098]: mlmmj-send.c:891: Not preparing
> in memory. Mail is 6428395 bytes: Success
>   May 2 14:33:55 /usr/bin/mlmmj-send[13098]: getaddrsfromfd.c:27: Could not
> mmap fd: Invalid argument
> -------------------------
>
> Do I guess correctly that getaddrsfromfd() returns -1 and then
> the mail is silently discarded?

No, it's wrong.

> mlmmj 1.2.16+ contains Robin's fix for a mmap() call of zero bytes.
> I'm wondering if that might be an issue but the file size
> shouldn't be zero bytes anyway.

Actually it's mlmmj not preparing the reply in memory, because it's so 
big, that we don't want it to be a way to DoS the server through mlmmj.

If you look at the messages one by one:

First one is mlmmj-send, making an informal message - it says "success". 
It says it wont prepare it in memory, due to previously mentioned risk 
of DoS. Instead, it prepares on disk where it's probably still sitting, 
but the recipient wouldn't accept it due to size. You can tune this 
through a tunable (but that wont fix it if the recipient rejects it). 
Quote from TUNABLES:

- memorymailsize		(normal)

Here is specified in bytes how big a mail can be and still be prepared 
for sending in memory. It's greatly reducing the amount of write system 
calls to prepare it in memory before sending it, but can also lead to 
denial of service attacks. Default is 16k (16384 bytes).

Second one is getaddrsfromfd() in mlmmj-send, where there's probably a 
zero-sized file within subscribers.d/. It's a harmless error which I 
partly fixed quite some time ago. Reason for it is, that before 
linux-2.6.9 it was legal to mmap a zero-sized file, as well on FreeBSD-5 
where I did most development.


I believe you should go hunting for that loss of mail somewhere else. 
Might be it's a bug in mlmmj, but it's not related to those 
errormessages you posted here.

Have a great weekend :)

/mmj
-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
  and totally illogical, with just a little bit more effort?"
                                  -- A. P. J.


  reply	other threads:[~2011-05-13 17:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 13:19 [mlmmj] Mail loss on failed mmap Thomas Jarosch
2011-05-13 17:31 ` Mads Martin Jørgensen [this message]
2011-05-20  9:24 ` Thomas Jarosch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DCD6AE5.4050104@mmj.dk \
    --to=mmj@mmj.dk \
    --cc=mlmmj@mlmmj.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.