aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2019-08-25 18:52:53 +0200
committerMatthias Andree <matthias.andree@gmx.de>2019-08-25 18:52:53 +0200
commite0e7a74bde52a1aa02d1da758128722598fb6dd8 (patch)
tree3064dd064dcde0969467c6d2e068d8ccbbd648b1 /sink.c
parent5256f6122e9843b1e9988a742ed6c2a4923bc2bd (diff)
downloadfetchmail-e0e7a74bde52a1aa02d1da758128722598fb6dd8.tar.gz
fetchmail-e0e7a74bde52a1aa02d1da758128722598fb6dd8.tar.bz2
fetchmail-e0e7a74bde52a1aa02d1da758128722598fb6dd8.zip
Align with legacy_6x.
* Normalize include order. * Backport missed bug fixes. * Remove dead code.
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/sink.c b/sink.c
index 164c36d8..85680dbe 100644
--- a/sink.c
+++ b/sink.c
@@ -11,6 +11,8 @@
*/
#include "config.h"
+#include "fetchmail.h"
+
#include <stdio.h>
#include <errno.h>
#include <string.h>
@@ -32,8 +34,6 @@
#include <ctype.h>
#include <langinfo.h>
-#include "fetchmail.h"
-
/* for W* macros after pclose() */
#define _USE_BSD
#include <sys/types.h>
@@ -445,18 +445,6 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
responses[0] = xstrdup(smtp_response);
-#ifdef __UNUSED__
- /*
- * Don't do this! It can really mess you up if, for example, you're
- * reporting an error with a single RCPT TO address among several;
- * RSET discards the message body and it doesn't get sent to the
- * valid recipients.
- */
- smtp_rset(ctl); /* stay on the safe side */
- if (outlevel >= O_DEBUG)
- report(stdout, GT_("Saved error is still %d\n"), smtperr);
-#endif /* __UNUSED */
-
/*
* Note: send_bouncemail message strings are not made subject
* to gettext translation because (a) they're going to be
@@ -533,12 +521,6 @@ static int handle_smtp_report(struct query *ctl, struct msgblk *msg)
* (b) we wouldn't want spammers to get confirmation that
* this address is live, anyway.
*/
-#ifdef __DONT_FEED_THE_SPAMMERS__
- if (run.bouncemail)
- send_bouncemail(ctl, msg, XMIT_ACCEPT,
- "Invalid address in MAIL FROM (SMTP error 553).\r\n",
- 1, responses);
-#endif /* __DONT_FEED_THE_SPAMMERS__ */
free(responses[0]);
return(PS_REFUSED);
@@ -617,10 +599,6 @@ static int handle_smtp_report_without_bounce(struct query *ctl, struct msgblk *m
return(PS_REFUSED);
case 553: /* invalid sending domain */
-#ifdef __DONT_FEED_THE_SPAMMERS__
- if (run.bouncemail)
- return(PS_SUCCESS);
-#endif /* __DONT_FEED_THE_SPAMMERS__ */
return(PS_REFUSED);
default:
@@ -1185,6 +1163,16 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg,
for (dp = after, sp = before; (*dp = *sp); dp++, sp++) {
if (sp[0] != '%') continue;
+ if (sp > before && sp[-1] == '\'') {
+ report(stderr, GT_("MDA option contains single-quoted %%%c expansion.\n"), sp[1]);
+ report(stderr, GT_("Refusing to deliver. Check the manual and fix your mda option.\n"));
+ free(before);
+ free(after);
+ if (from) free(from);
+ if (names) free(names);
+ return PS_SYNTAX;
+ }
+
/* need to expand? BTW, no here overflow, because in
** the worst case (end of string) sp[1] == '\0' */
if (sp[1] == 's' || sp[1] == 'T') {