Deleted Added
sdiff udiff text old ( 203004 ) new ( 244833 )
full compact
1/*
2 * Copyright (c) 1998-2003, 2006 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#include <sendmail.h>
15
16SM_RCSID("@(#)$Id: savemail.c,v 8.314 2009/12/18 17:08:01 ca Exp $")
17
18static bool errbody __P((MCI *, ENVELOPE *, char *));
19static bool pruneroute __P((char *));
20
21/*
22** SAVEMAIL -- Save mail on error
23**
24** If mailing back errors, mail it back to the originator

--- 476 unchanged lines hidden (view full) ---

501
502int
503returntosender(msg, returnq, flags, e)
504 char *msg;
505 ADDRESS *returnq;
506 int flags;
507 register ENVELOPE *e;
508{
509 register ENVELOPE *ee;
510 ENVELOPE *oldcur = CurEnv;
511 ENVELOPE errenvelope;
512 static int returndepth = 0;
513 register ADDRESS *q;
514 char *p;
515 char buf[MAXNAME + 1];
516

--- 181 unchanged lines hidden (view full) ---

698 macdefine(&ee->e_macro, A_PERM, 'x', "Mail Delivery Subsystem");
699 eatheader(ee, true, true);
700
701 /* mark statistics */
702 markstats(ee, NULLADDR, STATS_NORMAL);
703
704 /* actually deliver the error message */
705 sendall(ee, SM_DELIVER);
706
707 /* restore state */
708 (void) dropenvelope(ee, true, false);
709 sm_rpool_free(ee->e_rpool);
710 CurEnv = oldcur;
711 returndepth--;
712
713 /* check for delivery errors */
714 if (ee->e_parent == NULL ||
715 !bitset(EF_RESPONSE, ee->e_parent->e_flags))
716 return 0;
717 for (q = ee->e_sendqueue; q != NULL; q = q->q_next)
718 {
719 if (QS_IS_ATTEMPTED(q->q_state))
720 return 0;
721 }
722 return -1;
723}
724/*
725** ERRBODY -- output the body of an error message.
726**
727** Typically this is a copy of the transcript plus a copy of the
728** original offending message.
729**
730** Parameters:
731** mci -- the mailer connection information.

--- 1030 unchanged lines hidden ---