summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2019-07-26 12:15:23 +0500
committerSunil Nimmagadda <sunil@nimmagadda.net>2019-07-26 12:15:23 +0500
commite31f67f1adf5e5f87d9eb5b619f8ae845be62a6a (patch)
tree80a748f3cc1d443d0afc37bd8e2b7b4c593ad3e1
parent46120d6e615371d1a08609379af4b1fc578faf66 (diff)
Return TempFail on errors.HEADmain
gilles@ pointed out that a TempFail suffices in case of HTTP POST failure to rspamd instead of bringing down the daemon.
-rw-r--r--filter_rspamd.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/filter_rspamd.go b/filter_rspamd.go
index d326b09..8e862b0 100644
--- a/filter_rspamd.go
+++ b/filter_rspamd.go
@@ -138,12 +138,14 @@ func dataOutput(headers map[string]string,
go func() {
resp, err := rspamdPost(headers, data)
if err != nil {
- log.Fatal(err)
+ ch <- "421 Temporary failure"
+ return
}
log.Printf("%v\n", resp)
m, err := mail.ReadMessage(strings.NewReader(data))
if err != nil {
- log.Fatal(err)
+ ch <- "421 Temporary failure"
+ return
}
rejectReason := ""
switch resp.Action {