@@ -40,7 +40,6 @@ type Config struct {
40
40
HTTPDisable bool
41
41
HTTPAddress string
42
42
HTTPPort uint16
43
- HTTPBodyLimit int64
44
43
HTTPURL string
45
44
SMTPDisable bool
46
45
SMTPAddress string
@@ -57,7 +56,6 @@ type Config struct {
57
56
type Raw struct {
58
57
Debug bool `koanf:"debug"`
59
58
TimeFormat string `koanf:"time_format"`
60
- MaxPayloadSize string `koanf:"max_payload_size"`
61
59
DataDirectory string `koanf:"data_directory"`
62
60
PythonExecutable string `koanf:"python_executable"`
63
61
RetentionEnvelopeCount string `koanf:"retention.envelope_count"`
@@ -68,6 +66,7 @@ type Raw struct {
68
66
SMTPPort uint16 `koanf:"smtp.port"`
69
67
SMTPUsername string `koanf:"smtp.username"`
70
68
SMTPPassword string `koanf:"smtp.password"`
69
+ SMTPMaxPayloadSize string `koanf:"smtp.max_payload_size"`
71
70
HTTPDisable bool `koanf:"http.disable"`
72
71
HTTPHost string `koanf:"http.host"`
73
72
HTTPPort uint16 `koanf:"http.port"`
@@ -98,20 +97,21 @@ type RawRule struct {
98
97
}
99
98
100
99
var RawDefault = struct {
101
- TimeFormat string `koanf:"time_format"`
102
- MaxPayloadSize string `koanf:"max_payload_size"`
103
- DataDirectory string `koanf:"data_directory"`
104
- PythonExecutable string `koanf:"python_executable"`
105
- SMTPPort uint16 `koanf:"smtp.port"`
106
- HTTPPort uint16 `koanf:"http.port"`
100
+ TimeFormat string `koanf:"time_format"`
101
+ MaxPayloadSize string `koanf:"max_payload_size"`
102
+ DataDirectory string `koanf:"data_directory"`
103
+ PythonExecutable string `koanf:"python_executable"`
104
+ SMTPPort uint16 `koanf:"smtp.port"`
105
+ SMTPMaxPayloadSize string `koanf:"smtp.max_payload_size"`
106
+ HTTPPort uint16 `koanf:"http.port"`
107
107
// IMAPPort uint16 `koanf:"imap.port"`
108
108
}{
109
- TimeFormat : TimeFormat12H ,
110
- MaxPayloadSize : "25 MB" ,
111
- DataDirectory : "smtpbridge_data" ,
112
- PythonExecutable : "python3" ,
113
- SMTPPort : 1025 ,
114
- HTTPPort : 8080 ,
109
+ TimeFormat : TimeFormat12H ,
110
+ SMTPMaxPayloadSize : "25 MB" ,
111
+ DataDirectory : "smtpbridge_data" ,
112
+ PythonExecutable : "python3" ,
113
+ SMTPPort : 1025 ,
114
+ HTTPPort : 8080 ,
115
115
// IMAPPort: 10143,
116
116
}
117
117
@@ -135,7 +135,7 @@ func WithFlagSet(flags *flag.FlagSet) *flag.FlagSet {
135
135
flags .Bool ("http-disable" , false , flagUsageBool (false , "Disable HTTP server." ))
136
136
flags .String ("http-host" , "" , flagUsageString ("" , "HTTP host address to listen on." ))
137
137
flags .Int ("http-port" , 0 , flagUsageInt (int (RawDefault .HTTPPort ), "HTTP port to listen on." ))
138
- flags .Int ("http-url" , 0 , flagUsageString ("" , "HTTP public URL (e.g. http://127.0.0.1:8080)." ))
138
+ flags .String ("http-url" , "" , flagUsageString ("" , "HTTP public URL (e.g. http://127.0.0.1:8080)." ))
139
139
140
140
// flags.Bool("imap-disable", false, flagUsageBool(false, "Disable IMAP server."))
141
141
// flags.String("imap-host", "", flagUsageString("", "IMAP host address to listen on."))
@@ -180,7 +180,7 @@ func (p Parser) Parse(raw Raw) (Config, error) {
180
180
return Config {}, err
181
181
}
182
182
183
- maxBytesForEachPayload , err := bytes .Parse (raw .MaxPayloadSize )
183
+ smtpMaxMessageSize , err := bytes .Parse (raw .SMTPMaxPayloadSize )
184
184
if err != nil {
185
185
return Config {}, err
186
186
}
@@ -315,11 +315,10 @@ func (p Parser) Parse(raw Raw) (Config, error) {
315
315
HTTPDisable : raw .HTTPDisable ,
316
316
HTTPAddress : httpAddress ,
317
317
HTTPPort : raw .HTTPPort ,
318
- HTTPBodyLimit : maxBytesForEachPayload ,
319
318
HTTPURL : raw .HTTPURL ,
320
319
SMTPDisable : raw .SMTPDisable ,
321
320
SMTPAddress : smtpAddress ,
322
- SMTPMaxMessageBytes : maxBytesForEachPayload ,
321
+ SMTPMaxMessageBytes : smtpMaxMessageSize ,
323
322
// IMAPDisable: raw.IMAPDisable,
324
323
// IMAPAddress: imapAddress,
325
324
Config : config ,
0 commit comments