Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
chore: support disabling amtp auth (resolve #31, close #47)
Browse files Browse the repository at this point in the history
  • Loading branch information
muety committed Jul 9, 2023
1 parent 37e2fcc commit 448b8ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ You can specify configuration options either via a config file (`config.yml`) or
| `web.public_url` | `MW_PUBLIC_URL` | `http://localhost:3000` | The URL under which your MailWhale server is available from the public internet |
| `smtp.host` | `MW_SMTP_HOST` | - | SMTP relay host name or IP |
| `smtp.port` | `MW_SMTP_PORT` | - | SMTP relay port |
| `smtp.username` | `MW_SMTP_USER` | - | SMTP relay authentication user name |
| `smtp.username` | `MW_SMTP_USER` | - | SMTP relay authentication user name (leave blank to disable authentication) |
| `smtp.password` | `MW_SMTP_PASS` | - | SMTP relay authentication password |
| `smtp.tls` | `MW_SMTP_TLS` | `false` | Whether to require full TLS (not to be confused with STARTTLS) for the SMTP relay |
| `smtp.skip_verify_tls` | `MW_SMTP_SKIP_VERIFY_TLS` | `false` | Whether to skip certificate verification (e.g. trust self-signed certs) |
Expand Down
9 changes: 5 additions & 4 deletions service/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ type SendService struct {

func NewSendService() *SendService {
config := conf.Get()
return &SendService{
config: config,
auth: sasl.NewPlainClient(
service := &SendService{config: config}
if config.Smtp.Username != "" {
service.auth = sasl.NewPlainClient(
"",
config.Smtp.Username,
config.Smtp.Password,
),
)
}
return service
}

func (s *SendService) Send(mail *types.Mail) error {
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.3
0.13.4

0 comments on commit 448b8ff

Please sign in to comment.