Other: Only listen on localhost and add send test

We should only listen on constants.Host when serving IMAP and SMTP.
This change fixes that. It also adds a test that we can send over SMTP
and receive over IMAP.
This commit is contained in:
James Houlahan
2022-10-28 13:38:16 +02:00
parent cb42358e2f
commit 93d9ae32fc
7 changed files with 124 additions and 11 deletions

View File

@ -52,11 +52,25 @@ func NewDefaultProvider(name string) (*DefaultProvider, error) {
return nil, err
}
return &DefaultProvider{
provider := &DefaultProvider{
config: filepath.Join(config, name),
data: filepath.Join(data, name),
cache: filepath.Join(cache, name),
}, nil
}
if err := os.MkdirAll(provider.config, 0o700); err != nil {
return nil, err
}
if err := os.MkdirAll(provider.data, 0o700); err != nil {
return nil, err
}
if err := os.MkdirAll(provider.cache, 0o700); err != nil {
return nil, err
}
return provider, nil
}
// UserConfig returns a directory that can be used to store user-specific configuration.