Compare commits
No commits in common. "10a65aed02e11375610d957d6dcbfe5fd82eef8d" and "62af1743f604c1fb348a05260f5daf409cbc1785" have entirely different histories.
10a65aed02
...
62af1743f6
2 changed files with 21 additions and 11 deletions
|
|
@ -158,11 +158,7 @@ func loadConfig(opts sdk.CheckerOptions) (*runConfig, error) {
|
||||||
return nil, fmt.Errorf("smtp_host is required")
|
return nil, fmt.Errorf("smtp_host is required")
|
||||||
}
|
}
|
||||||
if cfg.FromAddress == "" {
|
if cfg.FromAddress == "" {
|
||||||
domain := strings.TrimSpace(stringOpt(opts, "domain_name"))
|
return nil, fmt.Errorf("from_address is required")
|
||||||
if domain == "" {
|
|
||||||
return nil, fmt.Errorf("from_address is required when domain_name is not set")
|
|
||||||
}
|
|
||||||
cfg.FromAddress = "no-reply@" + strings.TrimSuffix(domain, ".")
|
|
||||||
}
|
}
|
||||||
parsedFrom, err := mail.ParseAddress(cfg.FromAddress)
|
parsedFrom, err := mail.ParseAddress(cfg.FromAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,19 @@ func Definition() *sdk.CheckerDefinition {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
UserOpts: []sdk.CheckerOptionDocumentation{
|
UserOpts: []sdk.CheckerOptionDocumentation{
|
||||||
|
{
|
||||||
|
Id: "happydeliver_url",
|
||||||
|
Type: "string",
|
||||||
|
Label: "happyDeliver instance URL (override)",
|
||||||
|
Description: "Override the operator-provided happyDeliver URL.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Id: "happydeliver_token",
|
||||||
|
Type: "string",
|
||||||
|
Label: "happyDeliver API token (override)",
|
||||||
|
Description: "Override the operator-provided happyDeliver token.",
|
||||||
|
Secret: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Id: "smtp_host",
|
Id: "smtp_host",
|
||||||
Type: "string",
|
Type: "string",
|
||||||
|
|
@ -71,6 +84,13 @@ func Definition() *sdk.CheckerDefinition {
|
||||||
Choices: []string{"starttls", "tls", "none"},
|
Choices: []string{"starttls", "tls", "none"},
|
||||||
Default: "starttls",
|
Default: "starttls",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Id: "from_address",
|
||||||
|
Type: "string",
|
||||||
|
Label: "From address",
|
||||||
|
Description: "Address used in the From header of the test email. Must be in the tested domain.",
|
||||||
|
Required: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Id: "subject_override",
|
Id: "subject_override",
|
||||||
Type: "string",
|
Type: "string",
|
||||||
|
|
@ -112,12 +132,6 @@ func Definition() *sdk.CheckerDefinition {
|
||||||
Label: "Domain name",
|
Label: "Domain name",
|
||||||
AutoFill: sdk.AutoFillDomainName,
|
AutoFill: sdk.AutoFillDomainName,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Id: "from_address",
|
|
||||||
Type: "string",
|
|
||||||
Label: "From address",
|
|
||||||
Description: "Address used in the From header of the test email. Must be in the tested domain. Defaults to no-reply@<domain>.",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Rules: []sdk.CheckRule{
|
Rules: []sdk.CheckRule{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue