122704Sdist /*
234921Sbostic  * Copyright (c) 1983 Eric P. Allman
333729Sbostic  * Copyright (c) 1988 Regents of the University of California.
433729Sbostic  * All rights reserved.
533729Sbostic  *
642826Sbostic  * %sccs.include.redist.c%
733729Sbostic  */
822704Sdist 
922704Sdist #ifndef lint
10*58680Seric static char sccsid[] = "@(#)envelope.c	6.21 (Berkeley) 03/16/93";
1133729Sbostic #endif /* not lint */
1222704Sdist 
1358332Seric #include "sendmail.h"
1436928Sbostic #include <sys/time.h>
1536928Sbostic #include <sys/stat.h>
169536Seric #include <pwd.h>
1757737Seric #include <fcntl.h>
189536Seric 
199536Seric /*
209536Seric **  NEWENVELOPE -- allocate a new envelope
219536Seric **
229536Seric **	Supports inheritance.
239536Seric **
249536Seric **	Parameters:
259536Seric **		e -- the new envelope to fill in.
2658179Seric **		parent -- the envelope to be the parent of e.
279536Seric **
289536Seric **	Returns:
299536Seric **		e.
309536Seric **
319536Seric **	Side Effects:
329536Seric **		none.
339536Seric */
349536Seric 
359536Seric ENVELOPE *
3658179Seric newenvelope(e, parent)
379536Seric 	register ENVELOPE *e;
3858179Seric 	register ENVELOPE *parent;
399536Seric {
409536Seric 	extern putheader(), putbody();
4125611Seric 	extern ENVELOPE BlankEnvelope;
429536Seric 
4358179Seric 	if (e == parent && e->e_parent != NULL)
449536Seric 		parent = e->e_parent;
4525611Seric 	clearenvelope(e, TRUE);
4624944Seric 	if (e == CurEnv)
4724944Seric 		bcopy((char *) &NullAddress, (char *) &e->e_from, sizeof e->e_from);
4824944Seric 	else
4924944Seric 		bcopy((char *) &CurEnv->e_from, (char *) &e->e_from, sizeof e->e_from);
509536Seric 	e->e_parent = parent;
519536Seric 	e->e_ctime = curtime();
5256215Seric 	if (parent != NULL)
5356215Seric 		e->e_msgpriority = parent->e_msgsize;
549536Seric 	e->e_puthdr = putheader;
559536Seric 	e->e_putbody = putbody;
569536Seric 	if (CurEnv->e_xfp != NULL)
579536Seric 		(void) fflush(CurEnv->e_xfp);
589536Seric 
599536Seric 	return (e);
609536Seric }
619536Seric /*
629536Seric **  DROPENVELOPE -- deallocate an envelope.
639536Seric **
649536Seric **	Parameters:
659536Seric **		e -- the envelope to deallocate.
669536Seric **
679536Seric **	Returns:
689536Seric **		none.
699536Seric **
709536Seric **	Side Effects:
719536Seric **		housekeeping necessary to dispose of an envelope.
729536Seric **		Unlocks this queue file.
739536Seric */
749536Seric 
759536Seric dropenvelope(e)
769536Seric 	register ENVELOPE *e;
779536Seric {
789536Seric 	bool queueit = FALSE;
799536Seric 	register ADDRESS *q;
8057943Seric 	char *id = e->e_id;
819536Seric 
829536Seric 	if (tTd(50, 1))
839536Seric 	{
84*58680Seric 		printf("dropenvelope %x: id=", e);
859536Seric 		xputs(e->e_id);
86*58680Seric 		printf(", flags=%o\n", e->e_flags);
879536Seric 	}
8857943Seric 
89*58680Seric 	/* we must have an id to remove disk files */
9057943Seric 	if (id == NULL)
91*58680Seric 		return;
9257943Seric 
939536Seric #ifdef LOG
9458020Seric 	if (LogLevel > 84)
959536Seric 		syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=%o, pid=%d",
9657943Seric 				  id, e->e_flags, getpid());
9756795Seric #endif /* LOG */
989536Seric 
999536Seric 	/*
1009536Seric 	**  Extract state information from dregs of send list.
1019536Seric 	*/
1029536Seric 
1039536Seric 	for (q = e->e_sendqueue; q != NULL; q = q->q_next)
1049536Seric 	{
1059536Seric 		if (bitset(QQUEUEUP, q->q_flags))
1069536Seric 			queueit = TRUE;
1079536Seric 	}
1089536Seric 
1099536Seric 	/*
1109536Seric 	**  Send back return receipts as requested.
1119536Seric 	*/
1129536Seric 
1139536Seric 	if (e->e_receiptto != NULL && bitset(EF_SENDRECEIPT, e->e_flags))
1149536Seric 	{
11510844Seric 		auto ADDRESS *rlist = NULL;
1169536Seric 
11758082Seric 		(void) sendtolist(e->e_receiptto, (ADDRESS *) NULL, &rlist, e);
11855012Seric 		(void) returntosender("Return receipt", rlist, FALSE, e);
1199536Seric 	}
1209536Seric 
1219536Seric 	/*
1229536Seric 	**  Arrange to send error messages if there are fatal errors.
1239536Seric 	*/
1249536Seric 
12510754Seric 	if (bitset(EF_FATALERRS|EF_TIMEOUT, e->e_flags) && ErrorMode != EM_QUIET)
1269536Seric 		savemail(e);
1279536Seric 
1289536Seric 	/*
1299536Seric 	**  Instantiate or deinstantiate the queue.
1309536Seric 	*/
1319536Seric 
1329536Seric 	if ((!queueit && !bitset(EF_KEEPQUEUE, e->e_flags)) ||
1339536Seric 	    bitset(EF_CLRQUEUE, e->e_flags))
1349536Seric 	{
13523497Seric 		if (e->e_df != NULL)
13623497Seric 			xunlink(e->e_df);
1379536Seric 		xunlink(queuename(e, 'q'));
1389536Seric 	}
1399536Seric 	else if (queueit || !bitset(EF_INQUEUE, e->e_flags))
14010754Seric 	{
14110754Seric #ifdef QUEUE
14251920Seric 		queueup(e, FALSE, FALSE);
14356795Seric #else /* QUEUE */
14458151Seric 		syserr("554 dropenvelope: queueup");
14556795Seric #endif /* QUEUE */
14610754Seric 	}
1479536Seric 
1489536Seric 	/* now unlock the job */
14910196Seric 	closexscript(e);
1509536Seric 	unlockqueue(e);
1519536Seric 
1529536Seric 	/* make sure that this envelope is marked unused */
15324944Seric 	if (e->e_dfp != NULL)
154*58680Seric 		(void) xfclose(e->e_dfp, "dropenvelope", e->e_df);
15510196Seric 	e->e_dfp = NULL;
156*58680Seric 	e->e_id = e->e_df = NULL;
15757589Seric 
15857589Seric #ifdef LOG
15958020Seric 	if (LogLevel > 74)
16057943Seric 		syslog(LOG_INFO, "%s: done", id);
16157589Seric #endif /* LOG */
1629536Seric }
1639536Seric /*
1649536Seric **  CLEARENVELOPE -- clear an envelope without unlocking
1659536Seric **
1669536Seric **	This is normally used by a child process to get a clean
1679536Seric **	envelope without disturbing the parent.
1689536Seric **
1699536Seric **	Parameters:
1709536Seric **		e -- the envelope to clear.
17125611Seric **		fullclear - if set, the current envelope is total
17225611Seric **			garbage and should be ignored; otherwise,
17325611Seric **			release any resources it may indicate.
1749536Seric **
1759536Seric **	Returns:
1769536Seric **		none.
1779536Seric **
1789536Seric **	Side Effects:
1799536Seric **		Closes files associated with the envelope.
1809536Seric **		Marks the envelope as unallocated.
1819536Seric */
1829536Seric 
18325611Seric clearenvelope(e, fullclear)
1849536Seric 	register ENVELOPE *e;
18525611Seric 	bool fullclear;
1869536Seric {
18725514Seric 	register HDR *bh;
18825514Seric 	register HDR **nhp;
18925514Seric 	extern ENVELOPE BlankEnvelope;
19025514Seric 
19125611Seric 	if (!fullclear)
19225611Seric 	{
19325611Seric 		/* clear out any file information */
19425611Seric 		if (e->e_xfp != NULL)
195*58680Seric 			(void) xfclose(e->e_xfp, "clearenvelope xfp", e->e_id);
19625611Seric 		if (e->e_dfp != NULL)
197*58680Seric 			(void) xfclose(e->e_dfp, "clearenvelope dfp", e->e_df);
198*58680Seric 		e->e_xfp = e->e_dfp = NULL;
19925611Seric 	}
2009536Seric 
20124961Seric 	/* now clear out the data */
20224965Seric 	STRUCTCOPY(BlankEnvelope, *e);
20325514Seric 	bh = BlankEnvelope.e_header;
20425514Seric 	nhp = &e->e_header;
20525514Seric 	while (bh != NULL)
20625514Seric 	{
20725514Seric 		*nhp = (HDR *) xalloc(sizeof *bh);
20825514Seric 		bcopy((char *) bh, (char *) *nhp, sizeof *bh);
20925514Seric 		bh = bh->h_link;
21025514Seric 		nhp = &(*nhp)->h_link;
21125514Seric 	}
2129536Seric }
2139536Seric /*
2149536Seric **  INITSYS -- initialize instantiation of system
2159536Seric **
2169536Seric **	In Daemon mode, this is done in the child.
2179536Seric **
2189536Seric **	Parameters:
2199536Seric **		none.
2209536Seric **
2219536Seric **	Returns:
2229536Seric **		none.
2239536Seric **
2249536Seric **	Side Effects:
2259536Seric **		Initializes the system macros, some global variables,
2269536Seric **		etc.  In particular, the current time in various
2279536Seric **		forms is set.
2289536Seric */
2299536Seric 
23055012Seric initsys(e)
23155012Seric 	register ENVELOPE *e;
2329536Seric {
2339536Seric 	static char cbuf[5];			/* holds hop count */
2349536Seric 	static char pbuf[10];			/* holds pid */
23522963Smiriam #ifdef TTYNAME
2369536Seric 	static char ybuf[10];			/* holds tty id */
2379536Seric 	register char *p;
23856795Seric #endif /* TTYNAME */
2399536Seric 	extern char *ttyname();
2409536Seric 	extern char *macvalue();
2419536Seric 	extern char Version[];
2429536Seric 
2439536Seric 	/*
2449536Seric 	**  Give this envelope a reality.
2459536Seric 	**	I.e., an id, a transcript, and a creation time.
2469536Seric 	*/
2479536Seric 
24855012Seric 	openxscript(e);
24955012Seric 	e->e_ctime = curtime();
2509536Seric 
2519536Seric 	/*
2529536Seric 	**  Set OutChannel to something useful if stdout isn't it.
2539536Seric 	**	This arranges that any extra stuff the mailer produces
2549536Seric 	**	gets sent back to the user on error (because it is
2559536Seric 	**	tucked away in the transcript).
2569536Seric 	*/
2579536Seric 
25858069Seric 	if (OpMode == MD_DAEMON && QueueRun && e->e_xfp != NULL)
25955012Seric 		OutChannel = e->e_xfp;
2609536Seric 
2619536Seric 	/*
2629536Seric 	**  Set up some basic system macros.
2639536Seric 	*/
2649536Seric 
2659536Seric 	/* process id */
2669536Seric 	(void) sprintf(pbuf, "%d", getpid());
26755012Seric 	define('p', pbuf, e);
2689536Seric 
2699536Seric 	/* hop count */
27055012Seric 	(void) sprintf(cbuf, "%d", e->e_hopcount);
27155012Seric 	define('c', cbuf, e);
2729536Seric 
2739536Seric 	/* time as integer, unix time, arpa time */
27455012Seric 	settime(e);
2759536Seric 
27617472Seric #ifdef TTYNAME
2779536Seric 	/* tty name */
27855012Seric 	if (macvalue('y', e) == NULL)
2799536Seric 	{
2809536Seric 		p = ttyname(2);
2819536Seric 		if (p != NULL)
2829536Seric 		{
28356795Seric 			if (strrchr(p, '/') != NULL)
28456795Seric 				p = strrchr(p, '/') + 1;
2859536Seric 			(void) strcpy(ybuf, p);
28655012Seric 			define('y', ybuf, e);
2879536Seric 		}
2889536Seric 	}
28956795Seric #endif /* TTYNAME */
2909536Seric }
2919536Seric /*
29211932Seric **  SETTIME -- set the current time.
29311932Seric **
29411932Seric **	Parameters:
29511932Seric **		none.
29611932Seric **
29711932Seric **	Returns:
29811932Seric **		none.
29911932Seric **
30011932Seric **	Side Effects:
30111932Seric **		Sets the various time macros -- $a, $b, $d, $t.
30211932Seric */
30311932Seric 
30455012Seric settime(e)
30555012Seric 	register ENVELOPE *e;
30611932Seric {
30711932Seric 	register char *p;
30811932Seric 	auto time_t now;
30911932Seric 	static char tbuf[20];			/* holds "current" time */
31011932Seric 	static char dbuf[30];			/* holds ctime(tbuf) */
31111932Seric 	register struct tm *tm;
31211932Seric 	extern char *arpadate();
31311932Seric 	extern struct tm *gmtime();
31411932Seric 	extern char *macvalue();
31511932Seric 
31611932Seric 	now = curtime();
31711932Seric 	tm = gmtime(&now);
31857014Seric 	(void) sprintf(tbuf, "%04d%02d%02d%02d%02d", tm->tm_year + 1900,
31957014Seric 			tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min);
32055012Seric 	define('t', tbuf, e);
32111932Seric 	(void) strcpy(dbuf, ctime(&now));
32258131Seric 	p = strchr(dbuf, '\n');
32358131Seric 	if (p != NULL)
32458131Seric 		*p = '\0';
32558131Seric 	define('d', dbuf, e);
32611932Seric 	p = newstr(arpadate(dbuf));
32755012Seric 	if (macvalue('a', e) == NULL)
32855012Seric 		define('a', p, e);
32955012Seric 	define('b', p, e);
33011932Seric }
33111932Seric /*
3329536Seric **  OPENXSCRIPT -- Open transcript file
3339536Seric **
3349536Seric **	Creates a transcript file for possible eventual mailing or
3359536Seric **	sending back.
3369536Seric **
3379536Seric **	Parameters:
3389536Seric **		e -- the envelope to create the transcript in/for.
3399536Seric **
3409536Seric **	Returns:
3419536Seric **		none
3429536Seric **
3439536Seric **	Side Effects:
3449536Seric **		Creates the transcript file.
3459536Seric */
3469536Seric 
3479536Seric openxscript(e)
3489536Seric 	register ENVELOPE *e;
3499536Seric {
3509536Seric 	register char *p;
35140933Srick 	int fd;
3529536Seric 
3539536Seric 	if (e->e_xfp != NULL)
3549536Seric 		return;
3559536Seric 	p = queuename(e, 'x');
35640933Srick 	fd = open(p, O_WRONLY|O_CREAT, 0644);
35740933Srick 	if (fd < 0)
3589536Seric 		syserr("Can't create %s", p);
3599536Seric 	else
36040933Srick 		e->e_xfp = fdopen(fd, "w");
3619536Seric }
3629536Seric /*
36310196Seric **  CLOSEXSCRIPT -- close the transcript file.
36410196Seric **
36510196Seric **	Parameters:
36610196Seric **		e -- the envelope containing the transcript to close.
36710196Seric **
36810196Seric **	Returns:
36910196Seric **		none.
37010196Seric **
37110196Seric **	Side Effects:
37210196Seric **		none.
37310196Seric */
37410196Seric 
37510196Seric closexscript(e)
37610196Seric 	register ENVELOPE *e;
37710196Seric {
37810196Seric 	if (e->e_xfp == NULL)
37910196Seric 		return;
380*58680Seric 	(void) xfclose(e->e_xfp, "closexscript", e->e_id);
38110196Seric 	e->e_xfp = NULL;
38210196Seric }
38310196Seric /*
3849536Seric **  SETSENDER -- set the person who this message is from
3859536Seric **
3869536Seric **	Under certain circumstances allow the user to say who
3879536Seric **	s/he is (using -f or -r).  These are:
3889536Seric **	1.  The user's uid is zero (root).
3899536Seric **	2.  The user's login name is in an approved list (typically
3909536Seric **	    from a network server).
3919536Seric **	3.  The address the user is trying to claim has a
3929536Seric **	    "!" character in it (since #2 doesn't do it for
3939536Seric **	    us if we are dialing out for UUCP).
3949536Seric **	A better check to replace #3 would be if the
3959536Seric **	effective uid is "UUCP" -- this would require me
3969536Seric **	to rewrite getpwent to "grab" uucp as it went by,
3979536Seric **	make getname more nasty, do another passwd file
3989536Seric **	scan, or compile the UID of "UUCP" into the code,
3999536Seric **	all of which are reprehensible.
4009536Seric **
4019536Seric **	Assuming all of these fail, we figure out something
4029536Seric **	ourselves.
4039536Seric **
4049536Seric **	Parameters:
4059536Seric **		from -- the person we would like to believe this message
4069536Seric **			is from, as specified on the command line.
40753182Seric **		e -- the envelope in which we would like the sender set.
40858333Seric **		delimptr -- if non-NULL, set to the location of the
40958333Seric **			trailing delimiter.
4109536Seric **
4119536Seric **	Returns:
41258333Seric **		pointer to the delimiter terminating the from address.
4139536Seric **
4149536Seric **	Side Effects:
4159536Seric **		sets sendmail's notion of who the from person is.
4169536Seric */
4179536Seric 
41858333Seric char *
41958333Seric setsender(from, e, delimptr)
4209536Seric 	char *from;
42153182Seric 	register ENVELOPE *e;
42258333Seric 	char **delimptr;
4239536Seric {
4249536Seric 	register char **pvp;
4259536Seric 	char *realname = NULL;
42618665Seric 	register struct passwd *pw;
42758333Seric 	char *delimchar = NULL;
4289536Seric 	char buf[MAXNAME];
42916913Seric 	char pvpbuf[PSBUFSIZE];
43018665Seric 	extern struct passwd *getpwnam();
4319536Seric 	extern char *macvalue();
4329536Seric 	extern char **prescan();
4339536Seric 	extern char *FullName;
4349536Seric 
4359536Seric 	if (tTd(45, 1))
43614786Seric 		printf("setsender(%s)\n", from == NULL ? "" : from);
4379536Seric 
4389536Seric 	/*
4399536Seric 	**  Figure out the real user executing us.
4409536Seric 	**	Username can return errno != 0 on non-errors.
4419536Seric 	*/
4429536Seric 
44352220Seric 	if (QueueRun || OpMode == MD_SMTP)
4449536Seric 		realname = from;
4459536Seric 	if (realname == NULL || realname[0] == '\0')
4469536Seric 	{
4479536Seric 		extern char *username();
4489536Seric 
4499536Seric 		realname = username();
4509536Seric 	}
4519536Seric 
45257589Seric /*
4539536Seric 	SuprErrs = TRUE;
45457589Seric */
45558333Seric 	if (from == NULL ||
45658333Seric 	    parseaddr(from, &e->e_from, 1, ' ', delimptr, e) == NULL)
4579536Seric 	{
45821750Seric 		/* log garbage addresses for traceback */
45955173Seric # ifdef LOG
46058020Seric 		if (from != NULL && LogLevel > 2)
46121750Seric 		{
46255173Seric 			char *host = RealHostName;
46355173Seric 
46455173Seric 			if (host == NULL)
46555173Seric 				host = MyHostName;
46655173Seric 			syslog(LOG_NOTICE,
46755173Seric 				"from=%s unparseable, received from %s@%s",
46855173Seric 				from, realname, host);
46955173Seric 		}
47056795Seric # endif /* LOG */
47157589Seric 		if (from != NULL)
47257589Seric 			SuprErrs = TRUE;
47357589Seric 		if (from == realname ||
47458333Seric 		    parseaddr(from = newstr(realname), &e->e_from, 1, ' ', NULL, e) == NULL)
47524944Seric 		{
47657589Seric 			SuprErrs = TRUE;
47758333Seric 			if (parseaddr("postmaster", &e->e_from, 1, ' ', NULL, e) == NULL)
47858151Seric 				syserr("553 setsender: can't even parse postmaster!");
47924944Seric 		}
4809536Seric 	}
4819536Seric 	else
4829536Seric 		FromFlag = TRUE;
48353182Seric 	e->e_from.q_flags |= QDONTSEND;
48457731Seric 	if (tTd(45, 5))
48557731Seric 	{
48657731Seric 		printf("setsender: QDONTSEND ");
48757731Seric 		printaddr(&e->e_from, FALSE);
48857731Seric 	}
4899536Seric 	SuprErrs = FALSE;
4909536Seric 
49153736Seric 	pvp = NULL;
49253736Seric 	if (e->e_from.q_mailer == LocalMailer)
4939536Seric 	{
49453736Seric # ifdef USERDB
49553736Seric 		register char *p;
49653736Seric 		extern char *udbsender();
49753736Seric # endif
49817472Seric 
4999536Seric 		/* if the user has given fullname already, don't redefine */
5009536Seric 		if (FullName == NULL)
50153182Seric 			FullName = macvalue('x', e);
50211932Seric 		if (FullName != NULL && FullName[0] == '\0')
5039536Seric 			FullName = NULL;
5049536Seric 
50553736Seric # ifdef USERDB
50653736Seric 		p = udbsender(from);
50753736Seric 
50853736Seric 		if (p != NULL)
5099536Seric 		{
51053736Seric 			/*
51153736Seric 			**  We have an alternate address for the sender
51253736Seric 			*/
51353736Seric 
51458333Seric 			pvp = prescan(p, '\0', pvpbuf, NULL);
5159536Seric 		}
51653736Seric # endif /* USERDB */
51753736Seric 
51853736Seric 		if ((pw = getpwnam(e->e_from.q_user)) != NULL)
51953736Seric 		{
52053736Seric 			/*
52153736Seric 			**  Process passwd file entry.
52253736Seric 			*/
52353736Seric 
52453736Seric 
52553736Seric 			/* extract home directory */
52653736Seric 			e->e_from.q_home = newstr(pw->pw_dir);
52753736Seric 			define('z', e->e_from.q_home, e);
52853736Seric 
52953736Seric 			/* extract user and group id */
53053736Seric 			e->e_from.q_uid = pw->pw_uid;
53153736Seric 			e->e_from.q_gid = pw->pw_gid;
53253736Seric 
53353736Seric 			/* extract full name from passwd file */
53453736Seric 			if (FullName == NULL && pw->pw_gecos != NULL &&
53553736Seric 			    strcmp(pw->pw_name, e->e_from.q_user) == 0)
53653736Seric 			{
53753736Seric 				buildfname(pw->pw_gecos, e->e_from.q_user, buf);
53853736Seric 				if (buf[0] != '\0')
53953736Seric 					FullName = newstr(buf);
54053736Seric 			}
54153736Seric 		}
5429536Seric 		if (FullName != NULL)
54353182Seric 			define('x', FullName, e);
5449536Seric 	}
54511625Seric 	else
54611625Seric 	{
54753182Seric 		if (e->e_from.q_home == NULL)
54853182Seric 			e->e_from.q_home = getenv("HOME");
54953182Seric 		e->e_from.q_uid = getuid();
55053182Seric 		e->e_from.q_gid = getgid();
55111625Seric 	}
55211625Seric 
5539536Seric 	/*
5549536Seric 	**  Rewrite the from person to dispose of possible implicit
5559536Seric 	**	links in the net.
5569536Seric 	*/
5579536Seric 
5589536Seric 	if (pvp == NULL)
55958333Seric 		pvp = prescan(from, '\0', pvpbuf, NULL);
56053736Seric 	if (pvp == NULL)
5619536Seric 	{
56258403Seric 		/* don't need to give error -- prescan did that already */
56336233Skarels # ifdef LOG
56458020Seric 		if (LogLevel > 2)
56536233Skarels 			syslog(LOG_NOTICE, "cannot prescan from (%s)", from);
56636233Skarels # endif
5679536Seric 		finis();
5689536Seric 	}
5699536Seric 	rewrite(pvp, 3);
5709536Seric 	rewrite(pvp, 1);
57125032Seric 	rewrite(pvp, 4);
5729536Seric 
573*58680Seric 	define('f', e->e_from.q_paddr, e);
57451951Seric 
5759536Seric 	/* save the domain spec if this mailer wants it */
57653182Seric 	if (e->e_from.q_mailer != NULL &&
57753182Seric 	    bitnset(M_CANONICAL, e->e_from.q_mailer->m_flags))
5789536Seric 	{
5799536Seric 		extern char **copyplist();
5809536Seric 
5819536Seric 		while (*pvp != NULL && strcmp(*pvp, "@") != 0)
5829536Seric 			pvp++;
5839536Seric 		if (*pvp != NULL)
58453182Seric 			e->e_fromdomain = copyplist(pvp, TRUE);
5859536Seric 	}
5869536Seric }
587