Skip to content

Instantly share code, notes, and snippets.

@adamamyl
Created October 15, 2014 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamamyl/02a8f44981c8685f9c88 to your computer and use it in GitHub Desktop.
Save adamamyl/02a8f44981c8685f9c88 to your computer and use it in GitHub Desktop.
chuck mailman archive -> google groups (from mailman-users)
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()
@adamamyl
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment