Index: ossp-pkg/lmtp2nntp/lmtp2nntp.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v rcsdiff -q -kk '-r1.22' '-r1.23' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v' 2>/dev/null --- lmtp2nntp.c 2001/08/21 07:44:32 1.22 +++ lmtp2nntp.c 2001/08/21 08:56:41 1.23 @@ -591,12 +591,37 @@ return LMTP_ERR_MEM; } - if (!str_parse(req->msg, "m/^MAIL From:\\s*<(.+@.+)>$/i", &ctx->msg->mail_from)) { - /*FIXME ^^^^ is this space required/ valid? Sendmail skips them! */ + /* RFC1652 2. Framework for the 8bit MIME Transport Extension + * (4) one optional parameter using the keyword BODY is added to the MAIL + * FROM command. The value associated with this parameter is a keyword + * indicating whether a 7bit message [...] or a MIME message [...] is + * being sent. The syntax of the value is as follows, using the ABNF + * notation [...] + * + * body-value ::= "7BIT" / "8BITMIME" + * + * "MAIL From:" + * "MAIL From: BODY=8BITMIME" + * "MAIL From: BODY=7BIT" + */ + if (!str_parse(req->msg, "m/^MAIL From:\\s*<(?:.+@.+)>/i")) { res.statuscode = "553"; res.dsncode = "5.5.4"; res.statusmsg = "Domain name required for sender address."; lmtp_response(lmtp, &res); + msg_destroy(ctx->msg); + ctx->msg = NULL; + return LMTP_OK; + } + if (!str_parse(req->msg, "m/^MAIL From:\\s*<(.+@.+)>" + "(?:\\s+BODY=(?:7BIT|8BITMIME)\\s*){0,1}$/i", + &ctx->msg->mail_from)) { + res.statuscode = "501"; + res.dsncode = "5.5.4"; + res.statusmsg = "Unknown parameter for keyword BODY."; + lmtp_response(lmtp, &res); + msg_destroy(ctx->msg); + ctx->msg = NULL; return LMTP_OK; }