2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ import (
15
15
16
16
func main () {
17
17
cfg := smtpsrv.ServerConfig {
18
- ReadTimeout : 60 * time .Second ,
18
+ ReadTimeout : time .Duration (* flagReadTimeout ) * time .Second ,
19
+ WriteTimeout : time .Duration (* flagWriteTimeout ) * time .Second ,
19
20
ListenAddr : * flagListenAddr ,
20
21
MaxMessageBytes : int (* flagMaxMessageSize ),
21
22
BannerDomain : * flagServerName ,
Original file line number Diff line number Diff line change 7
7
flagListenAddr = flag .String ("listen" , ":smtp" , "the smtp address to listen on" )
8
8
flagWebhook = flag .String ("webhook" , "http://localhost:8080/my/webhook" , "the webhook to send the data to" )
9
9
flagMaxMessageSize = flag .Int64 ("msglimit" , 1024 * 1024 * 2 , "maximum incoming message size" )
10
+ flagReadTimeout = flag .Int ("timeout.read" , 5 , "the read timeout in seconds" )
11
+ flagWriteTimeout = flag .Int ("timeout.write" , 5 , "the write timeout in seconds" )
10
12
)
11
13
12
14
func init () {
0 commit comments