Created
October 15, 2014 10:49
-
-
Save adamamyl/02a8f44981c8685f9c88 to your computer and use it in GitHub Desktop.
chuck mailman archive -> google groups (from mailman-users)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mailbox | |
import smtplib | |
mb = mailbox.mbox('/path/to/mbox', Create=False) # put actual mbox path | |
conn = smtplib.SMTP() | |
conn.connect(...) # connect to the server that will send the mail | |
# e.g. conn.connect('example.com', 587) | |
conn.starttls() # if required | |
conn.login(...) # if required | |
# e.g. conn.login('user@example.com', 'password' | |
for msg in mb: | |
conn.sendmail('you@example.com', # your actual email | |
'your_group@googlegroups.com', # your group's address | |
msg.as_string()) | |
conn.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://mail.python.org/pipermail/mailman-users/2014-October/077893.html for more info