mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 00:13:47 +03:00
quickstart: if initial address has non-ascii localpart, use "postmaster@" for registering with let's encrypt
because let's encrypt won't create an account for contact addresses with non-ascii characters. we'll get an error message like: 400 urn:ietf:params:acme:error:invalidContact: Error creating new account :: contact email [\"mailto:...\"] contains non-ASCII characters found & reported by arnt, thanks!
This commit is contained in:
parent
ad8c5616b1
commit
f4b6e14cb9
1 changed files with 12 additions and 1 deletions
|
@ -650,15 +650,26 @@ many authentication failures).
|
|||
Hostname: dnshostname.Name(),
|
||||
AdminPasswordFile: "adminpasswd",
|
||||
}
|
||||
|
||||
// todo: let user specify an alternative fallback address?
|
||||
// Don't attempt to use a non-ascii localpart with Let's Encrypt, it won't work.
|
||||
// Messages to postmaster will get to the account too.
|
||||
var contactEmail string
|
||||
if addr.Localpart.IsInternational() {
|
||||
contactEmail = smtp.Address{Localpart: "postmaster", Domain: addr.Domain}.Pack(false)
|
||||
} else {
|
||||
contactEmail = addr.Pack(false)
|
||||
}
|
||||
if !existingWebserver {
|
||||
sc.ACME = map[string]config.ACME{
|
||||
"letsencrypt": {
|
||||
DirectoryURL: "https://acme-v02.api.letsencrypt.org/directory",
|
||||
ContactEmail: args[0], // todo: let user specify an alternative fallback address?
|
||||
ContactEmail: contactEmail,
|
||||
IssuerDomainName: "letsencrypt.org",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
dataDir := "data" // ../data is relative to config/
|
||||
os.MkdirAll(dataDir, 0770)
|
||||
adminpw := pwgen()
|
||||
|
|
Loading…
Reference in a new issue