mirror of
https://github.com/wiggin77/mailrelay.git
synced 2024-11-25 08:33:09 +01:00
Merge pull request #2 from Progymedia/allowed-hosts
added AllowedHosts configuration
This commit is contained in:
commit
7430423aa2
@ -25,7 +25,8 @@ On local PC (192.168.1.54) create file `/etc/mailrelay.json` with contents:
|
||||
"smtp_username": "username@fastmail.com",
|
||||
"smtp_password": "secretAppPassword",
|
||||
"local_listen_ip": "0.0.0.0",
|
||||
"local_listen_port": 2525
|
||||
"local_listen_port": 2525,
|
||||
"allowed_hosts": ["*"]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -5,4 +5,5 @@
|
||||
"smtp_password": "secret_app_password",
|
||||
"local_listen_port": 2525,
|
||||
"local_listen_ip": "0.0.0.0"
|
||||
"allowed_hosts": ["*"]
|
||||
}
|
||||
|
1
main.go
1
main.go
@ -21,6 +21,7 @@ type mailRelayConfig struct {
|
||||
SMTPPassword string `json:"smtp_password"`
|
||||
LocalListenIP string `json:"local_listen_ip"`
|
||||
LocalListenPort int `json:"local_listen_port"`
|
||||
AllowedHosts []string `json:"allowed_hosts"`
|
||||
}
|
||||
|
||||
// Logger provides application logging.
|
||||
|
@ -14,7 +14,7 @@ func Start(appConfig *mailRelayConfig) (err error) {
|
||||
|
||||
listen := fmt.Sprintf("%s:%d", appConfig.LocalListenIP, appConfig.LocalListenPort)
|
||||
|
||||
cfg := &guerrilla.AppConfig{LogFile: log.OutputStdout.String(), AllowedHosts: []string{"warpmail.net"}}
|
||||
cfg := &guerrilla.AppConfig{LogFile: log.OutputStdout.String(), AllowedHosts: appConfig.AllowedHosts}
|
||||
sc := guerrilla.ServerConfig{
|
||||
ListenInterface: listen,
|
||||
IsEnabled: true,
|
||||
|
Loading…
Reference in New Issue
Block a user