1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-01-08 00:39:22 +02:00

Feature: Return queued Message ID in SMTP response (#293)

This commit is contained in:
Ralph Slooten 2024-05-09 16:54:03 +12:00
parent aa1a5a0954
commit fae0384dfe

View File

@ -24,10 +24,8 @@ var (
)
// MailHandler handles the incoming message to store in the database
func mailHandler(origin net.Addr, from string, to []string, data []byte) error {
_, err := Store(origin, from, to, data)
return err
func mailHandler(origin net.Addr, from string, to []string, data []byte) (string, error) {
return Store(origin, from, to, data)
}
// Store will attempt to save a message to the database
@ -212,10 +210,10 @@ func Listen() error {
return listenAndServe(config.SMTPListen, mailHandler, authHandler)
}
func listenAndServe(addr string, handler smtpd.Handler, authHandler smtpd.AuthHandler) error {
func listenAndServe(addr string, handler smtpd.MsgIDHandler, authHandler smtpd.AuthHandler) error {
srv := &smtpd.Server{
Addr: addr,
Handler: handler,
MsgIDHandler: handler,
HandlerRcpt: handlerRcpt,
Appname: "Mailpit",
Hostname: "",