mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-09 17:55:57 +00:00
smtpsrv: Implement a post-DATA hook
This patch implements a post-DATA hook, which is run after receiving the data but before sending a reply. It can be used to implement content filtering when receiving email, for example for passing the email through an anti-spam or an anti-virus.
This commit is contained in:
@@ -53,6 +53,9 @@ type Server struct {
|
||||
|
||||
// Queue where we put incoming mail.
|
||||
queue *queue.Queue
|
||||
|
||||
// Path to the Post-DATA hook.
|
||||
PostDataHook string
|
||||
}
|
||||
|
||||
func NewServer() *Server {
|
||||
@@ -193,6 +196,7 @@ func (s *Server) serve(l net.Listener, mode SocketMode) {
|
||||
sc := &Conn{
|
||||
hostname: s.Hostname,
|
||||
maxDataSize: s.MaxDataSize,
|
||||
postDataHook: s.PostDataHook,
|
||||
conn: conn,
|
||||
tc: textproto.NewConn(conn),
|
||||
mode: mode,
|
||||
|
||||
Reference in New Issue
Block a user