Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F34445767
generate_mbox.py
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Legoktm
May 8 2021, 1:36 AM
2021-05-08 01:36:25 (UTC+0)
Size
534 B
Referenced Files
None
Subscribers
None
generate_mbox.py
View Options
#!/usr/bin/env python3
from
email.message
import
EmailMessage
import
mailbox
def
main
():
path
=
"/home/km/tmp/test.mbox"
mbox
=
mailbox
.
mbox
(
path
,
create
=
True
)
count
=
0
while
count
<
1000000
:
msg
=
EmailMessage
()
msg
[
'Subject'
]
=
f
"Test email #{count}"
msg
[
'From'
]
=
"test@example.org"
msg
[
"To"
]
=
"test5@polymorphic.lists.wmcloud.org"
msg
.
set_content
(
"blah blah blah "
*
100
)
mbox
.
add
(
msg
)
count
+=
1
mbox
.
close
()
if
__name__
==
"__main__"
:
main
()
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9067922
Default Alt Text
generate_mbox.py (534 B)
Attached To
Mode
P15864 generate_mbox.py
Attached
Detach File
Event Timeline
Log In to Comment