Skip to content

Anbcorp/python-gpgmailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Helper class to send gpg encrypted mail to single or multiple recipients.

  • Support attachement as per RFC3156
  • Public key management must be handled by hand using gpg tools.

Typical Usage

from mailer import Mailer

mailr = Mailer(
    sent_from="[email protected]",
    gpghome="/home/me/.gpg",
    server="smtp.mydomain.com"
    )

recipients = ['[email protected]', '[email protected]', '[email protected]']

# filter out recipients that we do not have a pubkey for
valid_recipients = [ recipient for recipient in recipients 
                        if mailer.valid_pubkey(recipient) ]

attachements = ['funny_kitten.gif', 'doge_meme.png']


msg = """
Hi,

Found those funny images, check them out !

Very kitteh, such funny.

Live long and prosper,
"""

mailr.send_mail(
    valid_recipients,
    'Check those funny images',
    msg,
    attachements)

About

Send encrypted mails and attachements to people

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages