masqmail

annotate docs/oem-option @ 267:8be687c06c20

comments (should we really exit failure in this case?) see code
author markus schnalke <meillo@marmaro.de>
date Fri, 03 Dec 2010 11:37:01 -0300
parents
children
rev   line source
meillo@258 1 -oem
meillo@258 2 ====
meillo@258 3
meillo@258 4 This document explains what I found out about the -oem/-oee options. It
meillo@258 5 is intended as a knowledge base for further development on this topic.
meillo@258 6 In version 0.3.0 (2010-11), masqmail's implementation of -oem is
meillo@258 7 considered broken and -oee is not implemented.
meillo@258 8
meillo@258 9 Following is the behavior masqmail actually had:
meillo@258 10
meillo@258 11 If -oi/-i is given, -oem is ignored.
meillo@258 12 If no -oi/-i is given, always return with a non-zero return code.
meillo@258 13
meillo@258 14 This current behavior is not like it should be.
meillo@258 15
meillo@258 16
meillo@258 17 The desired behavior
meillo@258 18 --------------------
meillo@258 19
meillo@258 20 It had been difficult to identify good explanations. The problem, as
meillo@258 21 often, is that sendmail's source would be the definitive definition.
meillo@258 22 But in which version and what if common behavior differs from sendmail's
meillo@258 23 (maybe as a result of misunderstanding)? Exim's documentation has proven
meillo@258 24 to be a valuable resource.
meillo@258 25
meillo@258 26 In exim the behavior is such:
meillo@258 27
meillo@258 28 If an error is detected while a non-SMTP message is being received
meillo@258 29 (for example, a malformed address), the error is reported to
meillo@258 30 the sender in a mail message. Exim exits with a non-zero return
meillo@258 31 code then, no matter if the error message was successful or not.
meillo@258 32 (In exim, -oee is similar but exim returns successful if the error
meillo@258 33 message had been sent successful.)
meillo@258 34
meillo@258 35 The mutt wiki writes about ``sendmail -oi -oem'':
meillo@258 36
meillo@258 37 The mail server (in this case sendmail) will receive the message
meillo@258 38 in input, and will parse it. In case of a malformed message,
meillo@258 39 it will send an error message to the user to whom belongs the
meillo@258 40 MUA trasmitting the message (e.g. user@localhost.localdomain),
meillo@258 41 and it will exit with a non zero exit code: the -oem flag forces
meillo@258 42 the returning of a non zero exit code even in the case the error
meillo@258 43 message has been successfully sent to the local server.
meillo@258 44
meillo@258 45
meillo@258 46 What does it mean for masqmail?
meillo@258 47 -------------------------------
meillo@258 48
meillo@258 49 Masqmail does not send error messages on malformed addresses. It does
meillo@258 50 not much check for syntax. It detects general errors (unexpected EOF,
meillo@258 51 no recipients, max message size exceeded) (see masqmail.c:mode_accept())
meillo@258 52 but simply prints a message to stderr and exits non-zero. I think that
meillo@258 53 currently it is not of need to add some elaborate error handling in
meillo@258 54 this area. Hence, for the implementing of -oem and -oee would do assume
meillo@258 55 that sending the error message does always fail (because we never send
meillo@258 56 any such message) and hence we exit non-zero on error. This is the
meillo@258 57 similar behavior of both options.
meillo@258 58
meillo@258 59 From 0.3.1 on masqmail will not recognize -oem anymore and thus ignore
meillo@258 60 it like any unknown -oXXX option. It's behavior is then as if error
meillo@258 61 message sending fails.
meillo@258 62
meillo@258 63 Remind that all this affects only the case of accepting non-SMTP messages
meillo@258 64 on stdin.
meillo@258 65
meillo@258 66
meillo@258 67 On the relationship of -oi and -oem
meillo@258 68 -----------------------------------
meillo@258 69
meillo@258 70 It seems as if the two options should not affect each other; in contrast
meillo@258 71 to the behavior in masqmail before 0.3.1. Their relationship is just
meillo@258 72 that -oem does only affect non-SMTP messages on stdin, which is the
meillo@258 73 typical use case of -oi.
meillo@258 74
meillo@258 75
meillo@258 76 meillo