Update of /cvsroot/tmda/tmda/bin
In directory usw-pr-cvs1:/tmp/cvs-serv26040/bin
Modified Files:
ChangeLog tmda-filter
Log Message:
Introduce SENDMAIL as the new message injection interface. Using
/usr/sbin/sendmail (sendmail program or sendmail compatibility
interface) allows for an MTA independent method of injecting mail.
This replaces use of the qmail-specific INJECT (qmail-inject).
This involved a few changes, primarily in how the envelope sender is
set. If a message already has a Return-Path header, qmail respects
this and uses it as the message's envelope sender when injected.
Sendmail and compatible MTAs such as Postfix don't do this, because
apparently there is no RFC that requires this behavior. We now set
the envelope sender by explicitly passing it as an argument to
`sendmail -f'.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/ChangeLog,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- ChangeLog 2001/09/26 18:05:54 1.77
+++ ChangeLog 2001/10/02 16:31:30 1.78
@@ -1,3 +1,17 @@
+2001-10-02 Jason R. Mastaler <jasonrm@xxxxxxxxxxxxxxxxxxxxxxxxxx>
+
+ * tmda-filter (bounce_cc): Use popen2 for uniformity.
+
+ (send_bounce): Use the more general SENDMAIL interface to send
+ confirmation messages rather than INJECT. We pass
+ BOUNCE_ENV_SENDER as the argument to `sendmail -f' to set the
+ envelope sender.
+
+ (inject_pending): Use the more general SENDMAIL interface to send
+ confirmation messages rather than INJECT. We parse the
+ Return-Path header from the message and pass that as the argument
+ to `sendmail -f' to set the envelope sender.
+
2001-09-26 Jason R. Mastaler <jasonrm@xxxxxxxxxxxxxxxxxxxxxxxxxx>
* tmda-filter (inject_pending): Change `X-Confirmed' header to
Index: tmda-filter
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/tmda-filter,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- tmda-filter 2001/09/26 18:05:54 1.62
+++ tmda-filter 2001/10/02 16:31:30 1.63
@@ -193,13 +193,14 @@
# Add some headers.
if not vars.has_key('already_confirmed'):
message_headers['Reply-To'] = vars['confirm_accept_address']
- message_headers['Return-Path'] = '<' + Defaults.BOUNCE_ENV_SENDER + '>'
message_headers['To'] = envelope_sender
message_headers['Precedence'] = 'bulk'
message_headers['X-Delivery-Agent'] = Defaults.DELIVERY_AGENT
message_body = bounce_message.read()
inject = []
- inject.append(Defaults.INJECT)
+ inject.append(Defaults.SENDMAIL)
+ inject.append('-f')
+ inject.append(Defaults.BOUNCE_ENV_SENDER)
inject.append(envelope_sender)
pipeline = popen2.popen2(inject)[1]
pipeline.write(str(message_headers))
@@ -210,11 +211,13 @@
def bounce_cc(address):
"""Send a 'carbon copy' of the bounced message to address."""
- inject = Defaults.INJECT + ' ' + address # "qmail-inject recipient"
- pipeline = os.popen(inject, 'w')
+ inject = []
+ inject.append(Defaults.SENDMAIL)
+ inject.append(address)
+ pipeline = popen2.popen2(inject)[1]
pipeline.write(message)
pipeline.close()
- logit(inject,time.time())
+ logit(string.join(inject),time.time())
def inject_pending(pathname,timestamp,pid):
@@ -236,8 +239,12 @@
# Add the date when confirmed in a header.
message_headers['X-TMDA-Confirmed'] = (
time.asctime(time.gmtime(time.time())) + ' UTC')
+ # Collect the envelope sender to pass to sendmail.
+ return_path = message_headers.getaddr('return-path')[1]
inject = []
- inject.append(Defaults.INJECT)
+ inject.append(Defaults.SENDMAIL)
+ inject.append('-f')
+ inject.append(return_path)
inject.append(confirm_done_address)
pipeline = popen2.popen2(inject)[1]
pipeline.write(str(message_headers))
_______________________________________________
tmda-cvs mailing list
http://libertine.org/lists/listinfo/tmda-cvs
|