diff --git a/imap/attachextract.c b/imap/attachextract.c index 941628f16b1..c027f7d92a0 100644 --- a/imap/attachextract.c +++ b/imap/attachextract.c @@ -323,6 +323,13 @@ static int extractor_httpreq(struct extractor_ctx *ext, "method=<%s> guid=<%s> statuscode=<%d> r=<%s>", method, guidstr, *res_statuscode, error_message(r)); + if (r) { + xsyslog(LOG_WARNING, "failed HTTP request - resetting connection", + "method=<%s> guid=<%s> statuscode=<%d> r=<%s>", + method, guidstr, *res_statuscode, error_message(r)); + extractor_disconnect(ext); + } + spool_free_hdrcache(res_hdrs); buf_free(&req_buf); buf_free(&url_buf);