summaryrefslogtreecommitdiff
path: root/Mailman/Utils.py
diff options
context:
space:
mode:
authorbwarsaw1998-12-29 18:16:47 +0000
committerbwarsaw1998-12-29 18:16:47 +0000
commit5c8f57ddf9d57b661f1e241e903ba14e04952b5d (patch)
tree2312b289b3559eaad2ec1c87dcabf4bc52926356 /Mailman/Utils.py
parentb6eb6b6b0be9092aa82cfa91f2166184c23a587b (diff)
downloadmailman-5c8f57ddf9d57b661f1e241e903ba14e04952b5d.tar.gz
mailman-5c8f57ddf9d57b661f1e241e903ba14e04952b5d.tar.zst
mailman-5c8f57ddf9d57b661f1e241e903ba14e04952b5d.zip
DeliverToUser(): Small stylistic tweak to change the sense of the test
and put the child code in the block of the `if'.
Diffstat (limited to 'Mailman/Utils.py')
-rw-r--r--Mailman/Utils.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index a7cd3d83a..67f2ff74f 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -144,27 +144,27 @@ def DeliverToUser(msg, recipient, add_headers=[]):
# that is doing the send - and holding a lock - then the delivery will
# hang pending release of the lock - deadlock.
- if os.fork():
- return
- sender = msg.GetSender()
- try:
+ if not os.fork():
+ # child
+ sender = msg.GetSender()
try:
- msg.headers.remove('\n')
- except ValueError:
- pass
- if not msg.getheader('to'):
- msg.headers.append('To: %s\n' % recipient)
- for i in add_headers:
- if i and i[-1] != '\n':
- i = i + '\n'
- msg.headers.append(i)
+ try:
+ msg.headers.remove('\n')
+ except ValueError:
+ pass
+ if not msg.getheader('to'):
+ msg.headers.append('To: %s\n' % recipient)
+ for i in add_headers:
+ if i and i[-1] != '\n':
+ i = i + '\n'
+ msg.headers.append(i)
- text = string.join(msg.headers, '')+ '\n'+ QuotePeriods(msg.body)
- import OutgoingQueue
- queue_id = OutgoingQueue.enqueueMessage(sender, recipient, text)
- TrySMTPDelivery(recipient,sender,text,queue_id)
- finally:
- os._exit(0)
+ text = string.join(msg.headers, '')+ '\n'+ QuotePeriods(msg.body)
+ import OutgoingQueue
+ queue_id = OutgoingQueue.enqueueMessage(sender, recipient, text)
+ TrySMTPDelivery(recipient,sender,text,queue_id)
+ finally:
+ os._exit(0)
def TrySMTPDelivery(recipient, sender, text, queue_entry):