File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ from Mailman import Utils
3333from Mailman .i18n import _
3434from Mailman .Queue .sbcache import get_switchboard
3535from Mailman .Logging .Utils import LogStdErr
36+ from Mailman .Message import Message
37+ from email import message_from_string
3638
3739LogStdErr ('error' , 'confirm' )
3840
@@ -54,7 +56,16 @@ def main():
5456 # is a good example; if the limit is hit, the proc is SIGKILL'd giving us
5557 # no chance to save the message.
5658 cmdq = get_switchboard (mm_cfg .CMDQUEUE_DIR )
57- cmdq .enqueue (sys .stdin .read (), msgdata = {'listname' : listname , 'toconfirm' : 1 , '_plaintext' : 1 })
59+ msgtext = sys .stdin .read ()
60+ emsg = message_from_string (msgtext )
61+ if not isinstance (emsg , Message ):
62+ mmsg = Message ()
63+ for k , v in emsg .items ():
64+ mmsg [k ] = v
65+ mmsg .set_payload (emsg .get_payload ())
66+ else :
67+ mmsg = emsg
68+ cmdq .enqueue (mmsg , msgdata = {'listname' : listname , 'toconfirm' : 1 , '_plaintext' : 1 })
5869
5970
6071
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ from Mailman import Utils
3333from Mailman .i18n import _
3434from Mailman .Queue .sbcache import get_switchboard
3535from Mailman .Logging .Utils import LogStdErr
36+ from Mailman .Message import Message
37+ from email import message_from_string
3638
3739LogStdErr ('error' , 'join' )
3840
@@ -54,7 +56,16 @@ def main():
5456 # is a good example; if the limit is hit, the proc is SIGKILL'd giving us
5557 # no chance to save the message.
5658 cmdq = get_switchboard (mm_cfg .CMDQUEUE_DIR )
57- cmdq .enqueue (sys .stdin .read (), msgdata = {'listname' : listname , 'tojoin' : 1 , '_plaintext' : 1 })
59+ msgtext = sys .stdin .read ()
60+ emsg = message_from_string (msgtext )
61+ if not isinstance (emsg , Message ):
62+ mmsg = Message ()
63+ for k , v in emsg .items ():
64+ mmsg [k ] = v
65+ mmsg .set_payload (emsg .get_payload ())
66+ else :
67+ mmsg = emsg
68+ cmdq .enqueue (mmsg , msgdata = {'listname' : listname , 'tojoin' : 1 , '_plaintext' : 1 })
5869
5970
6071
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ from Mailman import Utils
3333from Mailman .i18n import _
3434from Mailman .Queue .sbcache import get_switchboard
3535from Mailman .Logging .Utils import LogStdErr
36+ from Mailman .Message import Message
37+ from email import message_from_string
3638
3739LogStdErr ('error' , 'leave' )
3840
@@ -53,7 +55,16 @@ def main():
5355 # is a good example; if the limit is hit, the proc is SIGKILL'd giving us
5456 # no chance to save the message.
5557 cmdq = get_switchboard (mm_cfg .CMDQUEUE_DIR )
56- cmdq .enqueue (sys .stdin .read (), msgdata = {'listname' : listname , 'toleave' : 1 , '_plaintext' : 1 })
58+ msgtext = sys .stdin .read ()
59+ emsg = message_from_string (msgtext )
60+ if not isinstance (emsg , Message ):
61+ mmsg = Message ()
62+ for k , v in emsg .items ():
63+ mmsg [k ] = v
64+ mmsg .set_payload (emsg .get_payload ())
65+ else :
66+ mmsg = emsg
67+ cmdq .enqueue (mmsg , msgdata = {'listname' : listname , 'toleave' : 1 , '_plaintext' : 1 })
5768
5869
5970if __name__ == '__main__' :
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ from Mailman import Utils
3333from Mailman .i18n import _
3434from Mailman .Queue .sbcache import get_switchboard
3535from Mailman .Logging .Utils import LogStdErr
36+ from Mailman .Message import Message
37+ from email import message_from_string
3638
3739LogStdErr ('error' , 'mailcmd' )
3840
@@ -54,10 +56,16 @@ def main():
5456 # is a good example; if the limit is hit, the proc is SIGKILL'd giving us
5557 # no chance to save the message.
5658 cmdq = get_switchboard (mm_cfg .CMDQUEUE_DIR )
57- cmdq .enqueue (sys .stdin .read (),
58- msgdata = {'listname' : listname ,
59- 'torequest' : 1 ,
60- '_plaintext' : 1 })
59+ msgtext = sys .stdin .read ()
60+ emsg = message_from_string (msgtext )
61+ if not isinstance (emsg , Message ):
62+ mmsg = Message ()
63+ for k , v in emsg .items ():
64+ mmsg [k ] = v
65+ mmsg .set_payload (emsg .get_payload ())
66+ else :
67+ mmsg = emsg
68+ cmdq .enqueue (mmsg , msgdata = {'listname' : listname , 'torequest' : 1 , '_plaintext' : 1 })
6169
6270
6371
You can’t perform that action at this time.
0 commit comments