Check-in Number:
|
716 | |
Date: |
2001-Aug-21 10:56:41 (local)
2001-Aug-21 08:56:41 (UTC) |
User: | thl |
Branch: | |
Comment: |
added support for BODY keyword detection with =7BIT and =8BITMIME in MAIL command |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/lmtp2nntp/lmtp2nntp.c 1.22 -> 1.23
--- 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:<foo@bar>"
+ * "MAIL From:<foo@bar> BODY=8BITMIME"
+ * "MAIL From:<foo@bar> 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;
}
|
|