X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/cd9868ec7872447f31efd5f175c7f3e90ac92657..ebeaf99687d0fd6545c95983f0d91e2ddee7fbb7:/src/src/daemon.c diff --git a/src/src/daemon.c b/src/src/daemon.c index 4c6c90878..e844403a4 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/daemon.c,v 1.22 2007/01/23 14:34:02 ph10 Exp $ */ +/* $Cambridge: exim/src/src/daemon.c,v 1.23 2007/03/14 12:15:56 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -881,6 +881,7 @@ There are no arguments to this function, and it never returns. */ void daemon_go(void) { +struct passwd *pw; int *listen_sockets = NULL; int listen_socket_count = 0; ip_address_item *addresses = NULL; @@ -1453,6 +1454,14 @@ cannot do this. */ exim_setugid(exim_uid, exim_gid, geteuid()==root_uid, US"running as a daemon"); +/* Update the originator_xxx fields so that received messages as listed as +coming from Exim, not whoever started the daemon. */ + +originator_uid = exim_uid; +originator_gid = exim_gid; +originator_login = ((pw = getpwuid(exim_uid)) != NULL)? + string_copy_malloc(US pw->pw_name) : US"exim"; + /* Get somewhere to keep the list of queue-runner pids if we are keeping track of them (and also if we are doing queue runs). */