summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
547f2e0)
SCCS-vsn: usr.sbin/sendmail/src/headers.c 6.21
SCCS-vsn: usr.sbin/sendmail/src/main.c 6.40
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 6.23
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 6.23
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 6.25
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 6.47
SCCS-vsn: usr.sbin/sendmail/src/queue.c 6.30
-static char sccsid[] = "@(#)deliver.c 6.46 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 6.47 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
int rcode; /* response code */
char *firstsig; /* signature of firstto */
char *pv[MAXPV+1];
int rcode; /* response code */
char *firstsig; /* signature of firstto */
char *pv[MAXPV+1];
- char tobuf[MAXLINE-50]; /* text line of to people */
+ char tobuf[TOBUFSIZE]; /* text line of to people */
char buf[MAXNAME];
char rpathbuf[MAXNAME]; /* translated return path */
extern int checkcompat();
char buf[MAXNAME];
char rpathbuf[MAXNAME]; /* translated return path */
extern int checkcompat();
/* rewrite from address, using rewriting rules */
(void) strcpy(rpathbuf, remotename(e->e_from.q_paddr, m, TRUE, FALSE,
TRUE, FALSE, e));
/* rewrite from address, using rewriting rules */
(void) strcpy(rpathbuf, remotename(e->e_from.q_paddr, m, TRUE, FALSE,
TRUE, FALSE, e));
-
- define('f', e->e_from.q_paddr, e); /* raw return path */
define('g', rpathbuf, e); /* translated return path */
define('h', host, e); /* to host */
Errors = 0;
define('g', rpathbuf, e); /* translated return path */
define('h', host, e); /* to host */
Errors = 0;
ee->e_sendqueue = copyqueue(e->e_sendqueue);
ee->e_errorqueue = copyqueue(e->e_errorqueue);
ee->e_flags = e->e_flags & ~(EF_INQUEUE|EF_CLRQUEUE);
ee->e_sendqueue = copyqueue(e->e_sendqueue);
ee->e_errorqueue = copyqueue(e->e_errorqueue);
ee->e_flags = e->e_flags & ~(EF_INQUEUE|EF_CLRQUEUE);
- (void) parseaddr(owner, &ee->e_from, 1, '\0', NULL, ee);
+ setsender(owner, ee, NULL, TRUE);
if (tTd(13, 5))
{
printf("sendall(split): QDONTSEND ");
if (tTd(13, 5))
{
printf("sendall(split): QDONTSEND ");
- (void) parseaddr(owner, &e->e_from, 1, '\0', NULL, e);
+ setsender(owner, e, NULL, TRUE);
if (tTd(13, 5))
{
printf("sendall(owner): QDONTSEND ");
if (tTd(13, 5))
{
printf("sendall(owner): QDONTSEND ");
-static char sccsid[] = "@(#)envelope.c 6.22 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 6.23 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
** e -- the envelope in which we would like the sender set.
** delimptr -- if non-NULL, set to the location of the
** trailing delimiter.
** e -- the envelope in which we would like the sender set.
** delimptr -- if non-NULL, set to the location of the
** trailing delimiter.
+** internal -- set if this address is coming from an internal
+** source such as an owner alias.
-** pointer to the delimiter terminating the from address.
**
** Side Effects:
** sets sendmail's notion of who the from person is.
*/
**
** Side Effects:
** sets sendmail's notion of who the from person is.
*/
-char *
-setsender(from, e, delimptr)
+setsender(from, e, delimptr, internal)
char *from;
register ENVELOPE *e;
char **delimptr;
char *from;
register ENVELOPE *e;
char **delimptr;
{
register char **pvp;
char *realname = NULL;
{
register char **pvp;
char *realname = NULL;
extern char *udbsender();
# endif
extern char *udbsender();
# endif
- /* if the user has given fullname already, don't redefine */
- if (FullName == NULL)
- FullName = macvalue('x', e);
- if (FullName != NULL && FullName[0] == '\0')
- FullName = NULL;
+ if (!internal)
+ {
+ /* if the user has given fullname already, don't redefine */
+ if (FullName == NULL)
+ FullName = macvalue('x', e);
+ if (FullName != NULL && FullName[0] == '\0')
+ FullName = NULL;
- if (p != NULL)
- {
- /*
- ** We have an alternate address for the sender
- */
+ if (p != NULL)
+ {
+ /*
+ ** We have an alternate address for the sender
+ */
- pvp = prescan(p, '\0', pvpbuf, NULL);
- }
+ pvp = prescan(p, '\0', pvpbuf, NULL);
+ }
if ((pw = getpwnam(e->e_from.q_user)) != NULL)
{
if ((pw = getpwnam(e->e_from.q_user)) != NULL)
{
/* extract full name from passwd file */
if (FullName == NULL && pw->pw_gecos != NULL &&
/* extract full name from passwd file */
if (FullName == NULL && pw->pw_gecos != NULL &&
- strcmp(pw->pw_name, e->e_from.q_user) == 0)
+ strcmp(pw->pw_name, e->e_from.q_user) == 0 &&
+ !internal)
{
buildfname(pw->pw_gecos, e->e_from.q_user, buf);
if (buf[0] != '\0')
FullName = newstr(buf);
}
}
{
buildfname(pw->pw_gecos, e->e_from.q_user, buf);
if (buf[0] != '\0')
FullName = newstr(buf);
}
}
+ if (FullName != NULL && !internal)
define('x', FullName, e);
}
define('x', FullName, e);
}
{
if (e->e_from.q_home == NULL)
e->e_from.q_home = getenv("HOME");
{
if (e->e_from.q_home == NULL)
e->e_from.q_home = getenv("HOME");
rewrite(pvp, 3);
rewrite(pvp, 1);
rewrite(pvp, 4);
rewrite(pvp, 3);
rewrite(pvp, 1);
rewrite(pvp, 4);
-
- define('f', e->e_from.q_paddr, e);
+ cataddr(pvp, buf, sizeof buf, '\0');
+ e->e_sender = newstr(buf);
+ define('f', e->e_sender, e);
/* save the domain spec if this mailer wants it */
/* save the domain spec if this mailer wants it */
- if (e->e_from.q_mailer != NULL &&
+ if (!internal && e->e_from.q_mailer != NULL &&
bitnset(M_CANONICAL, e->e_from.q_mailer->m_flags))
{
extern char **copyplist();
bitnset(M_CANONICAL, e->e_from.q_mailer->m_flags))
{
extern char **copyplist();
-static char sccsid[] = "@(#)headers.c 6.20 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c 6.21 (Berkeley) %G%";
#endif /* not lint */
# include <errno.h>
#endif /* not lint */
# include <errno.h>
** Set up macros for possible expansion in headers.
*/
** Set up macros for possible expansion in headers.
*/
- define('f', e->e_from.q_paddr, e);
- define('g', e->e_from.q_paddr, e);
+ define('f', e->e_sender, e);
+ define('g', e->e_sender, e);
if (tTd(32, 1))
printf("----- collected header -----\n");
if (tTd(32, 1))
printf("----- collected header -----\n");
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 6.39 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 6.40 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
- setsender(from, CurEnv, NULL);
+ setsender(from, CurEnv, NULL, FALSE);
if (*av == NULL && !GrabTo)
{
if (*av == NULL && !GrabTo)
{
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 6.29 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 6.30 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 6.29 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 6.30 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
register char *p;
MAILER nullmailer;
ADDRESS *lastctladdr;
register char *p;
MAILER nullmailer;
ADDRESS *lastctladdr;
- static ADDRESS *nullctladdr = NULL;
char buf[MAXLINE], tf[MAXLINE];
extern char *macvalue();
extern ADDRESS *getctladdr();
char buf[MAXLINE], tf[MAXLINE];
extern char *macvalue();
extern ADDRESS *getctladdr();
- /*
- ** If we don't have nullctladdr, create one
- */
-
- if (nullctladdr == NULL)
- {
- nullctladdr = (ADDRESS *) xalloc(sizeof *nullctladdr);
- bzero((char *) nullctladdr, sizeof nullctladdr);
- }
-
/*
** Create control file.
*/
/*
** Create control file.
*/
ADDRESS *ctladdr;
ctladdr = getctladdr(q);
ADDRESS *ctladdr;
ctladdr = getctladdr(q);
- if (ctladdr == NULL && q->q_alias != NULL)
- ctladdr = nullctladdr;
if (ctladdr != lastctladdr)
{
printctladdr(ctladdr, tfp);
if (ctladdr != lastctladdr)
{
printctladdr(ctladdr, tfp);
ADDRESS *ctladdr;
ctladdr = getctladdr(q);
ADDRESS *ctladdr;
ctladdr = getctladdr(q);
- if (ctladdr == NULL && q->q_alias != NULL)
- ctladdr = nullctladdr;
if (ctladdr != lastctladdr)
{
printctladdr(ctladdr, tfp);
if (ctladdr != lastctladdr)
{
printctladdr(ctladdr, tfp);
break;
case 'S': /* sender */
break;
case 'S': /* sender */
- setsender(newstr(&bp[1]), e, NULL);
+ setsender(newstr(&bp[1]), e, NULL, TRUE);
break;
case 'D': /* data file name */
break;
case 'D': /* data file name */
*/
if (user == NULL || *user == '\0')
*/
if (user == NULL || *user == '\0')
/*
** Set up addr fields for controlling user.
/*
** Set up addr fields for controlling user.
-static char sccsid[] = "@(#)savemail.c 6.22 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 6.23 (Berkeley) %G%";
#endif /* not lint */
# include <pwd.h>
#endif /* not lint */
# include <pwd.h>
returndepth--;
return (-1);
}
returndepth--;
return (-1);
}
+ ee->e_sender = ee->e_from.q_paddr;
/* push state into submessage */
CurEnv = ee;
/* push state into submessage */
CurEnv = ee;
-static char sccsid[] = "@(#)srvrsmtp.c 6.24 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 6.25 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)srvrsmtp.c 6.24 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 6.25 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
/* must parse sender first */
delimptr = NULL;
/* must parse sender first */
delimptr = NULL;
- setsender(p, e, &delimptr);
+ setsender(p, e, &delimptr, FALSE);
p = delimptr;
if (p != NULL && *p != '\0')
*p++ = '\0';
p = delimptr;
if (p != NULL && *p != '\0')
*p++ = '\0';