All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: mlmmj@mlmmj.org
Subject: Re: [mlmmj] Mail loss on failed mmap
Date: Fri, 20 May 2011 09:24:37 +0000	[thread overview]
Message-ID: <201105201124.38181.thomas.jarosch@intra2net.com> (raw)
In-Reply-To: <201105131519.27505.thomas.jarosch@intra2net.com>

Hello Mads,

On Friday, 13. May 2011 19:31:17 you wrote:
> > Do I guess correctly that getaddrsfromfd() returns -1 and then
> > the mail is silently discarded?
> 
> No, it's wrong.

Thanks for your reply.

I tested some more things:
- Torture mlmmj with valgrind -> No errors found. Perfect :)

  Hint: If you ever want to run mlmmj inside valgrind,
        you have to use the "-F (no fork)" option of mlmmj-receieve.

- Pipe a big email through it -> Works fine

- Modify getaddrsfromfd() to always return -1
  like when the mmap call fails -> Mail is discarded

The "subscribers" file gets written/updated in our environment by an 
automatic system that first writes to a temporary file and then 
atomically replaces the target with a rename() on the same partition.

While writing this email, it occurred to me what happened:
mlmmj was perfectly configured, there just weren't any recipients
in the subscribers file yet (=empty mailing list). That would
also explain the mmap() error message from mlmmj 1.2.15.

I can catch this users error on my side by not redirecting
email to mlmmj until at least one recipient is configured.


Postfix reacts to exit codes from /usr/include/sysexits.h
when passing email to external programs.

How about returning "EX_TEMPFAIL" in mlmmj-send
if no recipients were found?

That would also protect us from mail loss
if the mmap() call should ever fail.

Cheers,
Thomas


      parent reply	other threads:[~2011-05-20  9:24 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
2011-05-20  9:24 ` Thomas Jarosch [this message]

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=201105201124.38181.thomas.jarosch@intra2net.com \
    --to=thomas.jarosch@intra2net.com \
    --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.