2
0
forked from drew/smtprelay

288 Commits

Author SHA1 Message Date
Bernhard Froehlich
6919131eec ci: Add missing permissions for release workflow 2024-05-25 19:32:34 +02:00
Bernhard Froehlich
dbfc144e41 Update Go version to 1.22 for release builds 2024-05-25 07:28:59 +02:00
Bernhard Froehlich
ae0f9ba0b6 Update go dependencies 2024-05-25 07:26:54 +02:00
dependabot[bot]
3f5a9f3e9a Bump golang.org/x/crypto from 0.21.0 to 0.22.0 (#154)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.21.0 to 0.22.0.
- [Commits](https://github.com/golang/crypto/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-06 07:19:45 +02:00
dependabot[bot]
76cef7b0e3 Bump golang.org/x/crypto from 0.19.0 to 0.21.0 (#153)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.19.0 to 0.21.0.
- [Commits](https://github.com/golang/crypto/compare/v0.19.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bernhard Fröhlich <decke@bluelife.at>
2024-03-07 09:34:39 +01:00
Bernhard Fröhlich
3960b176c4 Merge pull request #152 from decke/dependabot/go_modules/github.com/stretchr/testify-1.9.0
Bump github.com/stretchr/testify from 1.8.4 to 1.9.0
2024-03-07 09:29:52 +01:00
dependabot[bot]
4997b0c8df Bump github.com/stretchr/testify from 1.8.4 to 1.9.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 10:17:40 +00:00
Bernhard Fröhlich
a994578ca1 Merge pull request #150 from decke/dependabot/go_modules/golang.org/x/crypto-0.19.0
Bump golang.org/x/crypto from 0.18.0 to 0.19.0
2024-02-08 13:43:00 +01:00
dependabot[bot]
f549405b98 Bump golang.org/x/crypto from 0.18.0 to 0.19.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.19.0.
- [Commits](https://github.com/golang/crypto/compare/v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 10:25:04 +00:00
Bernhard Fröhlich
5ee3319e28 Merge pull request #146 from decke/dependabot/go_modules/github.com/google/uuid-1.6.0
Bump github.com/google/uuid from 1.5.0 to 1.6.0
2024-01-25 10:26:01 +01:00
dependabot[bot]
731de2a4da Bump github.com/google/uuid from 1.5.0 to 1.6.0
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/google/uuid/releases)
- [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/uuid/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/google/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-24 10:56:33 +00:00
Bernhard Fröhlich
1106ce37b8 Merge pull request #145 from decke/dependabot/go_modules/golang.org/x/crypto-0.18.0
Bump golang.org/x/crypto from 0.17.0 to 0.18.0
2024-01-10 10:49:11 +01:00
dependabot[bot]
3a096aee89 Bump golang.org/x/crypto from 0.17.0 to 0.18.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.17.0 to 0.18.0.
- [Commits](https://github.com/golang/crypto/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 10:52:14 +00:00
Bernhard Fröhlich
d28934043c Merge pull request #143 from decke/dependabot/go_modules/golang.org/x/crypto-0.17.0
Bump golang.org/x/crypto from 0.16.0 to 0.17.0
2023-12-19 12:37:14 +01:00
dependabot[bot]
33fcee6266 Bump golang.org/x/crypto from 0.16.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 00:02:01 +00:00
Bernhard Fröhlich
6c6d66261e Merge pull request #142 from decke/dependabot/github_actions/github/codeql-action-3
Bump github/codeql-action from 2 to 3
2023-12-14 11:48:03 +01:00
dependabot[bot]
da64633135 Bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-14 10:19:13 +00:00
Bernhard Fröhlich
a1fa65bd0e Merge pull request #141 from decke/dependabot/go_modules/github.com/google/uuid-1.5.0
Bump github.com/google/uuid from 1.4.0 to 1.5.0
2023-12-13 16:03:21 +01:00
dependabot[bot]
9b0a64c7d6 Bump github.com/google/uuid from 1.4.0 to 1.5.0
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/google/uuid/releases)
- [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/uuid/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/google/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-13 10:42:58 +00:00
Bernhard Fröhlich
a6b9725bad Merge pull request #140 from decke/dependabot/github_actions/actions/setup-go-5
Bump actions/setup-go from 4 to 5
2023-12-07 21:21:49 +01:00
dependabot[bot]
55129e2927 Bump actions/setup-go from 4 to 5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 10:25:23 +00:00
Bernhard Fröhlich
5dc56e4c34 Merge pull request #139 from decke/dependabot/go_modules/golang.org/x/crypto-0.16.0
Bump golang.org/x/crypto from 0.15.0 to 0.16.0
2023-11-28 11:30:07 +01:00
dependabot[bot]
e3d4135b09 Bump golang.org/x/crypto from 0.15.0 to 0.16.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.15.0 to 0.16.0.
- [Commits](https://github.com/golang/crypto/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-28 10:21:41 +00:00
Bernhard Fröhlich
1a27c43585 Merge pull request #137 from decke/dependabot/go_modules/golang.org/x/crypto-0.15.0
Bump golang.org/x/crypto from 0.14.0 to 0.15.0
2023-11-09 12:55:53 +01:00
dependabot[bot]
5998596059 Bump golang.org/x/crypto from 0.14.0 to 0.15.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.15.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-09 10:01:55 +00:00
Bernhard Fröhlich
052f6ccc1f Merge pull request #135 from decke/dependabot/go_modules/github.com/google/uuid-1.4.0
Bump github.com/google/uuid from 1.3.1 to 1.4.0
2023-10-28 19:27:21 +02:00
dependabot[bot]
1f035b73ce Bump github.com/google/uuid from 1.3.1 to 1.4.0
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/google/uuid/releases)
- [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/uuid/compare/v1.3.1...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/google/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-27 10:15:51 +00:00
Bernhard Fröhlich
ef45535897 Merge pull request #133 from decke/dependabot/go_modules/golang.org/x/crypto-0.14.0
Bump golang.org/x/crypto from 0.13.0 to 0.14.0
2023-10-06 15:18:06 +02:00
dependabot[bot]
95b2a6a072 Bump golang.org/x/crypto from 0.13.0 to 0.14.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.13.0 to 0.14.0.
- [Commits](https://github.com/golang/crypto/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-06 10:54:19 +00:00
Bernhard Fröhlich
2efa19c544 Merge pull request #130 from decke/dependabot/go_modules/golang.org/x/crypto-0.13.0
Bump golang.org/x/crypto from 0.12.0 to 0.13.0
2023-09-06 15:17:53 +02:00
dependabot[bot]
accc980498 Bump golang.org/x/crypto from 0.12.0 to 0.13.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.12.0 to 0.13.0.
- [Commits](https://github.com/golang/crypto/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 10:24:34 +00:00
Bernhard Fröhlich
78f50cf36c Merge pull request #129 from decke/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-05 21:18:00 +02:00
dependabot[bot]
d8e7652e6a Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 10:02:53 +00:00
Bernhard Fröhlich
0236631a66 Merge pull request #128 from decke/dependabot/go_modules/github.com/google/uuid-1.3.1
Bump github.com/google/uuid from 1.3.0 to 1.3.1
2023-08-22 16:34:39 +02:00
dependabot[bot]
7942709cfb Bump github.com/google/uuid from 1.3.0 to 1.3.1
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/google/uuid/releases)
- [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/uuid/compare/v1.3.0...v1.3.1)

---
updated-dependencies:
- dependency-name: github.com/google/uuid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 10:59:04 +00:00
Bernhard Fröhlich
8403854464 Merge pull request #127 from decke/dependabot/go_modules/golang.org/x/crypto-0.12.0
Bump golang.org/x/crypto from 0.11.0 to 0.12.0
2023-08-07 12:46:05 +02:00
dependabot[bot]
2c050a398f Bump golang.org/x/crypto from 0.11.0 to 0.12.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.11.0 to 0.12.0.
- [Commits](https://github.com/golang/crypto/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-07 10:44:35 +00:00
Bernhard Froehlich
2590282fa4 Add strict_sender to smtprelay.ini 2023-07-23 05:40:24 +00:00
Bernhard Fröhlich
970f761a4f Merge pull request #126 from szonov/master
make possible #91
2023-07-23 07:38:16 +02:00
Sergey Zonov
6c1bffcff0 Merge branch 'decke:master' into master 2023-07-22 13:41:50 +07:00
Bernhard Fröhlich
b839926526 Merge pull request #125 from decke/dependabot/go_modules/github.com/peterbourgon/ff/v3-3.4.0
Bump github.com/peterbourgon/ff/v3 from 3.3.2 to 3.4.0
2023-07-21 13:10:15 +02:00
dependabot[bot]
07081fe157 Bump github.com/peterbourgon/ff/v3 from 3.3.2 to 3.4.0
Bumps [github.com/peterbourgon/ff/v3](https://github.com/peterbourgon/ff) from 3.3.2 to 3.4.0.
- [Release notes](https://github.com/peterbourgon/ff/releases)
- [Commits](https://github.com/peterbourgon/ff/compare/v3.3.2...v3.4.0)

---
updated-dependencies:
- dependency-name: github.com/peterbourgon/ff/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-21 10:26:38 +00:00
Bernhard Fröhlich
d4ba54aab0 Merge pull request #124 from decke/dependabot/go_modules/golang.org/x/crypto-0.11.0
Bump golang.org/x/crypto from 0.10.0 to 0.11.0
2023-07-06 16:12:23 +02:00
dependabot[bot]
e551e6f3f8 Bump golang.org/x/crypto from 0.10.0 to 0.11.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/crypto/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-06 10:07:22 +00:00
Bernhard Froehlich
6857874c88 Fix Release workflow 2023-06-16 06:54:15 +00:00
Bernhard Froehlich
9051ffddf7 Fix Go CI action 2023-06-16 06:39:24 +00:00
Bernhard Froehlich
7e318cbcbc Bump minimum Go version to 1.20 2023-06-16 06:31:10 +00:00
Bernhard Froehlich
5d625efa45 Bump Go version for CI and release builds to 1.20 2023-06-16 06:25:09 +00:00
Bernhard Fröhlich
df0580c8e6 Merge pull request #119 from decke/dependabot/go_modules/golang.org/x/crypto-0.10.0
Bump golang.org/x/crypto from 0.9.0 to 0.10.0
2023-06-14 16:09:30 +02:00
dependabot[bot]
3697382181 Bump golang.org/x/crypto from 0.9.0 to 0.10.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/crypto/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-14 10:57:05 +00:00
Bernhard Fröhlich
76ecb52831 Merge pull request #116 from decke/dependabot/go_modules/github.com/stretchr/testify-1.8.4
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4
2023-06-12 16:01:06 +02:00
dependabot[bot]
c7651c36a3 Bump github.com/stretchr/testify from 1.8.3 to 1.8.4
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 11:08:39 +00:00
Bernhard Fröhlich
b4cef48825 Merge pull request #118 from decke/dependabot/go_modules/github.com/peterbourgon/ff/v3-3.3.2
Bump github.com/peterbourgon/ff/v3 from 3.3.1 to 3.3.2
2023-06-12 13:05:10 +02:00
dependabot[bot]
620355677d Bump github.com/peterbourgon/ff/v3 from 3.3.1 to 3.3.2
Bumps [github.com/peterbourgon/ff/v3](https://github.com/peterbourgon/ff) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/peterbourgon/ff/releases)
- [Commits](https://github.com/peterbourgon/ff/compare/v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: github.com/peterbourgon/ff/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 10:57:36 +00:00
Bernhard Fröhlich
ab24fb4427 Merge pull request #117 from decke/dependabot/go_modules/github.com/sirupsen/logrus-1.9.3
Bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3
2023-06-07 08:36:40 +02:00
dependabot[bot]
71fcfb8f0d Bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.2 to 1.9.3.
- [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.9.2...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 10:57:29 +00:00
Bernhard Fröhlich
68cc6954d0 Merge pull request #115 from decke/dependabot/go_modules/github.com/stretchr/testify-1.8.3
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
2023-05-20 17:38:03 +02:00
dependabot[bot]
b0001c4842 Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-19 10:57:09 +00:00
Bernhard Fröhlich
330ecc9603 Merge pull request #114 from decke/dependabot/go_modules/github.com/sirupsen/logrus-1.9.2
Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2
2023-05-18 13:13:24 +02:00
dependabot[bot]
eb670615d2 Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.0 to 1.9.2.
- [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.9.0...v1.9.2)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-18 10:57:12 +00:00
Bernhard Fröhlich
ab5d3e3aa7 Merge pull request #112 from decke/dependabot/go_modules/golang.org/x/crypto-0.9.0
Bump golang.org/x/crypto from 0.8.0 to 0.9.0
2023-05-09 13:09:49 +02:00
Bernhard Fröhlich
7b962e06e5 Merge pull request #111 from decke/dependabot/go_modules/github.com/peterbourgon/ff/v3-3.3.1
Bump github.com/peterbourgon/ff/v3 from 3.3.0 to 3.3.1
2023-05-09 13:09:27 +02:00
dependabot[bot]
3e49c58b95 Bump golang.org/x/crypto from 0.8.0 to 0.9.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/golang/crypto/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-09 10:57:09 +00:00
dependabot[bot]
f7df20258e Bump github.com/peterbourgon/ff/v3 from 3.3.0 to 3.3.1
Bumps [github.com/peterbourgon/ff/v3](https://github.com/peterbourgon/ff) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/peterbourgon/ff/releases)
- [Commits](https://github.com/peterbourgon/ff/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: github.com/peterbourgon/ff/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-09 10:57:05 +00:00
Bernhard Fröhlich
b2544f8da8 Merge pull request #110 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.38
Bump wangyoucao577/go-release-action from 1.37 to 1.38
2023-05-01 18:47:00 +02:00
dependabot[bot]
a2e2ab7592 Bump wangyoucao577/go-release-action from 1.37 to 1.38
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.37 to 1.38.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.37...v1.38)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 10:57:42 +00:00
Bernhard Fröhlich
755b8b2d8e Merge pull request #109 from decke/dependabot/go_modules/golang.org/x/crypto-0.8.0
Bump golang.org/x/crypto from 0.7.0 to 0.8.0
2023-04-07 13:29:52 +02:00
dependabot[bot]
a632f62b45 Bump golang.org/x/crypto from 0.7.0 to 0.8.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 10:57:15 +00:00
Bernhard Fröhlich
10100b140d Merge pull request #108 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.37
Bump wangyoucao577/go-release-action from 1.36 to 1.37
2023-03-21 12:09:18 +01:00
dependabot[bot]
0f95efa66f Bump wangyoucao577/go-release-action from 1.36 to 1.37
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.36 to 1.37.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.36...v1.37)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-21 10:57:22 +00:00
Bernhard Fröhlich
34d61707ab Merge pull request #107 from decke/dependabot/github_actions/actions/setup-go-4
Bump actions/setup-go from 3 to 4
2023-03-16 16:20:55 +01:00
dependabot[bot]
e032832820 Bump actions/setup-go from 3 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 10:19:08 +00:00
Bernhard Froehlich
2affd381ba Update go dependencies 2023-03-06 15:34:22 +00:00
Bernhard Fröhlich
d86165d5e4 Merge pull request #106 from decke/dependabot/go_modules/golang.org/x/crypto-0.7.0
Bump golang.org/x/crypto from 0.6.0 to 0.7.0
2023-03-06 16:31:38 +01:00
dependabot[bot]
e611751852 Bump golang.org/x/crypto from 0.6.0 to 0.7.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 10:58:26 +00:00
Bernhard Fröhlich
c7710d4437 Merge pull request #105 from decke/dependabot/go_modules/github.com/stretchr/testify-1.8.2
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2
2023-02-27 19:14:19 +01:00
dependabot[bot]
204d2f20e9 Bump github.com/stretchr/testify from 1.8.1 to 1.8.2
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.1...v1.8.2)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 10:58:10 +00:00
Bernhard Fröhlich
73349c6f4d Merge pull request #104 from decke/dependabot/go_modules/golang.org/x/crypto-0.6.0
Bump golang.org/x/crypto from 0.0.0-20220411220226-7b82a4e95df4 to 0.6.0
2023-02-24 12:47:21 +01:00
dependabot[bot]
0f1caae1ff Bump golang.org/x/crypto from 0.0.0-20220411220226-7b82a4e95df4 to 0.6.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20220411220226-7b82a4e95df4 to 0.6.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/commits/v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-24 10:57:29 +00:00
Bernhard Fröhlich
da368f5277 Merge pull request #103 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.36
Bump wangyoucao577/go-release-action from 1.35 to 1.36
2023-02-20 15:01:59 +01:00
dependabot[bot]
1f71df1e03 Bump wangyoucao577/go-release-action from 1.35 to 1.36
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.35 to 1.36.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.35...v1.36)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 10:57:28 +00:00
Bernhard Froehlich
cc064e497e command: Add some environment variables when calling external cmd 2023-01-20 09:31:09 +00:00
Bernhard Fröhlich
b4eac9a7d2 Merge pull request #100 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.35
Bump wangyoucao577/go-release-action from 1.34 to 1.35
2023-01-16 11:32:38 +01:00
dependabot[bot]
6782c7896e Bump wangyoucao577/go-release-action from 1.34 to 1.35
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.34 to 1.35.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.34...v1.35)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 10:02:50 +00:00
Bernhard Fröhlich
b652918f30 Merge pull request #99 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.34
Bump wangyoucao577/go-release-action from 1.33 to 1.34
2022-12-24 08:48:53 +01:00
dependabot[bot]
bf75b0474e Bump wangyoucao577/go-release-action from 1.33 to 1.34
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.33 to 1.34.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.33...v1.34)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 10:01:36 +00:00
Bernhard Fröhlich
e8dc491e0f Merge pull request #94 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.33
Bump wangyoucao577/go-release-action from 1.32 to 1.33
2022-11-23 16:54:54 +01:00
dependabot[bot]
18f3d9e379 Bump wangyoucao577/go-release-action from 1.32 to 1.33
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.32 to 1.33.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.32...v1.33)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-14 10:03:18 +00:00
Bernhard Fröhlich
088fa4cfd8 Merge pull request #93 from decke/dependabot/go_modules/github.com/stretchr/testify-1.8.1
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1
2022-11-02 22:18:24 +01:00
dependabot[bot]
56d427e8a7 Bump github.com/stretchr/testify from 1.8.0 to 1.8.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 10:09:07 +00:00
Sergey Zonov
5b5f738410 make possible #91.
- add strict_sender bool configuration value
- if strict_sender set as true use for outgoing mail only SMTPs with sender matches to from address
2022-10-15 17:32:52 +07:00
Bernhard Fröhlich
42d111695d Merge pull request #87 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.32
Bump wangyoucao577/go-release-action from 1.31 to 1.32
2022-09-27 07:56:57 +02:00
dependabot[bot]
36b9b92a9f Bump wangyoucao577/go-release-action from 1.31 to 1.32
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.31 to 1.32.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.31...v1.32)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-26 10:19:55 +00:00
Bernhard Fröhlich
41a97fe44f Merge pull request #86 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.31
Bump wangyoucao577/go-release-action from 1.30 to 1.31
2022-09-14 13:25:06 +02:00
dependabot[bot]
02044f647b Bump wangyoucao577/go-release-action from 1.30 to 1.31
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.30 to 1.31.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.30...v1.31)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-14 10:10:29 +00:00
Bernhard Froehlich
813bd9ebe7 Support .env files if it exists 2022-08-15 13:35:12 +00:00
Bernhard Froehlich
ee8a5dd989 Fix code formatting 2022-08-15 13:34:22 +00:00
Bernhard Fröhlich
6602836166 Merge pull request #84 from decke/dependabot/go_modules/github.com/peterbourgon/ff/v3-3.3.0
Bump github.com/peterbourgon/ff/v3 from 3.1.2 to 3.3.0
2022-08-15 14:55:42 +02:00
dependabot[bot]
cdc0fe931b Bump github.com/peterbourgon/ff/v3 from 3.1.2 to 3.3.0
Bumps [github.com/peterbourgon/ff/v3](https://github.com/peterbourgon/ff) from 3.1.2 to 3.3.0.
- [Release notes](https://github.com/peterbourgon/ff/releases)
- [Commits](https://github.com/peterbourgon/ff/compare/v3.1.2...v3.3.0)

---
updated-dependencies:
- dependency-name: github.com/peterbourgon/ff/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 10:18:20 +00:00
Bernhard Froehlich
e5f27e02e5 config: Comments in ini file traditionally start with ';' (#79) 2022-08-02 10:48:35 +00:00
Bernhard Froehlich
dffe0bb5bb config: Show error output from parser if it fails (#79) 2022-08-02 10:46:25 +00:00
Bernhard Fröhlich
20ad1e84f9 Merge pull request #83 from decke/dependabot/go_modules/github.com/sirupsen/logrus-1.9.0
Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0
2022-07-19 15:27:16 +02:00
dependabot[bot]
db1238bf2d Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.1 to 1.9.0.
- [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.8.1...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-19 10:08:31 +00:00
Bernhard Fröhlich
d9167eece5 Merge pull request #82 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.30
Bump wangyoucao577/go-release-action from 1.29 to 1.30
2022-07-19 08:34:18 +02:00
dependabot[bot]
e98a1c6f25 Bump wangyoucao577/go-release-action from 1.29 to 1.30
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.29 to 1.30.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.29...v1.30)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 10:09:25 +00:00
Bernhard Fröhlich
f0aefc194d Merge pull request #80 from decke/dependabot/go_modules/github.com/stretchr/testify-1.8.0
Bump github.com/stretchr/testify from 1.7.5 to 1.8.0
2022-07-01 18:23:53 +02:00
dependabot[bot]
bfd156e5f3 Bump github.com/stretchr/testify from 1.7.5 to 1.8.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.5 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.5...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-30 10:10:34 +00:00
Bernhard Fröhlich
682feef610 Merge pull request #78 from decke/dependabot/go_modules/github.com/stretchr/testify-1.7.5
Bump github.com/stretchr/testify from 1.7.4 to 1.7.5
2022-06-25 06:49:07 +02:00
dependabot[bot]
eea3c4edaa Bump github.com/stretchr/testify from 1.7.4 to 1.7.5
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.4 to 1.7.5.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.4...v1.7.5)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-24 10:09:19 +00:00
Bernhard Fröhlich
cf25c2d0a0 Merge pull request #77 from decke/dependabot/go_modules/github.com/stretchr/testify-1.7.4
Bump github.com/stretchr/testify from 1.7.2 to 1.7.4
2022-06-21 18:22:14 +02:00
dependabot[bot]
774651b0f6 Bump github.com/stretchr/testify from 1.7.2 to 1.7.4
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.2 to 1.7.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.2...v1.7.4)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 10:08:03 +00:00
Bernhard Fröhlich
5cd3729b1f Merge pull request #75 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.29
Bump wangyoucao577/go-release-action from 1.28 to 1.29
2022-06-14 12:44:21 +02:00
dependabot[bot]
5b38a30349 Bump wangyoucao577/go-release-action from 1.28 to 1.29
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.28 to 1.29.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.28...v1.29)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 10:17:51 +00:00
Bernhard Fröhlich
d7585bec9b Merge pull request #73 from decke/dependabot/go_modules/github.com/stretchr/testify-1.7.2
Bump github.com/stretchr/testify from 1.7.1 to 1.7.2
2022-06-06 14:36:56 +02:00
dependabot[bot]
c8f62e42c8 Bump github.com/stretchr/testify from 1.7.1 to 1.7.2
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.1...v1.7.2)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 10:08:25 +00:00
Bernhard Fröhlich
00df491340 Merge pull request #72 from decke/ff-config
Support environment variables for config
2022-05-25 17:08:05 +02:00
Bernhard Froehlich
1bf205e7d8 Compress if statement 2022-05-23 15:29:03 +00:00
Bernhard Froehlich
c83544bd90 Add note how to use environment variables for configuration 2022-05-23 15:18:22 +00:00
Bernhard Froehlich
e3ba45ede2 Fix output for "-version" to not contain unneccessary noise 2022-05-23 15:07:21 +00:00
Bernhard Froehlich
f69d1f0114 Improve examples in ini file to not quote strings at all 2022-05-23 14:54:05 +00:00
Bernhard Froehlich
e9a2b9ad5a Fix IniParser() to support various common formats 2022-05-23 14:51:54 +00:00
Bernhard Froehlich
7e3dbd515d Add config parameter for ini file 2022-05-23 14:29:06 +00:00
Bernhard Froehlich
8cc31a918b Properly handle config parsing errors because logging is not setup yet 2022-05-23 14:17:39 +00:00
Bernhard Froehlich
26477177fe Replace iniflags config file parser with peterbourgon/ff/v3
This allows us to support configuration via environment variables
which is useful in container environments.
2022-05-20 08:48:39 +00:00
Bernhard Froehlich
44560c9a0c ci: Add testsuite to ci builds 2022-05-01 17:18:17 +00:00
Bernhard Froehlich
c21c13cc7a Remove i386 from release builds 2022-05-01 11:23:56 +00:00
Bernhard Fröhlich
1617155f1e Remove service names from readme 2022-04-30 08:10:21 +02:00
Bernhard Fröhlich
81ea0c7944 Merge pull request #69 from decke/dependabot/github_actions/github/codeql-action-2
Bump github/codeql-action from 1 to 2
2022-04-26 14:33:39 +02:00
Bernhard Fröhlich
d9a09a20da Merge pull request #70 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.28
Bump wangyoucao577/go-release-action from 1.26 to 1.28
2022-04-26 14:33:04 +02:00
dependabot[bot]
d5d4e7a821 Bump wangyoucao577/go-release-action from 1.26 to 1.28
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.26 to 1.28.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.26...v1.28)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 10:17:49 +00:00
dependabot[bot]
77ab4485b2 Bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 10:17:46 +00:00
Bernhard Froehlich
ce97293e33 Update Go crypto and sys dependencies 2022-04-25 15:06:32 +00:00
Bernhard Froehlich
5cd81cd7e4 smtp: gofmt main repo
Merge from net/smtp/smtp.go

Obtained from:	19309779ac5e2f5a2fd3cbb34421dafb2855ac21
2022-04-25 15:00:57 +00:00
Bernhard Froehlich
62bb2becbc smtp: gofmt -w -r 'interface{}->any' src
Merge from net/smtp/smtp.go

Obtained from:	2580d0e08d5e9f979b943758d3c49877fb2324cb
2022-04-25 14:58:09 +00:00
Bernhard Froehlich
a2826e949e Regenerate go.mod for go 1.18 2022-04-25 14:42:23 +00:00
Bernhard Froehlich
64872c0bea Bump Go version to 1.18 for release and CI jobs 2022-04-25 14:37:23 +00:00
Bernhard Froehlich
cdc4e572db smtp: use bytes.Cut, strings.Cut
Merge from net/smtp/smtp.go

Obtained from:		4d8db00641cc9ff4f44de7df9b8c4f4a4f9416ee
2022-04-25 14:30:43 +00:00
Bernhard Froehlich
5e78bbe643 Improve remotes documentation in config 2022-04-25 14:19:31 +00:00
Javi
b134e426d7 Propagate the error to the client if the external command fails (#40)
This change makes the external command code return a generic 554 error to the SMTP client if the external command fails, so it knows sending failed and can retry.
2022-04-25 15:52:12 +02:00
Bernhard Fröhlich
9c230182da Merge pull request #68 from decke/dependabot/go_modules/github.com/stretchr/testify-1.7.1
Bump github.com/stretchr/testify from 1.7.0 to 1.7.1
2022-04-25 15:42:34 +02:00
dependabot[bot]
39b8e01226 Bump github.com/stretchr/testify from 1.7.0 to 1.7.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 10:09:05 +00:00
Bernhard Fröhlich
bf8c222ac1 Merge pull request #63 from markgardner/master
Allow config to have multiple remotes.
2022-04-24 19:45:34 +02:00
Mark Gardner
875264837e add test coverage for scheme validation 2022-04-21 11:39:41 -05:00
Mark Gardner
32d0206af0 throw an error if the remote is configured for starttls and the server does not have the extension 2022-04-21 11:29:15 -05:00
Mark Gardner
b7f3701502 Add missing default port for starttls and validate scheme to ensure support 2022-04-21 11:28:48 -05:00
Mark Gardner
cf927508dd Improve sample config to be more accurate 2022-04-21 11:28:16 -05:00
Mark Gardner
4221919689 Allow config to have multiple remotes.
This will enable development teams to test emails from
a system like mailcatcher while also having the email
delivered to the indented mailbox.
2022-04-21 10:52:03 -05:00
Bernhard Fröhlich
4f1148d77b Merge pull request #67 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.26
Bump wangyoucao577/go-release-action from 1.25 to 1.26
2022-04-16 19:23:31 +02:00
dependabot[bot]
32c43efd0c Bump wangyoucao577/go-release-action from 1.25 to 1.26
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.25 to 1.26.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.25...v1.26)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-15 10:05:45 +00:00
Bernhard Fröhlich
362a64dd8a Merge pull request #65 from decke/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2.4.0 to 3
2022-03-02 21:47:04 +01:00
dependabot[bot]
bf58b2b4c8 Bump actions/checkout from 2.4.0 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 10:07:48 +00:00
Bernhard Fröhlich
ed13816dcd Merge pull request #64 from decke/dependabot/github_actions/actions/setup-go-3
Bump actions/setup-go from 2.2.0 to 3
2022-03-01 14:36:05 +01:00
dependabot[bot]
dd7905e60e Bump actions/setup-go from 2.2.0 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.2.0 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2.2.0...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 10:07:35 +00:00
Bernhard Fröhlich
5076988ddf Merge pull request #59 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.25
Bump wangyoucao577/go-release-action from 1.24 to 1.25
2022-02-23 12:11:56 +01:00
dependabot[bot]
dafbc327aa Bump wangyoucao577/go-release-action from 1.24 to 1.25
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.24 to 1.25.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.24...v1.25)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-23 10:06:40 +00:00
Bernhard Fröhlich
48926964bf Merge pull request #58 from decke/dependabot/github_actions/actions/setup-go-2.2.0
Bump actions/setup-go from 2.1.5 to 2.2.0
2022-02-10 13:49:46 +01:00
dependabot[bot]
5757db3a37 Bump actions/setup-go from 2.1.5 to 2.2.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.5 to 2.2.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2.1.5...v2.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-10 10:39:30 +00:00
Bernhard Fröhlich
a527a147be Merge pull request #56 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.24
Bump wangyoucao577/go-release-action from 1.23 to 1.24
2022-01-31 13:46:04 +01:00
dependabot[bot]
8c0a6aab20 Bump wangyoucao577/go-release-action from 1.23 to 1.24
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.23 to 1.24.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.23...v1.24)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:07:26 +00:00
Bernhard Fröhlich
5be2f3aa4b Merge pull request #55 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.23
Bump wangyoucao577/go-release-action from 1.22 to 1.23
2022-01-26 13:19:08 +01:00
dependabot[bot]
2b046297ea Bump wangyoucao577/go-release-action from 1.22 to 1.23
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.22 to 1.23.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.22...v1.23)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-26 10:06:33 +00:00
Bernhard Froehlich
f0d39401d4 Allow go build workflow for pull requests 2022-01-11 12:55:39 +00:00
Bernhard Fröhlich
b5fcf8e0bb Merge pull request #52 from Coronon/master
add: basic smtpd configuration options
2022-01-11 13:55:02 +01:00
Rubin Raithel
016ef762fb add: basic smtpd configuration options 2022-01-10 20:39:55 +01:00
Bernhard Fröhlich
6afc87968c Merge pull request #51 from decke/dependabot/github_actions/actions/setup-go-2.1.5
Bump actions/setup-go from 2.1.4 to 2.1.5
2021-12-22 11:43:16 +01:00
dependabot[bot]
b32b5690bf Bump actions/setup-go from 2.1.4 to 2.1.5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.4 to 2.1.5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2.1.4...v2.1.5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-22 10:08:04 +00:00
Bernhard Fröhlich
38aa05c9f4 Merge pull request #49 from NoUseFreak/add-skip-verify
Allow ignoring an insecure tls connection
2021-12-15 21:31:54 +01:00
Dries De Peuter
03d109ff8b feat: Add support for ignoring certs 2021-12-09 21:38:38 +01:00
Bernhard Fröhlich
6c691f3cea Merge pull request #48 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.22
Bump wangyoucao577/go-release-action from 1.21 to 1.22
2021-11-24 13:07:20 +01:00
dependabot[bot]
c6b5e244eb Bump wangyoucao577/go-release-action from 1.21 to 1.22
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.21 to 1.22.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.21...v1.22)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-24 10:06:54 +00:00
Bernhard Froehlich
0ee982ea31 Bump used Go versions to 1.17 2021-11-22 15:38:17 +00:00
Bernhard Fröhlich
287395ad91 Merge pull request #47 from alex1989hu/bump/chrj-smtpd-v031
Bump chrj/smtpd from 0.3.0 to 0.3.1
2021-11-22 11:39:33 +01:00
Alex Szakaly
3aecd3c6d6 Bump chrj/smtpd from 0.3.0 to 0.3.1
Fixes #44

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
2021-11-22 07:53:43 +01:00
Bernhard Fröhlich
f8960053e8 Merge pull request #46 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.21
Bump wangyoucao577/go-release-action from 1.20 to 1.21
2021-11-17 11:59:35 +01:00
dependabot[bot]
db5512d47b Bump wangyoucao577/go-release-action from 1.20 to 1.21
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.20 to 1.21.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.20...v1.21)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-16 10:07:49 +00:00
Bernhard Fröhlich
fd063ad879 Merge pull request #45 from decke/dependabot/github_actions/actions/checkout-2.4.0
Bump actions/checkout from 2.3.5 to 2.4.0
2021-11-03 11:49:27 +01:00
dependabot[bot]
85bdd060e3 Bump actions/checkout from 2.3.5 to 2.4.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.5 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.5...v2.4.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-03 10:05:55 +00:00
Bernhard Fröhlich
5be6165865 Merge pull request #43 from decke/dependabot/github_actions/actions/checkout-2.3.5
Bump actions/checkout from 2.3.4 to 2.3.5
2021-10-18 16:00:48 +02:00
dependabot[bot]
b64a34becf Bump actions/checkout from 2.3.4 to 2.3.5
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.3.5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 10:08:18 +00:00
Bernhard Fröhlich
a2ea5ab49e Merge pull request #42 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.20
Bump wangyoucao577/go-release-action from 1.19 to 1.20
2021-08-30 14:46:38 +02:00
dependabot[bot]
94957d944f Bump wangyoucao577/go-release-action from 1.19 to 1.20
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.19 to 1.20.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.19...v1.20)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 10:06:39 +00:00
Bernhard Fröhlich
a5db5e1ff5 Merge pull request #41 from decke/dependabot/github_actions/actions/setup-go-2.1.4
Bump actions/setup-go from 2.1.3 to 2.1.4
2021-08-26 13:14:35 +02:00
dependabot[bot]
94776b27d9 Bump actions/setup-go from 2.1.3 to 2.1.4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.3 to 2.1.4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2.1.3...v2.1.4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-26 10:06:19 +00:00
Bernhard Fröhlich
81bc7addc7 Merge pull request #39 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.19
Bump wangyoucao577/go-release-action from 1.18 to 1.19
2021-07-28 22:15:07 +02:00
dependabot[bot]
e9bfe53f18 Bump wangyoucao577/go-release-action from 1.18 to 1.19
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.18 to 1.19.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.18...v1.19)

---
updated-dependencies:
- dependency-name: wangyoucao577/go-release-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-21 10:06:34 +00:00
Bernhard Fröhlich
32032c297c Merge pull request #38 from decke/dependabot/go_modules/github.com/google/uuid-1.3.0
Bump github.com/google/uuid from 1.2.0 to 1.3.0
2021-07-13 13:10:23 +02:00
dependabot[bot]
53e52de279 Bump github.com/google/uuid from 1.2.0 to 1.3.0
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/google/uuid/releases)
- [Commits](https://github.com/google/uuid/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/google/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 10:06:56 +00:00
Bernhard Fröhlich
02810c0a50 Merge pull request #36 from decke/dependabot/github_actions/wangyoucao577/go-release-action-1.18
Bump wangyoucao577/go-release-action from 1.17 to 1.18
2021-05-26 14:36:30 +02:00
dependabot[bot]
6b21f52037 Bump wangyoucao577/go-release-action from 1.17 to 1.18
Bumps [wangyoucao577/go-release-action](https://github.com/wangyoucao577/go-release-action) from 1.17 to 1.18.
- [Release notes](https://github.com/wangyoucao577/go-release-action/releases)
- [Commits](https://github.com/wangyoucao577/go-release-action/compare/v1.17...v1.18)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-26 05:59:28 +00:00
Bernhard Fröhlich
544bd081ff Merge pull request #34 from decke/dependabot/github_actions/actions/checkout-2.3.4
Bump actions/checkout from 2 to 2.3.4
2021-05-12 08:41:49 +02:00
dependabot[bot]
6a28f939de Bump actions/checkout from 2 to 2.3.4
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 2.3.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v2.3.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-12 05:54:25 +00:00
Bernhard Fröhlich
f0392bdf09 Merge pull request #33 from benubois/command
Add external command support
2021-05-10 10:18:56 +02:00
Ben Ubois
3f627d3281 Move AddReceivedLine before further processing. 2021-05-08 11:56:28 -07:00
Ben Ubois
d8860fc917 Added external command support. 2021-05-07 14:08:10 -07:00
Bernhard Fröhlich
ebb53ea1b6 Merge pull request #30 from decke/dependabot/github_actions/wangyoucao577/go-release-action-v1.17
Bump wangyoucao577/go-release-action from v1.16 to v1.17
2021-04-13 20:13:18 +02:00
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
Jonathon Reinhart
4fd6bb1004 Refactor common code in listener setup 2021-02-14 23:30:31 -05:00
Jonathon Reinhart
fd3f513b18 Don't run ListenAndServe in a goroutine
Any errors returned in ListenAndServe() (e.g. port already in use) will be
swallowed and not evident to the user.
2021-02-14 23:24:25 -05:00
Jonathon Reinhart
b202a2209e Refactor out getTLSConfig() 2021-02-14 23:21:42 -05:00
Jonathon Reinhart
0e8986ca79 Expand allowedUsers email field to support comma-separated and domains (#9)
* Expand allowedUsers email field to support comma-separated and domains

Closes #8

* Refactor AuthFetch() to return AuthUser struct

Also, this breaks out a parseLine() function which can be easily tested.

* Ignore empty addrs after splitting commas

This ignores a trailing comma

* Add tests for auth parseLine()

* Update documentation in smtprelay.ini

* Fix bug where addrAllowed() was incorrectly case-sensitive

* Update allowedUsers allowed domain format to require leading @

This disambiguates a local user ('john.smith') from a domain ('example.com')
2021-02-14 22:16:18 +01:00
Bernhard Fröhlich
5c2e28ac36 Merge pull request #7 from JonathonReinhart/allow-empty-auth-email
Allow email field to be empty in allowedUsers file to accept any sending address
2021-02-09 14:18:06 +01:00
Jonathon Reinhart
f33105f83c Allow email field to be empty in allowedUsers file
In this case, it is not checked.
2021-02-09 00:00:36 -05:00
Bernhard Fröhlich
9040a456cf Create codeql-analysis.yml 2020-09-28 21:26:31 +02:00
Bernhard Fröhlich
d5c5e25d03 Merge pull request #4 from simon04/addresses
Fix typo "addresses"
2020-09-04 15:14:35 +02:00
Simon Legner
999cfea307 Fix typo "addresses" 2020-09-03 14:06:20 +02:00
Bernhard Froehlich
f166c13350 Bump Version string 2020-06-14 18:51:16 +00:00
Bernhard Froehlich
ed1c3a9888 Merge branch 'master' of github.com:decke/smtprelay 2020-06-07 17:19:52 +00:00
Bernhard Froehlich
6f3bd16988 The check if authentication was properly done is redundant now as of smtpd v0.2.0
See:	32be721d71
2020-06-07 17:17:28 +00:00
Bernhard Froehlich
4e0bf0908d Update dependencies 2020-06-07 17:15:57 +00:00
Bernhard Fröhlich
6662fb7155 Merge pull request #3 from nwillems/add-hasher-tool
Add helper to do hashing
2020-06-06 07:58:51 +02:00
Nicolai Willems
076fd65dea Use default cost for bcrypt 2020-06-05 22:48:33 +02:00
Bernhard Froehlich
880c3c365c Update dependencies and chrj/smtpd to latest master which contains a fix for us 2020-06-04 08:41:19 +00:00
Nicolai Willems
36673ae3f0 Add helper to do hashing 2020-05-24 21:07:29 +02:00
Bernhard Froehlich
b42ad6ddc9 Add release script as requested in #2 2020-05-20 18:33:40 +00:00
Bernhard Froehlich
999ccab778 Fix spelling 2020-05-16 10:44:04 +00:00
Bernhard Froehlich
53c2c27647 Support LOGIN authentication on outgoing SMTP server
PR:		#1
Obtained from:	https://gist.github.com/andelf/5118732
2020-05-15 21:08:17 +00:00
Bernhard Froehlich
2afbe67407 Add Go Report Card badge 2020-05-11 13:56:24 +00:00
Bernhard Froehlich
00b96161b3 Remove duplication of TLS cipher suites for tls:// and startssl:// 2020-05-11 13:52:25 +00:00
Bernhard Froehlich
e10cbcdbb0 Update crypto dependency 2020-05-11 13:33:33 +00:00
Bernhard Froehlich
0e643f7230 Update CI to go 1.14 2020-03-02 10:46:59 +00:00
Bernhard Froehlich
324585c63c Update list of cipher suites and add ciphers for TLS 1.3 2020-03-02 10:45:02 +00:00
Bernhard Froehlich
92cb02e46b Update crypto dependency 2020-03-02 10:44:35 +00:00
Bernhard Froehlich
62fcc11f61 Update crypto dependency 2019-12-16 19:20:48 +00:00
Bernhard Froehlich
bfe8d39bb3 Merge branch 'master' of github.com:decke/smtprelay 2019-10-30 20:58:57 +00:00
Bernhard Froehlich
cbb6f523c5 Update crypto dependency 2019-10-30 20:57:38 +00:00
Bernhard Fröhlich
eb4a6b9eb6 Remove Travis CI 2019-10-20 13:24:42 +02:00
Bernhard Fröhlich
45db4ef786 Play with GitHub Actions 2019-10-20 13:21:39 +02:00
Bernhard Froehlich
946effcbcf Use Go 1.13 for CI 2019-10-14 09:55:05 +00:00
Bernhard Froehlich
118d1b88c2 Add Travis CI support and remove drone.yml 2019-10-14 09:51:09 +00:00
Bernhard Froehlich
5fd6aad9b1 Update project URL from code.bluelife.at to GitHub 2019-10-14 09:29:49 +00:00
Bernhard Froehlich
21b597f351 Bump version to 1.3.0 2019-09-07 11:31:28 +00:00
Bernhard Froehlich
5f82b4736c Update dependencies 2019-09-07 11:31:05 +00:00
Bernhard Fröhlich
de430286b3 Merge branch 'remote-sender' of beppler/smtprelay into master 2019-09-07 06:20:28 +00:00
Carlos Alberto Costa Beppler
769193ea4d Adjust the description of remote_sender parameter.
It represents the e-mail address used while sending message to the outgoing SMTP server.
2019-09-06 21:00:35 -03:00
Carlos Alberto Costa Beppler
0b65e904d8 Allows specify the sender used on SMTP conversation with outgoing server. 2019-09-06 17:07:37 -03:00
Bernhard Froehlich
2c9645ac68 Add drone config 2019-05-09 08:17:45 +00:00
Bernhard Froehlich
770e819e2b Improve error checking 2019-02-21 08:29:49 +00:00
Bernhard Froehlich
d11f8d81ea Fix formatting 2019-02-21 08:27:12 +00:00
Bernhard Froehlich
6270d75571 Improve TLS Config to prefer server ciphers, remove 3DES ciphers and require TLS 1.1 or higher 2019-01-08 15:09:29 +00:00
20 changed files with 1462 additions and 204 deletions

11
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

66
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,66 @@
name: "CodeQL"
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 15 * * 5'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['go']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

18
.github/workflows/go.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Go
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Build
run: go build -v .
- name: Test
run: go test -v .

34
.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Release Go Binaries
on:
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
goos: [freebsd, linux, windows]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- name: Set APP_VERSION env
run: echo APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV}
- name: Set BUILD_TIME env
run: echo BUILD_TIME=$(date) >> ${GITHUB_ENV}
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "1.22"
extra_files: LICENSE README.md smtprelay.ini
ldflags: -s -w -X "main.appVersion=${{ env.APP_VERSION }}" -X "main.buildTime=${{ env.BUILD_TIME }}"

View File

@@ -1,5 +1,7 @@
# smtprelay
[![Go Report Card](https://goreportcard.com/badge/github.com/decke/smtprelay)](https://goreportcard.com/report/github.com/decke/smtprelay)
Simple Golang based SMTP relay/proxy server that accepts mail via SMTP
and forwards it directly to another SMTP server.
@@ -14,16 +16,17 @@ configure.
My use case is simple. I need to send automatically generated mails from
cron via msmtp/sSMTP/dma, mails from various services and network printers
to GMail without giving away my GMail credentials to each device which
produces mail.
via a remote SMTP server without giving away my mail credentials to each
device which produces mail.
## Main features
* Simple configuration with ini file .env file or environment variables
* Supports SMTPS/TLS (465), STARTTLS (587) and unencrypted SMTP (25)
* Checks for sender, receiver, client IP
* Authentication support with file (LOGIN, PLAIN)
* Enforce encryption for authentication
* Forwards all mail to a smarthost (GMail, MailGun or any other SMTP server)
* Forwards all mail to a smarthost (any SMTP server)
* Small codebase
* IPv6 support

58
auth.go
View File

@@ -13,6 +13,12 @@ var (
filename string
)
type AuthUser struct {
username string
passwordHash string
allowedAddresses []string
}
func AuthLoadFile(file string) error {
f, err := os.Open(file)
if err != nil {
@@ -28,41 +34,67 @@ func AuthReady() bool {
return (filename != "")
}
func AuthFetch(username string) (string, string, error) {
if ! AuthReady() {
return "", "", errors.New("Authentication file not specified. Call LoadFile() first")
// Split a string and ignore empty results
// https://stackoverflow.com/a/46798310/119527
func splitstr(s string, sep rune) []string {
return strings.FieldsFunc(s, func(c rune) bool { return c == sep })
}
func parseLine(line string) *AuthUser {
parts := strings.Fields(line)
if len(parts) < 2 || len(parts) > 3 {
return nil
}
user := AuthUser{
username: parts[0],
passwordHash: parts[1],
allowedAddresses: nil,
}
if len(parts) >= 3 {
user.allowedAddresses = splitstr(parts[2], ',')
}
return &user
}
func AuthFetch(username string) (*AuthUser, error) {
if !AuthReady() {
return nil, errors.New("Authentication file not specified. Call LoadFile() first")
}
file, err := os.Open(filename)
if err != nil {
return "", "", err
return nil, err
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
parts := strings.Fields(scanner.Text())
if len(parts) != 3 {
user := parseLine(scanner.Text())
if user == nil {
continue
}
if strings.ToLower(username) == strings.ToLower(parts[0]) {
return parts[1], parts[2], nil
if strings.ToLower(username) != strings.ToLower(user.username) {
continue
}
return user, nil
}
return "", "", errors.New("User not found")
return nil, errors.New("User not found")
}
func AuthCheckPassword(username string, secret string) error {
hash, _, err := AuthFetch(username)
user, err := AuthFetch(username)
if err != nil {
return err
}
if bcrypt.CompareHashAndPassword([]byte(hash), []byte(secret)) == nil {
if bcrypt.CompareHashAndPassword([]byte(user.passwordHash), []byte(secret)) == nil {
return nil
}
return errors.New("Password invalid")
}

89
auth_test.go Normal file
View File

@@ -0,0 +1,89 @@
package main
import (
"testing"
)
func stringsEqual(a, b []string) bool {
if len(a) != len(b) {
return false
}
for i := range a {
if a[i] != b[i] {
return false
}
}
return true
}
func TestParseLine(t *testing.T) {
var tests = []struct {
name string
expectFail bool
line string
username string
addrs []string
}{
{
name: "Empty line",
expectFail: true,
line: "",
},
{
name: "Too few fields",
expectFail: true,
line: "joe",
},
{
name: "Too many fields",
expectFail: true,
line: "joe xxx joe@example.com whatsthis",
},
{
name: "Normal case",
line: "joe xxx joe@example.com",
username: "joe",
addrs: []string{"joe@example.com"},
},
{
name: "No allowed addrs given",
line: "joe xxx",
username: "joe",
addrs: []string{},
},
{
name: "Trailing comma",
line: "joe xxx joe@example.com,",
username: "joe",
addrs: []string{"joe@example.com"},
},
{
name: "Multiple allowed addrs",
line: "joe xxx joe@example.com,@foo.example.com",
username: "joe",
addrs: []string{"joe@example.com", "@foo.example.com"},
},
}
for i, test := range tests {
t.Run(test.name, func(t *testing.T) {
user := parseLine(test.line)
if user == nil {
if !test.expectFail {
t.Errorf("parseLine() returned nil unexpectedly")
}
return
}
if user.username != test.username {
t.Errorf("Testcase %d: Incorrect username: expected %v, got %v",
i, test.username, user.username)
}
if !stringsEqual(user.allowedAddresses, test.addrs) {
t.Errorf("Testcase %d: Incorrect addresses: expected %v, got %v",
i, test.addrs, user.allowedAddresses)
}
})
}
}

6
cmd/README.md Normal file
View File

@@ -0,0 +1,6 @@
To run the hasher, do like this
```bash
$ go run hasher.go hunter2
```

22
cmd/hasher.go Normal file
View File

@@ -0,0 +1,22 @@
package main
import (
"fmt"
"os"
"golang.org/x/crypto/bcrypt"
)
func main() {
if len(os.Args) != 2 {
fmt.Fprintln(os.Stderr, "Usage: hasher PASSWORD")
os.Exit(1)
}
password := os.Args[1]
hash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
if err != nil {
fmt.Fprintln(os.Stderr, "Error generating hash: %s", err)
}
fmt.Println(string(hash))
}

287
config.go
View File

@@ -1,33 +1,276 @@
package main
import (
"bufio"
"flag"
"fmt"
"io"
"net"
"os"
"regexp"
"strings"
"time"
"github.com/vharitonsky/iniflags"
)
const (
VERSION = "1.2.0"
"github.com/peterbourgon/ff/v3"
"github.com/sirupsen/logrus"
)
var (
logFile = flag.String("logfile", "/var/log/smtprelay.log", "Path to logfile")
hostName = flag.String("hostname", "localhost.localdomain", "Server hostname")
welcomeMsg = flag.String("welcome_msg", "", "Welcome message for SMTP session")
listen = flag.String("listen", "127.0.0.1:25 [::1]:25", "Address and port to listen for incoming SMTP")
localCert = flag.String("local_cert", "", "SSL certificate for STARTTLS/TLS")
localKey = flag.String("local_key", "", "SSL private key for STARTTLS/TLS")
localForceTLS = flag.Bool("local_forcetls", false, "Force STARTTLS (needs local_cert and local_key)")
allowedNets = flag.String("allowed_nets", "127.0.0.1/8 ::1/128", "Networks allowed to send mails")
allowedSender = flag.String("allowed_sender", "", "Regular expression for valid FROM EMail adresses")
allowedRecipients = flag.String("allowed_recipients", "", "Regular expression for valid TO EMail adresses")
allowedUsers = flag.String("allowed_users", "", "Path to file with valid users/passwords")
remoteHost = flag.String("remote_host", "smtp.gmail.com:587", "Outgoing SMTP server")
remoteUser = flag.String("remote_user", "", "Username for authentication on outgoing SMTP server")
remotePass = flag.String("remote_pass", "", "Password for authentication on outgoing SMTP server")
versionInfo= flag.Bool("version", false, "Show version information")
appVersion = "unknown"
buildTime = "unknown"
)
func ConfigLoad() {
iniflags.Parse()
var (
flagset = flag.NewFlagSet("smtprelay", flag.ContinueOnError)
// config flags
logFile = flagset.String("logfile", "", "Path to logfile")
logFormat = flagset.String("log_format", "default", "Log output format")
logLevel = flagset.String("log_level", "info", "Minimum log level to output")
hostName = flagset.String("hostname", "localhost.localdomain", "Server hostname")
welcomeMsg = flagset.String("welcome_msg", "", "Welcome message for SMTP session")
listenStr = flagset.String("listen", "127.0.0.1:25 [::1]:25", "Address and port to listen for incoming SMTP")
localCert = flagset.String("local_cert", "", "SSL certificate for STARTTLS/TLS")
localKey = flagset.String("local_key", "", "SSL private key for STARTTLS/TLS")
localForceTLS = flagset.Bool("local_forcetls", false, "Force STARTTLS (needs local_cert and local_key)")
readTimeoutStr = flagset.String("read_timeout", "60s", "Socket timeout for read operations")
writeTimeoutStr = flagset.String("write_timeout", "60s", "Socket timeout for write operations")
dataTimeoutStr = flagset.String("data_timeout", "5m", "Socket timeout for DATA command")
maxConnections = flagset.Int("max_connections", 100, "Max concurrent connections, use -1 to disable")
maxMessageSize = flagset.Int("max_message_size", 10240000, "Max message size in bytes")
maxRecipients = flagset.Int("max_recipients", 100, "Max RCPT TO calls for each envelope")
allowedNetsStr = flagset.String("allowed_nets", "127.0.0.0/8 ::1/128", "Networks allowed to send mails")
allowedSenderStr = flagset.String("allowed_sender", "", "Regular expression for valid FROM EMail addresses")
allowedRecipStr = flagset.String("allowed_recipients", "", "Regular expression for valid TO EMail addresses")
allowedUsers = flagset.String("allowed_users", "", "Path to file with valid users/passwords")
command = flagset.String("command", "", "Path to pipe command")
remotesStr = flagset.String("remotes", "", "Outgoing SMTP servers")
strictSender = flagset.Bool("strict_sender", false, "Use only SMTP servers with Sender matches to From")
// additional flags
_ = flagset.String("config", "", "Path to config file (ini format)")
versionInfo = flagset.Bool("version", false, "Show version information")
// internal
listenAddrs = []protoAddr{}
readTimeout time.Duration
writeTimeout time.Duration
dataTimeout time.Duration
allowedNets = []*net.IPNet{}
allowedSender *regexp.Regexp
allowedRecipients *regexp.Regexp
remotes = []*Remote{}
)
func localAuthRequired() bool {
return *allowedUsers != ""
}
func setupAllowedNetworks() {
for _, netstr := range splitstr(*allowedNetsStr, ' ') {
baseIP, allowedNet, err := net.ParseCIDR(netstr)
if err != nil {
log.WithField("netstr", netstr).
WithError(err).
Fatal("Invalid CIDR notation in allowed_nets")
}
// Reject any network specification where any host bits are set,
// meaning the address refers to a host and not a network.
if !allowedNet.IP.Equal(baseIP) {
log.WithFields(logrus.Fields{
"given_net": netstr,
"proper_net": allowedNet,
}).Fatal("Invalid network in allowed_nets (host bits set)")
}
allowedNets = append(allowedNets, allowedNet)
}
}
func setupAllowedPatterns() {
var err error
if *allowedSenderStr != "" {
allowedSender, err = regexp.Compile(*allowedSenderStr)
if err != nil {
log.WithField("allowed_sender", *allowedSenderStr).
WithError(err).
Fatal("allowed_sender pattern invalid")
}
}
if *allowedRecipStr != "" {
allowedRecipients, err = regexp.Compile(*allowedRecipStr)
if err != nil {
log.WithField("allowed_recipients", *allowedRecipStr).
WithError(err).
Fatal("allowed_recipients pattern invalid")
}
}
}
func setupRemotes() {
logger := log.WithField("remotes", *remotesStr)
if *remotesStr != "" {
for _, remoteURL := range strings.Split(*remotesStr, " ") {
r, err := ParseRemote(remoteURL)
if err != nil {
logger.Fatal(fmt.Sprintf("error parsing url: '%s': %v", remoteURL, err))
}
remotes = append(remotes, r)
}
}
}
type protoAddr struct {
protocol string
address string
}
func splitProto(s string) protoAddr {
idx := strings.Index(s, "://")
if idx == -1 {
return protoAddr{
address: s,
}
}
return protoAddr{
protocol: s[0:idx],
address: s[idx+3:],
}
}
func setupListeners() {
for _, listenAddr := range strings.Split(*listenStr, " ") {
pa := splitProto(listenAddr)
if localAuthRequired() && pa.protocol == "" {
log.WithField("address", pa.address).
Fatal("Local authentication (via allowed_users file) " +
"not allowed with non-TLS listener")
}
listenAddrs = append(listenAddrs, pa)
}
}
func setupTimeouts() {
var err error
readTimeout, err = time.ParseDuration(*readTimeoutStr)
if err != nil {
log.WithField("read_timeout", *readTimeoutStr).
WithError(err).
Fatal("read_timeout duration string invalid")
}
if readTimeout.Seconds() < 1 {
log.WithField("read_timeout", *readTimeoutStr).
Fatal("read_timeout less than one second")
}
writeTimeout, err = time.ParseDuration(*writeTimeoutStr)
if err != nil {
log.WithField("write_timeout", *writeTimeoutStr).
WithError(err).
Fatal("write_timeout duration string invalid")
}
if writeTimeout.Seconds() < 1 {
log.WithField("write_timeout", *writeTimeoutStr).
Fatal("write_timeout less than one second")
}
dataTimeout, err = time.ParseDuration(*dataTimeoutStr)
if err != nil {
log.WithField("data_timeout", *dataTimeoutStr).
WithError(err).
Fatal("data_timeout duration string invalid")
}
if dataTimeout.Seconds() < 1 {
log.WithField("data_timeout", *dataTimeoutStr).
Fatal("data_timeout less than one second")
}
}
func ConfigLoad() {
// use .env file if it exists
if _, err := os.Stat(".env"); err == nil {
if err := ff.Parse(flagset, os.Args[1:],
ff.WithEnvVarPrefix("smtprelay"),
ff.WithConfigFile(".env"),
ff.WithConfigFileParser(ff.EnvParser),
); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
} else {
// use env variables and smtprelay.ini file
if err := ff.Parse(flagset, os.Args[1:],
ff.WithEnvVarPrefix("smtprelay"),
ff.WithConfigFileFlag("config"),
ff.WithConfigFileParser(IniParser),
); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
}
// Set up logging as soon as possible
setupLogger()
if *versionInfo {
fmt.Printf("smtprelay/%s (%s)\n", appVersion, buildTime)
os.Exit(0)
}
if *remotesStr == "" && *command == "" {
log.Warn("no remotes or command set; mail will not be forwarded!")
}
setupAllowedNetworks()
setupAllowedPatterns()
setupRemotes()
setupListeners()
setupTimeouts()
}
// IniParser is a parser for config files in classic key/value style format. Each
// line is tokenized as a single key/value pair. The first "=" delimited
// token in the line is interpreted as the flag name, and all remaining tokens
// are interpreted as the value. Any leading hyphens on the flag name are
// ignored.
func IniParser(r io.Reader, set func(name, value string) error) error {
s := bufio.NewScanner(r)
for s.Scan() {
line := strings.TrimSpace(s.Text())
if line == "" {
continue // skip empties
}
if line[0] == '#' || line[0] == ';' {
continue // skip comments
}
var (
name string
value string
index = strings.IndexRune(line, '=')
)
if index < 0 {
name, value = line, "true" // boolean option
} else {
name, value = strings.TrimSpace(line[:index]), strings.Trim(strings.TrimSpace(line[index+1:]), "\"")
}
if i := strings.Index(value, " #"); i >= 0 {
value = strings.TrimSpace(value[:i])
}
if err := set(name, value); err != nil {
return err
}
}
return nil
}

44
config_test.go Normal file
View File

@@ -0,0 +1,44 @@
package main
import (
"testing"
)
func TestSplitProto(t *testing.T) {
var tests = []struct {
input string
proto string
addr string
}{
{
input: "localhost",
proto: "",
addr: "localhost",
},
{
input: "tls://my.local.domain",
proto: "tls",
addr: "my.local.domain",
},
{
input: "starttls://my.local.domain",
proto: "starttls",
addr: "my.local.domain",
},
}
for i, test := range tests {
testName := test.input
t.Run(testName, func(t *testing.T) {
pa := splitProto(test.input)
if pa.protocol != test.proto {
t.Errorf("Testcase %d: Incorrect proto: expected %v, got %v",
i, test.proto, pa.protocol)
}
if pa.address != test.addr {
t.Errorf("Testcase %d: Incorrect addr: expected %v, got %v",
i, test.addr, pa.address)
}
})
}
}

22
go.mod
View File

@@ -1,7 +1,21 @@
module code.bluelife.at/decke/smtprelay
module github.com/decke/smtprelay
require (
github.com/chrj/smtpd v0.1.2
github.com/vharitonsky/iniflags v0.0.0-20180513140207-a33cd0b5f3de
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
github.com/chrj/smtpd v0.3.1
github.com/google/uuid v1.6.0
github.com/peterbourgon/ff/v3 v3.4.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.23.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.20.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
go 1.20

46
go.sum
View File

@@ -1,7 +1,39 @@
github.com/chrj/smtpd v0.1.2 h1:yWaMOCmnPlcNgJzkak1TBhhkObAfomd+NmZG5epdO88=
github.com/chrj/smtpd v0.1.2/go.mod h1:jt4ydELuZmqhn9hn3YpEPV1dY00aOB+Q1nWXnBDFKeY=
github.com/eaigner/dkim v0.0.0-20150301120808-6fe4a7ee9cfb/go.mod h1:FSCIHbrqk7D01Mj8y/jW+NS1uoCerr+ad+IckTHTFf4=
github.com/vharitonsky/iniflags v0.0.0-20180513140207-a33cd0b5f3de h1:fkw+7JkxF3U1GzQoX9h69Wvtvxajo5Rbzy6+YMMzPIg=
github.com/vharitonsky/iniflags v0.0.0-20180513140207-a33cd0b5f3de/go.mod h1:irMhzlTz8+fVFj6CH2AN2i+WI5S6wWFtK3MBCIxIpyI=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
github.com/chrj/smtpd v0.3.1 h1:kogHFkbFdKaoH3bgZkqNC9uVtKYOFfM3uV3rroBdooE=
github.com/chrj/smtpd v0.3.1/go.mod h1:JtABvV/LzvLmEIzy0NyDnrfMGOMd8wy5frAokwf6J9Q=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/peterbourgon/ff/v3 v3.4.0 h1:QBvM/rizZM1cB0p0lGMdmR7HxZeI/ZrBWB4DqLkMUBc=
github.com/peterbourgon/ff/v3 v3.4.0/go.mod h1:zjJVUhx+twciwfDl0zBcFzl4dW8axCRyXE/eKY9RztQ=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

60
logger.go Normal file
View File

@@ -0,0 +1,60 @@
package main
import (
"fmt"
"os"
"time"
"github.com/sirupsen/logrus"
)
var (
log *logrus.Logger
)
func setupLogger() {
log = logrus.New()
// Handle logfile
if *logFile == "" {
log.SetOutput(os.Stderr)
} else {
writer, err := os.OpenFile(*logFile, os.O_CREATE|os.O_RDWR|os.O_APPEND, 0600)
if err != nil {
fmt.Printf("cannot open log file: %s\n", err)
os.Exit(1)
}
log.SetOutput(writer)
}
// Handle log_format
switch *logFormat {
case "json":
log.SetFormatter(&logrus.JSONFormatter{
TimestampFormat: time.RFC3339Nano,
DisableHTMLEscape: true,
})
case "plain":
log.SetFormatter(&logrus.TextFormatter{
DisableTimestamp: true,
})
case "", "default":
log.SetFormatter(&logrus.TextFormatter{
FullTimestamp: true,
})
default:
fmt.Fprintf(os.Stderr, "Invalid log_format: %s\n", *logFormat)
os.Exit(1)
}
// Handle log_level
level, err := logrus.ParseLevel(*logLevel)
if err != nil {
level = logrus.InfoLevel
log.WithField("given_level", *logLevel).
Warn("could not parse log level, defaulting to 'info'")
}
log.SetLevel(level)
}

415
main.go
View File

@@ -1,234 +1,415 @@
package main
import (
"bytes"
"crypto/tls"
"fmt"
"io"
"log"
"net"
"net/smtp"
"net/textproto"
"os"
"regexp"
"os/exec"
"os/signal"
"strings"
"time"
"syscall"
"github.com/chrj/smtpd"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
)
func connectionChecker(peer smtpd.Peer) error {
var peerIP net.IP
if addr, ok := peer.Addr.(*net.TCPAddr); ok {
peerIP = net.ParseIP(addr.IP.String())
} else {
return smtpd.Error{Code: 421, Message: "Denied"}
// This can't panic because we only have TCP listeners
peerIP := peer.Addr.(*net.TCPAddr).IP
if len(allowedNets) == 0 {
// Special case: empty string means allow everything
return nil
}
nets := strings.Split(*allowedNets, " ")
for i := range(nets) {
_, allowedNet, _ := net.ParseCIDR(nets[i])
for _, allowedNet := range allowedNets {
if allowedNet.Contains(peerIP) {
return nil
}
}
log.WithFields(logrus.Fields{
"ip": peerIP,
}).Warn("Connection refused from address outside of allowed_nets")
return smtpd.Error{Code: 421, Message: "Denied"}
}
func addrAllowed(addr string, allowedAddrs []string) bool {
if allowedAddrs == nil {
// If absent, all addresses are allowed
return true
}
addr = strings.ToLower(addr)
// Extract optional domain part
domain := ""
if idx := strings.LastIndex(addr, "@"); idx != -1 {
domain = strings.ToLower(addr[idx+1:])
}
// Test each address from allowedUsers file
for _, allowedAddr := range allowedAddrs {
allowedAddr = strings.ToLower(allowedAddr)
// Three cases for allowedAddr format:
if idx := strings.Index(allowedAddr, "@"); idx == -1 {
// 1. local address (no @) -- must match exactly
if allowedAddr == addr {
return true
}
} else {
if idx != 0 {
// 2. email address (user@domain.com) -- must match exactly
if allowedAddr == addr {
return true
}
} else {
// 3. domain (@domain.com) -- must match addr domain
allowedDomain := allowedAddr[idx+1:]
if allowedDomain == domain {
return true
}
}
}
}
return false
}
func senderChecker(peer smtpd.Peer, addr string) error {
// check sender address from auth file if user is authenticated
if *allowedUsers != "" && peer.Username != "" {
_, email, err := AuthFetch(peer.Username)
if localAuthRequired() && peer.Username != "" {
user, err := AuthFetch(peer.Username)
if err != nil {
// Shouldn't happen: authChecker already validated username+password
log.WithFields(logrus.Fields{
"peer": peer.Addr,
"username": peer.Username,
}).WithError(err).Warn("could not fetch auth user")
return smtpd.Error{Code: 451, Message: "Bad sender address"}
}
if strings.ToLower(addr) != strings.ToLower(email) {
if !addrAllowed(addr, user.allowedAddresses) {
log.WithFields(logrus.Fields{
"peer": peer.Addr,
"username": peer.Username,
"sender_address": addr,
}).Warn("sender address not allowed for authenticated user")
return smtpd.Error{Code: 451, Message: "Bad sender address"}
}
}
if *allowedSender == "" {
if allowedSender == nil {
// Any sender is permitted
return nil
}
re, err := regexp.Compile(*allowedSender)
if err != nil {
log.Printf("allowed_sender invalid: %v\n", err)
return smtpd.Error{Code: 451, Message: "Bad sender address"}
}
if re.MatchString(addr) {
if allowedSender.MatchString(addr) {
// Permitted by regex
return nil
}
log.WithFields(logrus.Fields{
"sender_address": addr,
"peer": peer.Addr,
}).Warn("sender address not allowed by allowed_sender pattern")
return smtpd.Error{Code: 451, Message: "Bad sender address"}
}
func recipientChecker(peer smtpd.Peer, addr string) error {
if *allowedRecipients == "" {
if allowedRecipients == nil {
// Any recipient is permitted
return nil
}
re, err := regexp.Compile(*allowedRecipients)
if err != nil {
log.Printf("allowed_recipients invalid: %v\n", err)
return smtpd.Error{Code: 451, Message: "Bad recipient address"}
}
if re.MatchString(addr) {
if allowedRecipients.MatchString(addr) {
// Permitted by regex
return nil
}
log.WithFields(logrus.Fields{
"peer": peer.Addr,
"recipient_address": addr,
}).Warn("recipient address not allowed by allowed_recipients pattern")
return smtpd.Error{Code: 451, Message: "Bad recipient address"}
}
func authChecker(peer smtpd.Peer, username string, password string) error {
err := AuthCheckPassword(username, password)
if err != nil {
log.Printf("Auth error: %v\n", err)
log.WithFields(logrus.Fields{
"peer": peer.Addr,
"username": username,
}).WithError(err).Warn("auth error")
return smtpd.Error{Code: 535, Message: "Authentication credentials invalid"}
}
return nil
}
func mailHandler(peer smtpd.Peer, env smtpd.Envelope) error {
if *allowedUsers != "" && peer.Username == "" {
return smtpd.Error{Code: 530, Message: "Authentication Required"}
}
peerIP := ""
if addr, ok := peer.Addr.(*net.TCPAddr); ok {
peerIP = addr.IP.String()
}
log.Printf("new mail from=<%s> to=%s peer=[%s]\n", env.Sender,
env.Recipients, peerIP)
logger := log.WithFields(logrus.Fields{
"from": env.Sender,
"to": env.Recipients,
"peer": peerIP,
"uuid": generateUUID(),
})
var auth smtp.Auth
host, _, _ := net.SplitHostPort(*remoteHost)
var envRemotes []*Remote
if *remoteUser != "" && *remotePass != "" {
auth = smtp.PlainAuth("", *remoteUser, *remotePass, host)
if *strictSender {
for _, remote := range remotes {
if remote.Sender == env.Sender {
envRemotes = append(envRemotes, remote)
}
}
} else {
envRemotes = remotes
}
if len(envRemotes) == 0 && *command == "" {
logger.Warning("no remote_host or command set; discarding mail")
return smtpd.Error{Code: 554, Message: "There are no appropriate remote_host or command"}
}
env.AddReceivedLine(peer)
log.Printf("delivering using smarthost %s\n", *remoteHost)
if *command != "" {
cmdLogger := logger.WithField("command", *command)
err := SendMail(
*remoteHost,
auth,
env.Sender,
env.Recipients,
env.Data,
)
if err != nil {
log.Printf("delivery failed: %v\n", err);
return smtpd.Error{Code: 554, Message: "Forwarding failed"}
var stdout bytes.Buffer
var stderr bytes.Buffer
environ := os.Environ()
environ = append(environ, fmt.Sprintf("%s=%s", "SMTPRELAY_FROM", env.Sender))
environ = append(environ, fmt.Sprintf("%s=%s", "SMTPRELAY_TO", env.Recipients))
environ = append(environ, fmt.Sprintf("%s=%s", "SMTPRELAY_PEER", peerIP))
cmd := exec.Cmd{
Env: environ,
Path: *command,
}
cmd.Stdin = bytes.NewReader(env.Data)
cmd.Stdout = &stdout
cmd.Stderr = &stderr
err := cmd.Run()
if err != nil {
cmdLogger.WithError(err).Error(stderr.String())
return smtpd.Error{Code: 554, Message: "External command failed"}
}
cmdLogger.Info("pipe command successful: " + stdout.String())
}
log.Printf("%s delivery successful\n", env.Recipients)
for _, remote := range envRemotes {
logger = logger.WithField("host", remote.Addr)
logger.Info("delivering mail from peer using smarthost")
err := SendMail(
remote,
env.Sender,
env.Recipients,
env.Data,
)
if err != nil {
var smtpError smtpd.Error
switch err := err.(type) {
case *textproto.Error:
smtpError = smtpd.Error{Code: err.Code, Message: err.Msg}
logger.WithFields(logrus.Fields{
"err_code": err.Code,
"err_msg": err.Msg,
}).Error("delivery failed")
default:
smtpError = smtpd.Error{Code: 554, Message: "Forwarding failed"}
logger.WithError(err).
Error("delivery failed")
}
return smtpError
}
logger.Debug("delivery successful")
}
return nil
}
func main() {
func generateUUID() string {
uniqueID, err := uuid.NewRandom()
if err != nil {
log.WithError(err).
Error("could not generate UUIDv4")
return ""
}
return uniqueID.String()
}
func getTLSConfig() *tls.Config {
// Ciphersuites as defined in stock Go but without 3DES and RC4
// https://golang.org/src/crypto/tls/cipher_suites.go
var tlsCipherSuites = []uint16{
tls.TLS_AES_128_GCM_SHA256,
tls.TLS_AES_256_GCM_SHA384,
tls.TLS_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
tls.TLS_RSA_WITH_AES_128_GCM_SHA256, // does not provide PFS
tls.TLS_RSA_WITH_AES_256_GCM_SHA384, // does not provide PFS
}
if *localCert == "" || *localKey == "" {
log.WithFields(logrus.Fields{
"cert_file": *localCert,
"key_file": *localKey,
}).Fatal("TLS certificate/key file not defined in config")
}
cert, err := tls.LoadX509KeyPair(*localCert, *localKey)
if err != nil {
log.WithField("error", err).
Fatal("cannot load X509 keypair")
}
return &tls.Config{
PreferServerCipherSuites: true,
MinVersion: tls.VersionTLS12,
CipherSuites: tlsCipherSuites,
Certificates: []tls.Certificate{cert},
}
}
func main() {
ConfigLoad()
if *versionInfo {
fmt.Printf("smtprelay/%s\n", VERSION)
os.Exit(0)
}
log.WithField("version", appVersion).
Debug("starting smtprelay")
if *logFile != "" {
f, err := os.OpenFile(*logFile, os.O_WRONLY | os.O_CREATE | os.O_APPEND, 0600)
// Load allowed users file
if localAuthRequired() {
err := AuthLoadFile(*allowedUsers)
if err != nil {
log.Fatalf("Error opening logfile: %v", err)
log.WithField("file", *allowedUsers).
WithError(err).
Fatal("cannot load allowed users file")
}
defer f.Close()
log.SetOutput(io.MultiWriter(os.Stdout, f))
}
listeners := strings.Split(*listen, " ")
var servers []*smtpd.Server
for i := range(listeners) {
listener := listeners[i]
// Create a server for each desired listen address
for _, listen := range listenAddrs {
logger := log.WithField("address", listen.address)
server := &smtpd.Server{
Hostname: *hostName,
WelcomeMessage: *welcomeMsg,
ReadTimeout: readTimeout,
WriteTimeout: writeTimeout,
DataTimeout: dataTimeout,
MaxConnections: *maxConnections,
MaxMessageSize: *maxMessageSize,
MaxRecipients: *maxRecipients,
ConnectionChecker: connectionChecker,
SenderChecker: senderChecker,
RecipientChecker: recipientChecker,
Handler: mailHandler,
}
if *allowedUsers != "" {
err := AuthLoadFile(*allowedUsers)
if err != nil {
log.Fatalf("Authentication file: %s\n", err)
}
if localAuthRequired() {
server.Authenticator = authChecker
}
if strings.Index(listeners[i], "://") == -1 {
log.Printf("Listen on %s ...\n", listener)
go server.ListenAndServe(listener)
} else if strings.HasPrefix(listeners[i], "starttls://") {
listener = strings.TrimPrefix(listener, "starttls://")
var lsnr net.Listener
var err error
if *localCert == "" || *localKey == "" {
log.Fatal("TLS certificate/key not defined in config")
}
switch listen.protocol {
case "":
logger.Info("listening on address")
lsnr, err = net.Listen("tcp", listen.address)
cert, err := tls.LoadX509KeyPair(*localCert, *localKey)
if err != nil {
log.Fatal(err)
}
server.TLSConfig = &tls.Config {
Certificates: [] tls.Certificate{cert},
}
case "starttls":
server.TLSConfig = getTLSConfig()
server.ForceTLS = *localForceTLS
log.Printf("Listen on %s (STARTSSL) ...\n", listener)
lsnr, err := net.Listen("tcp", listener)
defer lsnr.Close()
logger.Info("listening on address (STARTTLS)")
lsnr, err = net.Listen("tcp", listen.address)
go server.Serve(lsnr)
} else if strings.HasPrefix(listeners[i], "tls://") {
case "tls":
server.TLSConfig = getTLSConfig()
listener = strings.TrimPrefix(listener, "tls://")
logger.Info("listening on address (TLS)")
lsnr, err = tls.Listen("tcp", listen.address, server.TLSConfig)
if *localCert == "" || *localKey == "" {
log.Fatal("TLS certificate/key not defined in config")
}
default:
logger.WithField("protocol", listen.protocol).
Fatal("unknown protocol in listen address")
}
cert, err := tls.LoadX509KeyPair(*localCert, *localKey)
if err != nil {
log.Fatal(err)
}
if err != nil {
logger.WithError(err).Fatal("error starting listener")
}
servers = append(servers, server)
server.TLSConfig = &tls.Config {
Certificates: [] tls.Certificate{cert},
}
go func() {
server.Serve(lsnr)
}()
}
log.Printf("Listen on %s (TLS) ...\n", listener)
lsnr, err := tls.Listen("tcp", listener, server.TLSConfig)
defer lsnr.Close()
handleSignals()
go server.Serve(lsnr)
} else {
log.Fatal("Unknown protocol in listener ", listener)
// First close the listeners
for _, server := range servers {
logger := log.WithField("address", server.Address())
logger.Debug("Shutting down server")
err := server.Shutdown(false)
if err != nil {
logger.WithError(err).
Warning("Shutdown failed")
}
}
for true {
time.Sleep(time.Minute)
// Then wait for the clients to exit
for _, server := range servers {
logger := log.WithField("address", server.Address())
logger.Debug("Waiting for server")
err := server.Wait()
if err != nil {
logger.WithError(err).
Warning("Wait failed")
}
}
log.Debug("done")
}
func handleSignals() {
// Wait for SIGINT, SIGQUIT, or SIGTERM
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM)
sig := <-sigs
log.WithField("signal", sig).
Info("shutting down in response to received signal")
}

94
main_test.go Normal file
View File

@@ -0,0 +1,94 @@
package main
import (
"testing"
)
func TestAddrAllowedNoDomain(t *testing.T) {
allowedAddrs := []string{"joe@abc.com"}
if addrAllowed("bob.com", allowedAddrs) {
t.FailNow()
}
}
func TestAddrAllowedSingle(t *testing.T) {
allowedAddrs := []string{"joe@abc.com"}
if !addrAllowed("joe@abc.com", allowedAddrs) {
t.FailNow()
}
if addrAllowed("bob@abc.com", allowedAddrs) {
t.FailNow()
}
}
func TestAddrAllowedDifferentCase(t *testing.T) {
allowedAddrs := []string{"joe@abc.com"}
testAddrs := []string{
"joe@ABC.com",
"Joe@abc.com",
"JOE@abc.com",
"JOE@ABC.COM",
}
for _, addr := range testAddrs {
if !addrAllowed(addr, allowedAddrs) {
t.Errorf("Address %v not allowed, but should be", addr)
}
}
}
func TestAddrAllowedLocal(t *testing.T) {
allowedAddrs := []string{"joe"}
if !addrAllowed("joe", allowedAddrs) {
t.FailNow()
}
if addrAllowed("bob", allowedAddrs) {
t.FailNow()
}
}
func TestAddrAllowedMulti(t *testing.T) {
allowedAddrs := []string{"joe@abc.com", "bob@def.com"}
if !addrAllowed("joe@abc.com", allowedAddrs) {
t.FailNow()
}
if !addrAllowed("bob@def.com", allowedAddrs) {
t.FailNow()
}
if addrAllowed("bob@abc.com", allowedAddrs) {
t.FailNow()
}
}
func TestAddrAllowedSingleDomain(t *testing.T) {
allowedAddrs := []string{"@abc.com"}
if !addrAllowed("joe@abc.com", allowedAddrs) {
t.FailNow()
}
if addrAllowed("joe@def.com", allowedAddrs) {
t.FailNow()
}
}
func TestAddrAllowedMixed(t *testing.T) {
allowedAddrs := []string{"app", "app@example.com", "@appsrv.example.com"}
if !addrAllowed("app", allowedAddrs) {
t.FailNow()
}
if !addrAllowed("app@example.com", allowedAddrs) {
t.FailNow()
}
if addrAllowed("ceo@example.com", allowedAddrs) {
t.FailNow()
}
if !addrAllowed("root@appsrv.example.com", allowedAddrs) {
t.FailNow()
}
if !addrAllowed("dev@appsrv.example.com", allowedAddrs) {
t.FailNow()
}
if addrAllowed("appsrv@example.com", allowedAddrs) {
t.FailNow()
}
}

83
remotes.go Normal file
View File

@@ -0,0 +1,83 @@
package main
import (
"fmt"
"net/smtp"
"net/url"
)
type Remote struct {
SkipVerify bool
Auth smtp.Auth
Scheme string
Hostname string
Port string
Addr string
Sender string
}
// ParseRemote creates a remote from a given url in the following format:
//
// smtp://[user[:password]@][netloc][:port][/remote_sender][?param1=value1&...]
// smtps://[user[:password]@][netloc][:port][/remote_sender][?param1=value1&...]
// starttls://[user[:password]@][netloc][:port][/remote_sender][?param1=value1&...]
//
// Supported Params:
// - skipVerify: can be "true" or empty to prevent ssl verification of remote server's certificate.
// - auth: can be "login" to trigger "LOGIN" auth instead of "PLAIN" auth
func ParseRemote(remoteURL string) (*Remote, error) {
u, err := url.Parse(remoteURL)
if err != nil {
return nil, err
}
if u.Scheme != "smtp" && u.Scheme != "smtps" && u.Scheme != "starttls" {
return nil, fmt.Errorf("'%s' is not a supported relay scheme", u.Scheme)
}
hostname, port := u.Hostname(), u.Port()
if port == "" {
switch u.Scheme {
case "smtp":
port = "25"
case "smtps":
port = "465"
case "starttls":
port = "587"
}
}
q := u.Query()
r := &Remote{
Scheme: u.Scheme,
Hostname: hostname,
Port: port,
Addr: fmt.Sprintf("%s:%s", hostname, port),
}
if u.User != nil {
pass, _ := u.User.Password()
user := u.User.Username()
if hasAuth, authVal := q.Has("auth"), q.Get("auth"); hasAuth {
if authVal != "login" {
return nil, fmt.Errorf("Auth must be login or not present, received '%s'", authVal)
}
r.Auth = LoginAuth(user, pass)
} else {
r.Auth = smtp.PlainAuth("", user, pass, u.Hostname())
}
}
if hasVal, skipVerify := q.Has("skipVerify"), q.Get("skipVerify"); hasVal && skipVerify != "false" {
r.SkipVerify = true
}
if u.Path != "" {
r.Sender = u.Path[1:]
}
return r, nil
}

114
remotes_test.go Normal file
View File

@@ -0,0 +1,114 @@
package main
import (
"net/smtp"
"testing"
"github.com/stretchr/testify/assert"
)
func AssertRemoteUrlEquals(t *testing.T, expected *Remote, remotUrl string) {
actual, err := ParseRemote(remotUrl)
assert.Nil(t, err)
assert.NotNil(t, actual)
assert.Equal(t, expected.Scheme, actual.Scheme, "Scheme %s", remotUrl)
assert.Equal(t, expected.Addr, actual.Addr, "Addr %s", remotUrl)
assert.Equal(t, expected.Hostname, actual.Hostname, "Hostname %s", remotUrl)
assert.Equal(t, expected.Port, actual.Port, "Port %s", remotUrl)
assert.Equal(t, expected.Sender, actual.Sender, "Sender %s", remotUrl)
assert.Equal(t, expected.SkipVerify, actual.SkipVerify, "SkipVerify %s", remotUrl)
if expected.Auth != nil || actual.Auth != nil {
assert.NotNil(t, expected, "Auth %s", remotUrl)
assert.NotNil(t, actual, "Auth %s", remotUrl)
assert.IsType(t, expected.Auth, actual.Auth)
}
}
func TestValidRemoteUrls(t *testing.T) {
AssertRemoteUrlEquals(t, &Remote{
Scheme: "smtp",
SkipVerify: false,
Auth: nil,
Hostname: "email.com",
Port: "25",
Addr: "email.com:25",
Sender: "",
}, "smtp://email.com")
AssertRemoteUrlEquals(t, &Remote{
Scheme: "smtp",
SkipVerify: true,
Auth: nil,
Hostname: "email.com",
Port: "25",
Addr: "email.com:25",
Sender: "",
}, "smtp://email.com?skipVerify")
AssertRemoteUrlEquals(t, &Remote{
Scheme: "smtp",
SkipVerify: false,
Auth: smtp.PlainAuth("", "user", "pass", ""),
Hostname: "email.com",
Port: "25",
Addr: "email.com:25",
Sender: "",
}, "smtp://user:pass@email.com")
AssertRemoteUrlEquals(t, &Remote{
Scheme: "smtp",
SkipVerify: false,
Auth: LoginAuth("user", "pass"),
Hostname: "email.com",
Port: "25",
Addr: "email.com:25",
Sender: "",
}, "smtp://user:pass@email.com?auth=login")
AssertRemoteUrlEquals(t, &Remote{
Scheme: "smtp",
SkipVerify: false,
Auth: LoginAuth("user", "pass"),
Hostname: "email.com",
Port: "25",
Addr: "email.com:25",
Sender: "sender@website.com",
}, "smtp://user:pass@email.com/sender@website.com?auth=login")
AssertRemoteUrlEquals(t, &Remote{
Scheme: "smtps",
SkipVerify: false,
Auth: LoginAuth("user", "pass"),
Hostname: "email.com",
Port: "465",
Addr: "email.com:465",
Sender: "sender@website.com",
}, "smtps://user:pass@email.com/sender@website.com?auth=login")
AssertRemoteUrlEquals(t, &Remote{
Scheme: "smtps",
SkipVerify: true,
Auth: LoginAuth("user", "pass"),
Hostname: "email.com",
Port: "8425",
Addr: "email.com:8425",
Sender: "sender@website.com",
}, "smtps://user:pass@email.com:8425/sender@website.com?auth=login&skipVerify")
AssertRemoteUrlEquals(t, &Remote{
Scheme: "starttls",
SkipVerify: true,
Auth: LoginAuth("user", "pass"),
Hostname: "email.com",
Port: "8425",
Addr: "email.com:8425",
Sender: "sender@website.com",
}, "starttls://user:pass@email.com:8425/sender@website.com?auth=login&skipVerify")
}
func TestMissingScheme(t *testing.T) {
_, err := ParseRemote("http://user:pass@email.com:8425/sender@website.com")
assert.NotNil(t, err, "Err must be present")
assert.Equal(t, err.Error(), "'http' is not a supported relay scheme")
}

82
smtp.go
View File

@@ -4,15 +4,17 @@
// Package smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321.
// It also implements the following extensions:
//
// 8BITMIME RFC 1652
// AUTH RFC 2554
// STARTTLS RFC 3207
//
// Additional extensions may be handled by clients.
//
// The smtp package is frozen and is not accepting new features.
// Some external packages provide more functionality. See:
//
// https://godoc.org/?q=smtp
// https://godoc.org/?q=smtp
package main
import (
@@ -106,7 +108,7 @@ func (c *Client) Hello(localName string) error {
}
// cmd is a convenience function that sends a command and returns the response
func (c *Client) cmd(expectCode int, format string, args ...interface{}) (int, string, error) {
func (c *Client) cmd(expectCode int, format string, args ...any) (int, string, error) {
id, err := c.Text.Cmd(format, args...)
if err != nil {
return 0, "", err
@@ -137,12 +139,8 @@ func (c *Client) ehlo() error {
if len(extList) > 1 {
extList = extList[1:]
for _, line := range extList {
args := strings.SplitN(line, " ", 2)
if len(args) > 1 {
ext[args[0]] = args[1]
} else {
ext[args[0]] = ""
}
k, v, _ := strings.Cut(line, " ")
ext[k] = v
}
}
if mechs, ok := ext["AUTH"]; ok {
@@ -242,7 +240,8 @@ func (c *Client) Auth(a smtp.Auth) error {
// Mail issues a MAIL command to the server using the provided email address.
// If the server supports the 8BITMIME extension, Mail adds the BODY=8BITMIME
// parameter.
// parameter. If the server supports the SMTPUTF8 extension, Mail adds the
// SMTPUTF8 parameter.
// This initiates a mail transaction and is followed by one or more Rcpt calls.
func (c *Client) Mail(from string) error {
if err := validateLine(from); err != nil {
@@ -256,6 +255,9 @@ func (c *Client) Mail(from string) error {
if _, ok := c.ext["8BITMIME"]; ok {
cmdStr += " BODY=8BITMIME"
}
if _, ok := c.ext["SMTPUTF8"]; ok {
cmdStr += " SMTPUTF8"
}
}
_, _, err := c.cmd(250, cmdStr, from)
return err
@@ -318,7 +320,11 @@ var testHookStartTLS func(*tls.Config) // nil, except for tests
// attachments (see the mime/multipart package), or other mail
// functionality. Higher-level packages exist outside of the standard
// library.
func SendMail(addr string, a smtp.Auth, from string, to []string, msg []byte) error {
func SendMail(r *Remote, from string, to []string, msg []byte) error {
if r.Sender != "" {
from = r.Sender
}
if err := validateLine(from); err != nil {
return err
}
@@ -327,19 +333,19 @@ func SendMail(addr string, a smtp.Auth, from string, to []string, msg []byte) er
return err
}
}
host, port, err := net.SplitHostPort(addr)
if err != nil {
return err
}
var c *Client
if port == "465" || port == "smtps" {
config := &tls.Config{ServerName: host}
conn, err := tls.Dial("tcp", addr, config)
var err error
if r.Scheme == "smtps" {
config := &tls.Config{
ServerName: r.Hostname,
InsecureSkipVerify: r.SkipVerify,
}
conn, err := tls.Dial("tcp", r.Addr, config)
if err != nil {
return err
}
defer conn.Close()
c, err = NewClient(conn, host)
c, err = NewClient(conn, r.Hostname)
if err != nil {
return err
}
@@ -347,7 +353,7 @@ func SendMail(addr string, a smtp.Auth, from string, to []string, msg []byte) er
return err
}
} else {
c, err = Dial(addr)
c, err = Dial(r.Addr)
if err != nil {
return err
}
@@ -356,20 +362,25 @@ func SendMail(addr string, a smtp.Auth, from string, to []string, msg []byte) er
return err
}
if ok, _ := c.Extension("STARTTLS"); ok {
config := &tls.Config{ServerName: c.serverName}
config := &tls.Config{
ServerName: c.serverName,
InsecureSkipVerify: r.SkipVerify,
}
if testHookStartTLS != nil {
testHookStartTLS(config)
}
if err = c.StartTLS(config); err != nil {
return err
}
} else if r.Scheme == "starttls" {
return errors.New("starttls: server does not support extension, check remote scheme")
}
}
if a != nil && c.ext != nil {
if r.Auth != nil && c.ext != nil {
if _, ok := c.ext["AUTH"]; !ok {
return errors.New("smtp: server doesn't support AUTH")
}
if err = c.Auth(a); err != nil {
if err = c.Auth(r.Auth); err != nil {
return err
}
}
@@ -451,3 +462,30 @@ func validateLine(line string) error {
}
return nil
}
// LOGIN authentication
type loginAuth struct {
username, password string
}
func LoginAuth(username, password string) smtp.Auth {
return &loginAuth{username, password}
}
func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) {
return "LOGIN", []byte{}, nil
}
func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) {
if more {
switch string(fromServer) {
case "Username:":
return []byte(a.username), nil
case "Password:":
return []byte(a.password), nil
default:
return nil, errors.New("Unknown fromServer")
}
}
return nil, nil
}

View File

@@ -1,13 +1,23 @@
; smtprelay configuration
;
; All config parameters can also be provided as environment
; variables in uppercase and the prefix "SMTPRELAY_".
; (eg. SMTPRELAY_LOGFILE, SMTPRELAY_LOG_FORMAT)
; Logfile
;logfile = /var/log/smtprelay.log
; Logfile (blank/default is stderr)
;logfile =
; Log format: default, plain (no timestamp), json
;log_format = default
; Log level: panic, fatal, error, warn, info, debug, trace
;log_level = info
; Hostname for this SMTP server
;hostname = "localhost.localdomain"
;hostname = localhost.localdomain
; Welcome message for clients
;welcome_msg = "<hostname> ESMTP ready."
;welcome_msg = <hostname> ESMTP ready.
; Listen on the following addresses for incoming
; unencrypted connections.
@@ -24,33 +34,97 @@
; accepting mails from client.
;local_forcetls = false
; Networks that are allowed to send mails to us
;allowed_nets = 127.0.0.1/8 ::1/128
; Only use remotes where FROM EMail address in received
; EMail matches remote_sender.
;strict_sender = false
; Regular expression for valid FROM EMail adresses
; Socket timeout for read operations
; Duration string as sequence of decimal numbers,
; each with optional fraction and a unit suffix.
; Valid time units are "ns", "us", "ms", "s", "m", "h".
;read_timeout = 60s
; Socket timeout for write operations
; Duration string as sequence of decimal numbers,
; each with optional fraction and a unit suffix.
; Valid time units are "ns", "us", "ms", "s", "m", "h".
;write_timeout = 60s
; Socket timeout for DATA command
; Duration string as sequence of decimal numbers,
; each with optional fraction and a unit suffix.
; Valid time units are "ns", "us", "ms", "s", "m", "h".
;data_timeout = 5m
; Max concurrent connections, use -1 to disable
;max_connections = 100
; Max message size in bytes
;max_message_size = 10240000
; Max RCPT TO calls for each envelope
;max_recipients = 100
; Networks that are allowed to send mails to us
; Defaults to localhost. If set to "", then any address is allowed.
;allowed_nets = 127.0.0.0/8 ::1/128
; Regular expression for valid FROM EMail addresses
; If set to "", then any sender is permitted.
; Example: ^(.*)@localhost.localdomain$
;allowed_sender =
; Regular expression for valid TO EMail adresses
; Regular expression for valid TO EMail addresses
; If set to "", then any recipient is permitted.
; Example: ^(.*)@localhost.localdomain$
;allowed_recipients =
; File which contains username and password used for
; authentication before they can send mail.
; File format: username bcrypt-hash email
; File format: username bcrypt-hash [email[,email[,...]]]
; username: The SMTP auth username
; bcrypt-hash: The bcrypt hash of the pasword (generate with "./hasher password")
; email: Comma-separated list of allowed "from" addresses:
; - If omitted, user can send from any address
; - If @domain.com is given, user can send from any address @domain.com
; - Otherwise, email address must match exactly (case-insensitive)
; E.g. "app@example.com,@appsrv.example.com"
;allowed_users =
; Relay all mails to this SMTP server
; Relay all mails to this SMTP servers.
; If not set, mails are discarded.
;
; Format:
; protocol://[user[:password]@][netloc][:port][/remote_sender][?param1=value1&...]
;
; protocol: smtp (unencrypted), smtps (TLS), starttls (STARTTLS)
; user: Username for authentication
; password: Password for authentication
; remote_sender: Email address to use as FROM
; params:
; skipVerify: "true" or empty to prevent ssl verification of remote server's certificate
; auth: "login" to use LOGIN authentication
; GMail
;remote_host = smtp.gmail.com:587
;remotes = starttls://user:pass@smtp.gmail.com:587
; Mailgun.org
;remote_host = smtp.mailgun.org:587
;remotes = starttls://user:pass@smtp.mailgun.org:587
; Mailjet.com
;remote_host = in-v3.mailjet.com:587
;remotes = starttls://user:pass@in-v3.mailjet.com:587
; Authentication credentials on outgoing SMTP server
;remote_user =
;remote_pass =
; Ignore remote host certificates
;remotes = starttls://user:pass@server:587?skipVerify
; Login Authentication method on outgoing SMTP server
;remotes = smtp://user:pass@server:2525?auth=login
; Sender e-mail address on outgoing SMTP server
;remotes = smtp://user:pass@server:2525/overridden@email.com?auth=login
; Multiple remotes, space delimited
;remotes = smtp://127.0.0.1:1025 starttls://user:pass@smtp.mailgun.org:587
; Pipe messages to external command
;command = /usr/local/bin/script