2
0
forked from drew/smtprelay

Added external command support.

This commit is contained in:
Ben Ubois
2021-05-07 14:08:10 -07:00
parent ebb53ea1b6
commit d8860fc917
3 changed files with 33 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ var (
allowedRecipStr = flag.String("allowed_recipients", "", "Regular expression for valid TO EMail addresses")
allowedRecipients *regexp.Regexp
allowedUsers = flag.String("allowed_users", "", "Path to file with valid users/passwords")
command = flag.String("command", "", "Path to pipe command")
remoteHost = flag.String("remote_host", "", "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")
@@ -172,8 +173,8 @@ func ConfigLoad() {
// Set up logging as soon as possible
setupLogger()
if *remoteHost == "" {
log.Warn("remote_host not set; mail will not be forwarded!")
if *remoteHost == "" && *command == "" {
log.Warn("no remote_host or command set; mail will not be forwarded!")
}
setupAllowedNetworks()