Commit 3009b420 authored by Julien Muchembled's avatar Julien Muchembled

registry: new SMTP options for authentication and starttls

parent 5e30be77
......@@ -79,10 +79,16 @@ def main():
_('--key', required=True,
help="CA private key in .pem format. For example:\nopenssl"
" genpkey -out ca.key -algorithm rsa -pkeyopt rsa_keygen_bits:2048")
_('--mailhost', default=None,
help="SMTP host to send confirmation emails. For debugging"
" purpose, it can also be an absolute or existing path to"
" a mailbox file. If unset, registration by mail is disabled.")
help="SMTP login.")
help="SMTP password.")
_('--smtp-starttls', action='store_true',
help="Use STARTTLS for SMTP connections.")
_('--prefix-length', default=16, type=int,
help="Default length of allocated prefixes."
" If 0, registration by email is disabled.")
......@@ -353,6 +353,10 @@ class RegistryServer(object):
s = smtplib.SMTP(self.config.mailhost)
if self.config.smtp_starttls:
if self.config.smtp_user:
s.login(self.config.smtp_user, self.config.smtp_pwd)
s.sendmail(, email, msg.as_string())
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment