mirror of
https://github.com/mjl-/mox.git
synced 2025-01-14 01:06:27 +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(),
|
Hostname: dnshostname.Name(),
|
||||||
AdminPasswordFile: "adminpasswd",
|
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 {
|
if !existingWebserver {
|
||||||
sc.ACME = map[string]config.ACME{
|
sc.ACME = map[string]config.ACME{
|
||||||
"letsencrypt": {
|
"letsencrypt": {
|
||||||
DirectoryURL: "https://acme-v02.api.letsencrypt.org/directory",
|
DirectoryURL: "https://acme-v02.api.letsencrypt.org/directory",
|
||||||
ContactEmail: args[0], // todo: let user specify an alternative fallback address?
|
ContactEmail: contactEmail,
|
||||||
IssuerDomainName: "letsencrypt.org",
|
IssuerDomainName: "letsencrypt.org",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dataDir := "data" // ../data is relative to config/
|
dataDir := "data" // ../data is relative to config/
|
||||||
os.MkdirAll(dataDir, 0770)
|
os.MkdirAll(dataDir, 0770)
|
||||||
adminpw := pwgen()
|
adminpw := pwgen()
|
||||||
|
|
Loading…
Reference in a new issue