I applied the HOLD patch and am using a default of "hold" instead of 
"confirm" in my TMDA installation right now. (I have subscribed to bunches 
of mailing lists, so I want to be sure that I have told TMDA about all of 
them before turning on "confirm" -- I absolutely don't want someone to 
send mail to a list and get a confirm message from me).

* I couldn't apply the patch directly to 0.59, because tmda-rfilter had 
  changed; I had to read the patch and apply it by hand.

* Once applied, held messages didn't generate a confirm response -- but 
  neither did they show up in the pending queue. I modified tmda-rfilter 
  some more, and now they do show up in the pending queue.

I'm not really comfortable with my mods (especially since I've never used 
Python before). I've attached the new patch, a) because some people 
apparently are looking for it and the old one is out of date, and b) in 
case anyone wants to look at it and say "you forgot to do X so your 
tmda-rfilter is now terribly broken."

j

---
  "Users complain that they receive too much spam, while spammers protest
messages are legal." -InfoWorld
  "You do not have to do everything disagreeable that you have a right to
do." -Judith Martin (Miss Manners)
*** tmda-rfilter        Thu Aug 15 14:47:09 2002
--- tmda-rfilter-orig   Thu Aug 15 12:13:52 2002
***************
*** 362,370 ****
      elif action in ('accept', 'deliver', 'ok'):
          logit('%s %s' % ('OK', logname))
          mta.deliver(message_headers, message_body)
-     elif action == 'hold':
-         logit('%s (%s)' % ('HOLD', logname))
-         bouncegen('hold')
      else:
          logit('%s %s' % ('CONFIRM', logname))
          bouncegen('request')
--- 362,367 ----
***************
*** 626,664 ****
          pending_contents = str(message_headers) + '\n' + message_body
          Util.writefile(pending_contents,
                         os.path.join(pendingdir, pending_message))
!     elif mode == 'hold':               # silently hold
!         logit('holding')
!         timestamp = str('%d' %now)
!         pid = Defaults.PID
!         pending_message = "%s.%s.msg" % (timestamp, pid)
!         # Create ~/.tmda/ and friends if necessary.
!         if not os.path.exists(pendingdir):
!             os.makedirs(pendingdir, 0700) # stores the unconfirmed messages
!         logit ('1')
!         # X-TMDA-Recipient is used by release_pending().
!         message_headers['X-TMDA-Recipient'] = recipient_address
!         # Write ~/.tmda/pending/TIMESTAMP.PID.msg
!         logit ('2')
!         pending_contents = str(message_headers) + '\n' + message_body
!         logit ('%s (%s)' % ('holding:', os.path.join(pendingdir, pending_message)))
!         Util.writefile(pending_contents,
!                        os.path.join(pendingdir, pending_message))
! 
!     # Don't send anything for silently held messages
!     if mode != 'hold':
!         # Create the confirm message and then send it.
!         bounce_message = Util.maketext(templatefile, vars())
!         if mode in ('accept', 'bounce'):
!             send_bounce(bounce_message, already_confirmed=1)
!             if mode == 'bounce':
!                 mta.stop()
!         elif mode == 'request':
!             if Defaults.CONFIRM_CC:
!                 send_cc(Defaults.CONFIRM_CC)
!             logit("CONFIRM pending " + pending_message)
!             send_bounce(bounce_message,
!                         confirm_accept_address = confirm_accept_address)
!             mta.stop() 
  
  
  ######
--- 623,641 ----
          pending_contents = str(message_headers) + '\n' + message_body
          Util.writefile(pending_contents,
                         os.path.join(pendingdir, pending_message))
!     # Create the message and then send it.
!     bounce_message = Util.maketext(templatefile, vars())
!     if mode in ('accept', 'bounce'):
!         send_bounce(bounce_message, already_confirmed=1)
!         if mode == 'bounce':
!             mta.stop()
!     elif mode == 'request':
!         if Defaults.CONFIRM_CC:
!             send_cc(Defaults.CONFIRM_CC)
!         logit("CONFIRM pending " + pending_message)
!         send_bounce(bounce_message,
!                     confirm_accept_address = confirm_accept_address)
!         mta.stop()  
  
  
  ######
***************
*** 729,737 ****
      elif action == 'confirm':
          logit('%s (%s)' % ('CONFIRM', matching_line))
          bouncegen('request')
-     elif action == 'hold':
-          logit('%s (%s)' % ('HOLD', matching_line))
-          bouncegen('hold')
  
      # The message didn't match the filter file, so check if it was
      # sent to a 'tagged' address.
--- 706,711 ----

Reply via email to