summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw1999-02-10 00:50:51 +0000
committerbwarsaw1999-02-10 00:50:51 +0000
commit81b563b89bc7bc04121ca45ac4d443c537e5d615 (patch)
tree6be2fd649e72d9ad2099fb51ea349a6877bc7155
parentd697602e90eeb370ad9d5f30959f295ce5286b0b (diff)
downloadmailman-81b563b89bc7bc04121ca45ac4d443c537e5d615.tar.gz
mailman-81b563b89bc7bc04121ca45ac4d443c537e5d615.tar.zst
mailman-81b563b89bc7bc04121ca45ac4d443c537e5d615.zip
GatewayManager.SendMailToNewsGroup(): Disgusting but necessary hack to
ensure that the outgoing message has at most only one Content-Transfer-Encoding header. My NNTP server barfs badly (441 error) if there is more than one such header present. Bogosities: I don't know why email from me has about 4 of these headers when gated to news. What happens if these multiples have conflicting values -- right now I just take the first such value. If there is no such header, we don't add one. See also the comments in the code. This whole patch could be suspect, but it was necessary to get message gated to the new python-list@python.org.
-rw-r--r--Mailman/GatewayManager.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Mailman/GatewayManager.py b/Mailman/GatewayManager.py
index 37d33bfea..f1f8eff09 100644
--- a/Mailman/GatewayManager.py
+++ b/Mailman/GatewayManager.py
@@ -167,6 +167,23 @@ class GatewayManager:
len(string.split(msg.body,"\n")))
del msg['received']
+ # TBD: Gross hack to ensure that we have only one
+ # content-transfer-encoding header. More than one barfs NNTP. I
+ # don't know why we sometimes have more than one such header, and
+ # it probably isn't correct to take the value of just the first
+ # one. What if there are conflicting headers???
+ #
+ # This relies on the new interface for getaddrlist() returning
+ # values for all present headers, and the fact that the legal
+ # values are usually not parseable as addresses. Yes this is
+ # another bogosity.
+ cteheaders = msg.getaddrlist('content-transfer-encoding')
+ if cteheaders:
+ ctetuple = cteheaders[0]
+ ctevalue = ctetuple[1]
+ del msg['content-transfer-encoding']
+ msg['content-transfer-encoding'] = ctevalue
+
# NNTP is strict about spaces after the colon in headers.
for n in range(len(msg.headers)):
line = msg.headers[n]