修复helo标识错误
This commit is contained in:
parent
51e91472a1
commit
7f28a19749
@ -38,7 +38,7 @@ type Config struct {
|
||||
//go:embed tables/*
|
||||
var tableConfig embed.FS
|
||||
|
||||
const Version = "2.2.6"
|
||||
const Version = "2.2.7"
|
||||
|
||||
const DBTypeMySQL = "mysql"
|
||||
const DBTypeSQLite = "sqlite"
|
||||
|
||||
@ -29,8 +29,6 @@ func HttpStart() {
|
||||
HttpPort = config.Instance.HttpPort
|
||||
}
|
||||
|
||||
log.Infof("HttpServer Start On Port :%d", HttpPort)
|
||||
|
||||
if config.Instance.HttpsEnabled != 2 {
|
||||
mux.HandleFunc("/", controllers.Interceptor)
|
||||
httpServer = &http.Server{
|
||||
@ -66,6 +64,7 @@ func HttpStart() {
|
||||
mux.HandleFunc("/api/rule/del", contextIterceptor(controllers.DelRule))
|
||||
mux.HandleFunc("/attachments/", contextIterceptor(controllers.GetAttachments))
|
||||
mux.HandleFunc("/attachments/download/", contextIterceptor(controllers.Download))
|
||||
log.Infof("HttpServer Start On Port :%d", HttpPort)
|
||||
httpServer = &http.Server{
|
||||
Addr: fmt.Sprintf(":%d", HttpPort),
|
||||
Handler: session.Instance.LoadAndSave(mux),
|
||||
|
||||
@ -72,9 +72,8 @@ func HttpsStart() {
|
||||
HttpsPort = config.Instance.HttpsPort
|
||||
}
|
||||
|
||||
log.Infof("Https Server Start On Port :%d", HttpsPort)
|
||||
|
||||
if config.Instance.HttpsEnabled != 2 {
|
||||
log.Infof("Https Server Start On Port :%d", HttpsPort)
|
||||
httpsServer = &http.Server{
|
||||
Addr: fmt.Sprintf(":%d", HttpsPort),
|
||||
Handler: session.Instance.LoadAndSave(mux),
|
||||
|
||||
@ -2,6 +2,7 @@ package http_server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"pmail/config"
|
||||
@ -29,7 +30,7 @@ func SetupStart() {
|
||||
if config.Instance != nil && config.Instance.HttpPort > 0 {
|
||||
HttpPort = config.Instance.HttpPort
|
||||
}
|
||||
|
||||
log.Infof("HttpServer Start On Port :%d", HttpPort)
|
||||
setupServer = &http.Server{
|
||||
Addr: fmt.Sprintf(":%d", HttpPort),
|
||||
Handler: mux,
|
||||
|
||||
@ -28,6 +28,7 @@ import (
|
||||
"net"
|
||||
"net/smtp"
|
||||
"net/textproto"
|
||||
"pmail/config"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@ -88,7 +89,12 @@ func NewClient(conn net.Conn, host string) (*Client, error) {
|
||||
text.Close()
|
||||
return nil, err
|
||||
}
|
||||
c := &Client{Text: text, conn: conn, serverName: host, localName: "jinnrry.com"}
|
||||
localName := "domain.com"
|
||||
if config.Instance != nil && config.Instance.Domain != "" {
|
||||
localName = config.Instance.Domain
|
||||
}
|
||||
|
||||
c := &Client{Text: text, conn: conn, serverName: host, localName: localName}
|
||||
_, c.tls = conn.(*tls.Conn)
|
||||
return c, nil
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user