Add SMTP Honeypot

This commit is contained in:
2021-11-06 14:04:11 +01:00
parent ed66cd5492
commit 4912eef00a
9 changed files with 231 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ type Config struct {
Honeypot HoneypotConfig `toml:"Honeypot"`
Frontend FrontendConfig `toml:"Frontend"`
Ports PortsConfig `toml:"Ports"`
SMTP SMTPConfig `toml:"SMTP"`
}
type StoreConfig struct {
Type string `toml:"Type"`
@@ -54,6 +55,12 @@ type PortsConfig struct {
UDPPorts []string `toml:"UDPPorts"`
}
type SMTPConfig struct {
Enable bool `toml:"Enable"`
Addr string `toml:"Addr"`
EnableMetrics bool `toml:"EnableMetrics"`
}
func FromReader(r io.Reader) (Config, error) {
var c Config
@@ -63,6 +70,7 @@ func FromReader(r io.Reader) (Config, error) {
c.Frontend.ListenAddr = ":8080"
c.Frontend.LogLevel = "INFO"
c.Frontend.AccessLogEnable = true
c.SMTP.Addr = ":25"
// Read from config
decoder := toml.NewDecoder(r)