aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-11-21 00:02:29 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-11-21 00:02:29 +0000
commit916448aeaf613a90493dd31344637f8b53a74d41 (patch)
tree50a9a7a5cacfbbad4df1debd2d60eb249791f1db /sink.c
parent0da7409298a69b7ed8e48cfabbcead9f2b719ec8 (diff)
downloadfetchmail-916448aeaf613a90493dd31344637f8b53a74d41.tar.gz
fetchmail-916448aeaf613a90493dd31344637f8b53a74d41.tar.bz2
fetchmail-916448aeaf613a90493dd31344637f8b53a74d41.zip
Better warning-mail dispatch.
svn path=/trunk/; revision=2201
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/sink.c b/sink.c
index 7146b214..f05e3802 100644
--- a/sink.c
+++ b/sink.c
@@ -837,12 +837,29 @@ int open_warning_by_mail(struct query *ctl)
int good, bad;
/*
- * We give a null address list as the recipients member because we
- * actually *want* this message to go to run.postmaster. The zero
- * length arg 5 means we won't pass a SIZE option to ESMTP; the
- * message length would be more trouble than it's worth to compute.
+ * Dispatching warning email is a little complicated. The problem is
+ * that we have to deal with three distinct cases:
+ *
+ * 1. Single-drop running from user account. Warning mail should
+ * go to the local name for which we're collecting (coincides
+ * with calling user).
+ *
+ * 2. Single-drop running from root or other privileged ID, with rc
+ * file generated on the fly (Ken Estes's weird setup...) Mail
+ * should go to the local name for which we're collecting (does not
+ * coincide with calling user).
+ *
+ * 3. Multidrop. Mail must go to postmaster. We leave the recipients
+ * member null so this message will fall through to run.postmaster.
+ *
+ * The zero in the reallen element means we won't pass a SIZE
+ * option to ESMTP; the message length would be more trouble than
+ * it's worth to compute.
*/
- static struct msgblk msg = {NULL, NULL, "FETCHMAIL-DAEMON", 0};
+ struct msgblk msg = {NULL, NULL, "FETCHMAIL-DAEMON", 0};
+
+ if (!MULTIDROP(ctl))
+ msg.recipients = ctl->localnames;
return(open_sink(ctl, &msg, &good, &bad));
}