1
0
mirror of https://github.com/chylex/SMTP-Relay.git synced 2024-10-17 08:42:46 +02:00
Commit Graph

286 Commits

Author SHA1 Message Date
dependabot[bot]
a5ee525825
Bump wangyoucao577/go-release-action from v1.16 to v1.17
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from v1.16 to v1.17.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.16...1a87d97ce87db435508d150622a9ab5472db15ac)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-13 07:18:35 +00:00
Bernhard Froehlich
441a53cfd9
Fix code formatting with gofmt -s 2021-04-03 19:00:38 +00:00
Bernhard Froehlich
7b199cc6ae
Bump Go version for CI builds to 1.16 2021-04-02 18:51:23 +00:00
Bernhard Froehlich
184d5f8611
Bump Go version for builds to 1.16.3 2021-04-02 18:49:53 +00:00
Bernhard Fröhlich
9e8b5517a6
Merge pull request #27 from decke/26-tls-reqd-for-auth
Don't allow configuration requiring authentication with non-TLS listener
2021-04-02 20:41:38 +02:00
Bernhard Fröhlich
65f0cfcfbd
Merge pull request #28 from decke/dependabot/github_actions/wangyoucao577/go-release-action-v1.16
Bump wangyoucao577/go-release-action from v1.15 to v1.16
2021-04-02 20:29:02 +02:00
dependabot[bot]
410c70d86f
Bump wangyoucao577/go-release-action from v1.15 to v1.16
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from v1.15 to v1.16.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.15...d00bb7360b2dd6a39f1a7ca198b8289582eee2df)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 07:35:56 +00:00
Jonathon Reinhart
247d187576 Don't allow a configuration requiring auth with a non-TLS listener
This fixes #26
2021-04-01 01:12:34 -04:00
Jonathon Reinhart
45a676e274 Add localAuthRequired() helper function
This just makes the configuration state a little more obvious.
2021-04-01 01:12:34 -04:00
Jonathon Reinhart
ca1ccd85e3 Refactor parsing of -listen string out into separate config function
This makes the "for each listen address" loop in main() look even cleaner.
2021-04-01 01:12:34 -04:00
Jonathon Reinhart
42abf27c1f
Merge pull request #22 from decke/smtpd-shutdown
Handle signals and gracefully shut down, waiting for clients
2021-04-01 01:11:48 -04:00
Jonathon Reinhart
1b7b551f65 Handle signals and gracefully shut down server 2021-04-01 01:07:30 -04:00
Bernhard Fröhlich
2cd636c082
Merge pull request #19 from decke/allow-any-sender-recipient
Move remaining config option parsing to ConfigLoad()
2021-04-01 06:05:52 +02:00
Jonathon Reinhart
3debf4127d Adjust remote auth disabled check syntax 2021-03-31 17:18:13 -04:00
Bernhard Fröhlich
03b8b78f53
Merge pull request #24 from decke/dependabot/go_modules/github.com/chrj/smtpd-0.3.0
Bump github.com/chrj/smtpd from 0.2.0 to 0.3.0
2021-03-29 22:26:38 +02:00
dependabot[bot]
49c6880175
Bump github.com/chrj/smtpd from 0.2.0 to 0.3.0
Bumps [github.com/chrj/smtpd](https://github.com/chrj/smtpd) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/chrj/smtpd/releases)
- [Commits](https://github.com/chrj/smtpd/compare/v0.2.0...v0.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-29 20:24:57 +00:00
Bernhard Fröhlich
5470132251
Merge pull request #23 from decke/dependabot/github_actions/wangyoucao577/go-release-action-v1.15
Bump wangyoucao577/go-release-action from v1.14 to v1.15
2021-03-18 15:41:11 +01:00
dependabot[bot]
898f8e44cf
Bump wangyoucao577/go-release-action from v1.14 to v1.15
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from v1.14 to v1.15.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.14...1caa775ade7bd6692dd752d506f106792e76843d)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-18 07:16:46 +00:00
Jonathon Reinhart
22ef0c2ee6 Move SMTP auth setup to ConfigLoad()
This has several benefits:
- Configuration errors are caught at startup rather than upon a connection
- mailHandler() has less work to do for each connection

Rather than relying on remote_user and remote_pass to control whether
authentication is used, introduce an explicit "none" type for
remote_auth, and make that the default. (This is effectively the same
default behavior since remote_user and remote_pass default to empty.)

Also, we are in a better position to more thoroughly check for
configuration errors or mismatches:
- If remote_auth is given, remote_user and remote_pass are required.
- If remote_auth is given, remote_host is also required (because it
  makes no sense to say we're going to authenticate if we have no server
  to which to authenticate.)
- If remote_user or remote_pass are given, remote_auth cannot be "none".
2021-03-14 18:41:54 -04:00
Bernhard Fröhlich
8eea677a3d
Merge pull request #20 from decke/dependabot/go_modules/github.com/sirupsen/logrus-1.8.1
Bump github.com/sirupsen/logrus from 1.7.0 to 1.8.1
2021-03-14 21:27:11 +01:00
dependabot[bot]
9f2497d948
Bump github.com/sirupsen/logrus from 1.7.0 to 1.8.1
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.7.0 to 1.8.1.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.7.0...v1.8.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-14 20:23:53 +00:00
Jonathon Reinhart
76ef135d33 Clarify allowed_sender/allowed_recipient empty string behavior 2021-03-14 12:36:34 -04:00
Jonathon Reinhart
7c0ba34025 Move compilation of allowed_recipients to ConfigLoad()
This has several benefits:
- Configuration errors are caught at startup rather than upon a connection
- recipientChecker() has less work to do for each connection
2021-03-14 12:31:38 -04:00
Jonathon Reinhart
a896ab2847 Move compilation of allowed_sender to ConfigLoad()
This has several benefits:
- Configuration errors are caught at startup rather than upon a connection
- senderChecker() has less work to do for each connection
2021-03-14 12:31:38 -04:00
Jonathon Reinhart
c9b55b833b
Merge pull request #18 from decke/allow-any-net
Allow any network and related enhancements
2021-03-13 20:47:09 -05:00
Jonathon Reinhart
918df65a3a Require that networks in allowed_nets are networks and not hosts 2021-03-13 20:40:25 -05:00
Jonathon Reinhart
0503c12ccd Allow "allowed_nets" to be empty, meaning any network is allowed 2021-03-13 20:34:48 -05:00
Jonathon Reinhart
ef3f9c8ea0 Move parsing of "allowed_nets" out to ConfigLoad()
This has several benefits:
- Configuration errors are caught at startup rather than upon a connection
- connectionChecker() has less work to do for each connection
2021-03-13 20:34:48 -05:00
Jonathon Reinhart
4036213dd5 Simplify peerIP determination in connectionChecker()
peerIP = net.ParseIP(addr.IP.String())

can be simplified to just:

    peerIP = addr.IP

but we can also skip the safe cast since we know the net.Addr will always
be net.TCPAddr because we only have TCP listeners.
2021-03-13 20:19:07 -05:00
Bernhard Fröhlich
2475cadbad
Merge pull request #16 from decke/discard
Discard mail if remote_host is not set
2021-03-13 19:06:08 +01:00
Jonathon Reinhart
20ca816160 Discard mail if remote_host is not set
This is useful for test environments.
2021-03-13 09:28:04 -05:00
Bernhard Fröhlich
d1933a2e35
Merge pull request #15 from decke/structured-logging
Add structured logging via logrus
2021-03-13 11:02:19 +01:00
Jonathon Reinhart
9921b38046 Explicitly configure default logfile for stderr 2021-03-13 03:25:57 -05:00
Jonathon Reinhart
095fba119a Change default logfile to empty string (meaning stderr)
The causes logrus to write to stderr.
2021-03-13 03:25:57 -05:00
Jonathon Reinhart
34cb47c364 Implement structured logs using logrus
This was based loosely on an earlier implementation by
Danny Kopping <danny.kopping@grafana.com>
2021-03-13 03:25:57 -05:00
Bernhard Froehlich
b36ed8eddb
net/smtp: adds support for the SMTPUTF8 extension
Obtained from:	https://github.com/golang/go/issues/19860
2021-02-25 21:15:16 +00:00
Bernhard Froehlich
822dbbce7d
Bump Go to 1.15 for CI builds 2021-02-17 19:31:36 +00:00
Bernhard Fröhlich
42f5c68f0b
Merge pull request #12 from decke/dependabot/github_actions/actions/setup-go-v2.1.3
Bump actions/setup-go from v1 to v2.1.3
2021-02-17 20:30:36 +01:00
dependabot[bot]
cd2dab8f8f
Bump actions/setup-go from v1 to v2.1.3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from v1 to v2.1.3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v1...37335c7bb261b353407cff977110895fa0b4f7d8)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-17 19:29:13 +00:00
Bernhard Froehlich
f2af99dc52
Add github-actions to dependabot config 2021-02-17 19:28:08 +00:00
Bernhard Froehlich
23e10bb03e
Add dependabot.yml for automatic Go dependency checking 2021-02-17 19:23:20 +00:00
Bernhard Froehlich
5ba64c5c6e
Add new Release Workflow using Github Actions and wangyoucao577/go-release-action 2021-02-17 12:49:24 +00:00
Bernhard Froehlich
7f34fcbc99
gofmt: Fix formatting 2021-02-16 15:57:50 +00:00
Bernhard Froehlich
97943c87e7
Update go dependencies 2021-02-16 15:33:12 +00:00
Bernhard Froehlich
fefeccec39
Remove weak CBC cipher suites and bump minimum TLS version to TLS 1.2 2021-02-16 15:31:53 +00:00
Bernhard Fröhlich
c781938999
Merge pull request #11 from JonathonReinhart/minor-cleanup-fixes
Minor cleanup and fixes
2021-02-16 15:36:52 +01:00
Jonathon Reinhart
009ae8f73a hasher: Check number of arguments
This makes for a better user experience than a go segfault.
2021-02-15 00:18:15 -05:00
Jonathon Reinhart
70dfe6b128 Only call AuthLoadFile() once at startup 2021-02-15 00:08:37 -05:00
Jonathon Reinhart
7fa0eebf95 Simplify range code for setting up listeners 2021-02-15 00:00:38 -05:00
Jonathon Reinhart
ecf830865c Add helpful log messages for various error cases 2021-02-14 23:49:17 -05:00