-/* $OpenBSD: enqueue.c,v 1.88 2014/11/12 10:28:07 gilles Exp $ */
+/* $OpenBSD: enqueue.c,v 1.89 2015/01/15 09:05:37 gilles Exp $ */
/*
* Copyright (c) 2005 Henning Brauer <henning@bulabula.org>
int inheaders = 0;
int save_argc;
char **save_argv;
+ int no_getlogin = 0;
memset(&msg, 0, sizeof(msg));
time(×tamp);
save_argv = argv;
while ((ch = getopt(argc, argv,
- "A:B:b:E::e:F:f:iJ::L:mN:o:p:qR:tvV:x")) != -1) {
+ "A:B:b:E::e:F:f:iJ::L:mN:o:p:qRS:tvV:x")) != -1) {
switch (ch) {
case 'f':
fake_from = optarg;
case 'R':
msg.dsn_ret = optarg;
break;
+ case 'S':
+ no_getlogin = 1;
+ break;
case 't':
tflag = 1;
break;
if (getmailname(host, sizeof(host)) == -1)
err(EX_NOHOST, "getmailname");
- if ((user = getlogin()) != NULL && *user != '\0')
- pw = getpwnam(user);
- else if ((pw = getpwuid(getuid())) == NULL)
- user = "anonymous";
- user = xstrdup(pw ? pw->pw_name : user, "enqueue");
+ if (no_getlogin) {
+ if ((pw = getpwuid(getuid())) == NULL)
+ user = "anonymous";
+ if (pw != NULL)
+ user = xstrdup(pw->pw_name, "enqueue");
+ }
+ else {
+ if ((user = getlogin()) != NULL && *user != '\0')
+ pw = getpwnam(user);
+ else if ((pw = getpwuid(getuid())) == NULL)
+ user = "anonymous";
+ user = xstrdup(pw ? pw->pw_name : user, "enqueue");
+ }
build_from(fake_from, pw);
-/* $OpenBSD: smtpd.c,v 1.235 2014/08/25 07:50:26 doug Exp $ */
+/* $OpenBSD: smtpd.c,v 1.236 2015/01/15 09:05:37 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
p[len - 1] = '\0';
addargs(&args, "%s", "sendmail");
+ addargs(&args, "%s", "-S");
while ((tmp = strsep(&p, "|")) != NULL)
addargs(&args, "%s", tmp);