meillo@258: -oem meillo@258: ==== meillo@258: meillo@258: This document explains what I found out about the -oem/-oee options. It meillo@258: is intended as a knowledge base for further development on this topic. meillo@258: In version 0.3.0 (2010-11), masqmail's implementation of -oem is meillo@258: considered broken and -oee is not implemented. meillo@258: meillo@258: Following is the behavior masqmail actually had: meillo@258: meillo@258: If -oi/-i is given, -oem is ignored. meillo@258: If no -oi/-i is given, always return with a non-zero return code. meillo@258: meillo@258: This current behavior is not like it should be. meillo@258: meillo@258: meillo@258: The desired behavior meillo@258: -------------------- meillo@258: meillo@258: It had been difficult to identify good explanations. The problem, as meillo@258: often, is that sendmail's source would be the definitive definition. meillo@258: But in which version and what if common behavior differs from sendmail's meillo@258: (maybe as a result of misunderstanding)? Exim's documentation has proven meillo@258: to be a valuable resource. meillo@258: meillo@258: In exim the behavior is such: meillo@258: meillo@258: If an error is detected while a non-SMTP message is being received meillo@258: (for example, a malformed address), the error is reported to meillo@258: the sender in a mail message. Exim exits with a non-zero return meillo@258: code then, no matter if the error message was successful or not. meillo@258: (In exim, -oee is similar but exim returns successful if the error meillo@258: message had been sent successful.) meillo@258: meillo@258: The mutt wiki writes about ``sendmail -oi -oem'': meillo@258: meillo@258: The mail server (in this case sendmail) will receive the message meillo@258: in input, and will parse it. In case of a malformed message, meillo@258: it will send an error message to the user to whom belongs the meillo@258: MUA trasmitting the message (e.g. user@localhost.localdomain), meillo@258: and it will exit with a non zero exit code: the -oem flag forces meillo@258: the returning of a non zero exit code even in the case the error meillo@258: message has been successfully sent to the local server. meillo@258: meillo@258: meillo@258: What does it mean for masqmail? meillo@258: ------------------------------- meillo@258: meillo@258: Masqmail does not send error messages on malformed addresses. It does meillo@258: not much check for syntax. It detects general errors (unexpected EOF, meillo@258: no recipients, max message size exceeded) (see masqmail.c:mode_accept()) meillo@258: but simply prints a message to stderr and exits non-zero. I think that meillo@258: currently it is not of need to add some elaborate error handling in meillo@258: this area. Hence, for the implementing of -oem and -oee would do assume meillo@258: that sending the error message does always fail (because we never send meillo@258: any such message) and hence we exit non-zero on error. This is the meillo@258: similar behavior of both options. meillo@258: meillo@258: From 0.3.1 on masqmail will not recognize -oem anymore and thus ignore meillo@258: it like any unknown -oXXX option. It's behavior is then as if error meillo@258: message sending fails. meillo@258: meillo@258: Remind that all this affects only the case of accepting non-SMTP messages meillo@258: on stdin. meillo@258: meillo@258: meillo@258: On the relationship of -oi and -oem meillo@258: ----------------------------------- meillo@258: meillo@258: It seems as if the two options should not affect each other; in contrast meillo@258: to the behavior in masqmail before 0.3.1. Their relationship is just meillo@258: that -oem does only affect non-SMTP messages on stdin, which is the meillo@258: typical use case of -oi. meillo@258: meillo@258: meillo@258: meillo