feature/2.7.4 (#215)

1、SSL renew过程添加挑战适配器
2、转发邮件保留原始收件人地址
3、支持密送功能
4、升级所有依赖包
This commit is contained in:
Jinnrry authored and GitHub committed 2024-10-05 10:03:46 +08:00
1 parent 9e1a14f6ea
commit 223117283b
12 files changed
+231 -146

No files matched your search

+2 -2
View File
@@ -60,7 +60,7 @@ func MatchRule(ctx *context.Context, rule *dto.Rule, email *parsemail.Email) boo
return true
}
func DoRule(ctx *context.Context, rule *dto.Rule, email *parsemail.Email) {
func DoRule(ctx *context.Context, rule *dto.Rule, email *parsemail.Email, user *models.User) {
log.WithContext(ctx).Debugf("执行规则:%s", rule.Name)
switch rule.Action {
@@ -81,7 +81,7 @@ func DoRule(ctx *context.Context, rule *dto.Rule, email *parsemail.Email) {
log.WithContext(ctx).Errorf("Forward Error! loop forwarding!")
return
}
err := send.Forward(ctx, email, rule.Params)
err := send.Forward(ctx, email, rule.Params, user)
if err != nil {
log.WithContext(ctx).Errorf("Forward Error:%v", err)
}
+18
View File
@@ -93,6 +93,24 @@ func renewCertificate(privateKey *ecdsa.PrivateKey, cfg *config.Config) error {
return errors.Wrap(err)
}
if cfg.SSLType == config.SSLTypeAutoHTTP {
err = client.Challenge.SetHTTP01Provider(GetHttpChallengeInstance())
if err != nil {
return errors.Wrap(err)
}
} else if cfg.SSLType == config.SSLTypeAutoDNS {
err = client.Challenge.SetDNS01Provider(GetDnsChallengeInstance(), dns01.AddDNSTimeout(60*time.Minute))
if err != nil {
return errors.Wrap(err)
}
log.Errorf("Please Set DNS Record/请将以下内容添加到DNS记录中:\n")
for _, item := range GetDnsChallengeInstance().GetDNSSettings(nil) {
log.Errorf("Type:%s\tHost:%s\tValue:%s\n", item.Type, item.Host, item.Value)
}
}
var reg *registration.Resource
reg, err = client.Registration.ResolveAccountByKey()