https://wiki.jessen.ch/index?title=Lmtp2nntp_-_patch_regarding_parsing_of_%22RCPT_TO%22&feed=atom&action=historyLmtp2nntp - patch regarding parsing of "RCPT TO" - Revision history2024-03-29T07:50:18ZRevision history for this page on the wikiMediaWiki 1.26.4https://wiki.jessen.ch/index?title=Lmtp2nntp_-_patch_regarding_parsing_of_%22RCPT_TO%22&diff=468&oldid=prevPer Jessen: Created page with "A very minor, but essential patch to lmtp2nntp 1.4.1. '''2016/03/22''' I have also sent it to the author at [http://www.ossp.org ossp.org], but my email bounced. Summary: when ..."2016-04-28T08:19:50Z<p>Created page with "A very minor, but essential patch to lmtp2nntp 1.4.1. '''2016/03/22''' I have also sent it to the author at [http://www.ossp.org ossp.org], but my email bounced. Summary: when ..."</p>
<p><b>New page</b></p><div>A very minor, but essential patch to lmtp2nntp 1.4.1.<br />
<br />
'''2016/03/22''' I have also sent it to the author at [http://www.ossp.org ossp.org], but my email bounced.<br />
<br />
Summary: when the MTA hands over something to lmtp2nntp, the RCPT TO line may contain more than one token. For instance, it might look like this:<br />
<br />
RCPT TO: <recipient@example.com> ORCPT=<another@example.com>;<br />
<br />
The patch below amends the regex pattern to only look at the first token and ignore any subsequent ones.<br />
<br />
<pre><br />
diff -ur a/lmtp2nntp_main.c b/lmtp2nntp_main.c<br />
--- a/lmtp2nntp_main.c 2004-05-07 16:52:03.000000000 +0200<br />
+++ b/lmtp2nntp_main.c 2016-03-22 11:29:34.397744519 +0100<br />
@@ -1315,7 +1315,7 @@<br />
* RFC1893 3.5 Network and Routing Status X.5.2 Syntax error<br />
*/<br />
logbook(ctx->l2, L2_LEVEL_TRACE, "checking parameter syntax");<br />
- if (str_parse(req->msg, "m/^RCPT To:\\s*(.+)$/i", &cp) <= 0) {<br />
+ if (str_parse(req->msg, "m/^RCPT To:\\s*(<[^>]+>)/i", &cp) <= 0) {<br />
res.statuscode = "501";<br />
res.dsncode = "5.5.2";<br />
res.statusmsg = "Syntax error in parameters.";<br />
</pre></div>Per Jessen