2
0
forked from drew/smtprelay
Commit Graph

41 Commits

Author SHA1 Message Date
Bernhard Froehlich
17421a539e Refactor to migrate from sirupsen/logrus to rs/zerolog and integrate DeRuina/timberjack for logfile rotation
Fixes #228
2025-08-03 18:47:42 +02: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 Froehlich
813bd9ebe7 Support .env files if it exists 2022-08-15 13:35:12 +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
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
e3ba45ede2 Fix output for "-version" to not contain unneccessary noise 2022-05-23 15:07:21 +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
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
Rubin Raithel
016ef762fb add: basic smtpd configuration options 2022-01-10 20:39:55 +01:00
Dries De Peuter
03d109ff8b feat: Add support for ignoring certs 2021-12-09 21:38:38 +01:00
Ben Ubois
d8860fc917 Added external command support. 2021-05-07 14:08:10 -07:00
Bernhard Froehlich
441a53cfd9 Fix code formatting with gofmt -s 2021-04-03 19:00:38 +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
3debf4127d Adjust remote auth disabled check syntax 2021-03-31 17:18:13 -04: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
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
918df65a3a Require that networks in allowed_nets are networks and not hosts 2021-03-13 20:40:25 -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
20ca816160 Discard mail if remote_host is not set
This is useful for test environments.
2021-03-13 09:28:04 -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
5ba64c5c6e Add new Release Workflow using Github Actions and wangyoucao577/go-release-action 2021-02-17 12:49:24 +00: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
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
21b597f351 Bump version to 1.3.0 2019-09-07 11:31: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
d11f8d81ea Fix formatting 2019-02-21 08:27:12 +00:00
Bernhard Froehlich
92be537b25 Bump version to 1.2.0 2019-01-07 12:03:27 +00:00
Bernhard Froehlich
3a96014c70 Revert package renaming 2018-12-29 13:08:10 +00:00
Bernhard Froehlich
ade7cbca36 Rename to smtprelay 2018-12-29 12:39:56 +00:00
Bernhard Froehlich
ab341c697d Code refactoring and rename package 2018-12-29 12:24:32 +00:00