@@ -30,23 +30,23 @@ const (
30
30
)
31
31
32
32
type Config struct {
33
- Debug bool
34
- TimeHourFormat string
35
- DatabasePath string
36
- AttachmentsDirectory string
37
- CSRFSecretPath string
38
- SessionSecretPath string
39
- SessionsDirectory string
40
- HTTPDisable bool
41
- HTTPAddress string
42
- HTTPPort uint16
43
- HTTPBodyLimit int64
44
- HTTPURL string
45
- SMTPDisable bool
46
- SMTPAddress string
47
- SMTPMaxMessageBytes int64
48
- IMAPDisable bool
49
- IMAPAddress string
33
+ Debug bool
34
+ TimeHourFormat string
35
+ DatabasePath string
36
+ AttachmentsDirectory string
37
+ CSRFSecretPath string
38
+ SessionSecretPath string
39
+ SessionsDirectory string
40
+ HTTPDisable bool
41
+ HTTPAddress string
42
+ HTTPPort uint16
43
+ HTTPBodyLimit int64
44
+ HTTPURL string
45
+ SMTPDisable bool
46
+ SMTPAddress string
47
+ SMTPMaxMessageBytes int64
48
+ // IMAPDisable bool
49
+ // IMAPAddress string
50
50
Config * models.Config
51
51
EndpointFactory endpoint.Factory
52
52
InternalEndpoints []models.Endpoint
@@ -74,11 +74,11 @@ type Raw struct {
74
74
HTTPUsername string `koanf:"http.username"`
75
75
HTTPPassword string `koanf:"http.password"`
76
76
HTTPURL string `koanf:"http.url"`
77
- IMAPDisable bool `koanf:"imap.disable"`
78
- IMAPHost string `koanf:"imap.host"`
79
- IMAPPort uint16 `koanf:"imap.port"`
80
- Endpoints map [string ]RawEndpoint
81
- Rules map [string ]RawRule
77
+ // IMAPDisable bool `koanf:"imap.disable"`
78
+ // IMAPHost string `koanf:"imap.host"`
79
+ // IMAPPort uint16 `koanf:"imap.port"`
80
+ Endpoints map [string ]RawEndpoint
81
+ Rules map [string ]RawRule
82
82
}
83
83
84
84
type RawEndpoint struct {
@@ -104,15 +104,15 @@ var RawDefault = struct {
104
104
PythonExecutable string `koanf:"python_executable"`
105
105
SMTPPort uint16 `koanf:"smtp.port"`
106
106
HTTPPort uint16 `koanf:"http.port"`
107
- IMAPPort uint16 `koanf:"imap.port"`
107
+ // IMAPPort uint16 `koanf:"imap.port"`
108
108
}{
109
109
TimeFormat : TimeFormat12H ,
110
110
MaxPayloadSize : "25 MB" ,
111
111
DataDirectory : "smtpbridge_data" ,
112
112
PythonExecutable : "python3" ,
113
113
SMTPPort : 1025 ,
114
114
HTTPPort : 8080 ,
115
- IMAPPort : 10143 ,
115
+ // IMAPPort: 10143,
116
116
}
117
117
118
118
func WithFlagSet (flags * flag.FlagSet ) * flag.FlagSet {
@@ -131,9 +131,9 @@ func WithFlagSet(flags *flag.FlagSet) *flag.FlagSet {
131
131
flags .Int ("http-port" , 0 , flagUsageInt (int (RawDefault .HTTPPort ), "HTTP port to listen on." ))
132
132
flags .Int ("http-url" , 0 , flagUsageString ("" , "HTTP public URL (e.g. http://127.0.0.1:8080)." ))
133
133
134
- flags .Bool ("imap-disable" , false , flagUsageBool (false , "Disable IMAP server." ))
135
- flags .String ("imap-host" , "" , flagUsageString ("" , "IMAP host address to listen on." ))
136
- flags .Int ("imap-port" , 0 , flagUsageInt (int (RawDefault .IMAPPort ), "HTTP port to listen on." ))
134
+ // flags.Bool("imap-disable", false, flagUsageBool(false, "Disable IMAP server."))
135
+ // flags.String("imap-host", "", flagUsageString("", "IMAP host address to listen on."))
136
+ // flags.Int("imap-port", 0, flagUsageInt(int(RawDefault.IMAPPort), "HTTP port to listen on."))
137
137
138
138
return flags
139
139
}
@@ -279,26 +279,26 @@ func (p Parser) Parse(raw Raw) (Config, error) {
279
279
280
280
smtpAddress := raw .SMTPHost + ":" + strconv .Itoa (int (raw .SMTPPort ))
281
281
282
- imapAddress := raw .IMAPHost + ":" + strconv .Itoa (int (raw .IMAPPort ))
282
+ // imapAddress := raw.IMAPHost + ":" + strconv.Itoa(int(raw.IMAPPort))
283
283
284
284
return Config {
285
- Debug : raw .Debug ,
286
- TimeHourFormat : timeHourFormat ,
287
- DatabasePath : databasePath ,
288
- CSRFSecretPath : csrfSecretPath ,
289
- SessionSecretPath : sessionSecretPath ,
290
- SessionsDirectory : sessionsDirectory ,
291
- AttachmentsDirectory : attachmentsDirectory ,
292
- HTTPDisable : raw .HTTPDisable ,
293
- HTTPAddress : httpAddress ,
294
- HTTPPort : raw .HTTPPort ,
295
- HTTPBodyLimit : maxBytesForEachPayload ,
296
- HTTPURL : raw .HTTPURL ,
297
- SMTPDisable : raw .SMTPDisable ,
298
- SMTPAddress : smtpAddress ,
299
- SMTPMaxMessageBytes : maxBytesForEachPayload ,
300
- IMAPDisable : raw .IMAPDisable ,
301
- IMAPAddress : imapAddress ,
285
+ Debug : raw .Debug ,
286
+ TimeHourFormat : timeHourFormat ,
287
+ DatabasePath : databasePath ,
288
+ CSRFSecretPath : csrfSecretPath ,
289
+ SessionSecretPath : sessionSecretPath ,
290
+ SessionsDirectory : sessionsDirectory ,
291
+ AttachmentsDirectory : attachmentsDirectory ,
292
+ HTTPDisable : raw .HTTPDisable ,
293
+ HTTPAddress : httpAddress ,
294
+ HTTPPort : raw .HTTPPort ,
295
+ HTTPBodyLimit : maxBytesForEachPayload ,
296
+ HTTPURL : raw .HTTPURL ,
297
+ SMTPDisable : raw .SMTPDisable ,
298
+ SMTPAddress : smtpAddress ,
299
+ SMTPMaxMessageBytes : maxBytesForEachPayload ,
300
+ // IMAPDisable: raw.IMAPDisable,
301
+ // IMAPAddress: imapAddress,
302
302
Config : config ,
303
303
EndpointFactory : endpointFactory ,
304
304
InternalEndpoints : endpoints ,
0 commit comments