Example #1
0
def create_mailer(configdir):
    c = secrets.read(configdir)
    server = c.get('mail', 'server')
    if server is not None:
        # configure mail with authentication
        user = c.get('mail', 'user')
        password = c.get('mail', 'password')
        return GMailMailer(user, server, password)
    else:
        # use just a local smarthost
        smtp_host = c.get('mail', 'smarthost')
        return LocalSMTPMailer('*****@*****.**', smtp_host)
Example #2
0
def create_driver(configdir):
    return DuplicityDriver(sh.duplicity, secrets.read(configdir),
                           sendmail.create_mailer(configdir), configdir)