rmail.c (182352) | rmail.c (249729) |
---|---|
1/* 2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1988, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * By using this file, you agree to the terms and conditions set 8 * forth in the LICENSE file which can be found at the top level of 9 * the sendmail distribution. 10 * | 1/* 2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1988, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * By using this file, you agree to the terms and conditions set 8 * forth in the LICENSE file which can be found at the top level of 9 * the sendmail distribution. 10 * |
11 * $FreeBSD: head/contrib/sendmail/rmail/rmail.c 182352 2008-08-28 06:08:29Z gshapiro $ | 11 * $FreeBSD: head/contrib/sendmail/rmail/rmail.c 249729 2013-04-21 17:08:44Z gshapiro $ |
12 * 13 */ 14 15#include <sm/gen.h> 16 17SM_IDSTR(copyright, 18"@(#) Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.\n\ 19 All rights reserved.\n\ 20 Copyright (c) 1988, 1993\n\ 21 The Regents of the University of California. All rights reserved.\n") 22 | 12 * 13 */ 14 15#include <sm/gen.h> 16 17SM_IDSTR(copyright, 18"@(#) Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.\n\ 19 All rights reserved.\n\ 20 Copyright (c) 1988, 1993\n\ 21 The Regents of the University of California. All rights reserved.\n") 22 |
23SM_IDSTR(id, "@(#)$Id: rmail.c,v 8.61 2001/09/18 21:45:29 gshapiro Exp $") | 23SM_IDSTR(id, "@(#)$Id: rmail.c,v 8.62 2013/03/12 15:24:52 ca Exp $") |
24 25/* 26 * RMAIL -- UUCP mail server. 27 * 28 * This program reads the >From ... remote from ... lines that UUCP is so 29 * fond of and turns them into something reasonable. It then execs sendmail 30 * with various options built from these lines. 31 * --- 99 unchanged lines hidden (view full) --- 131 if (argc < 1) 132 usage(); 133 134 from_path = from_sys = from_user = NULL; 135 for (offset = 0; ; ) 136 { 137 /* Get and nul-terminate the line. */ 138 if (sm_io_fgets(smioin, SM_TIME_DEFAULT, lbuf, | 24 25/* 26 * RMAIL -- UUCP mail server. 27 * 28 * This program reads the >From ... remote from ... lines that UUCP is so 29 * fond of and turns them into something reasonable. It then execs sendmail 30 * with various options built from these lines. 31 * --- 99 unchanged lines hidden (view full) --- 131 if (argc < 1) 132 usage(); 133 134 from_path = from_sys = from_user = NULL; 135 for (offset = 0; ; ) 136 { 137 /* Get and nul-terminate the line. */ 138 if (sm_io_fgets(smioin, SM_TIME_DEFAULT, lbuf, |
139 sizeof(lbuf)) == NULL) | 139 sizeof(lbuf)) < 0) |
140 err(EX_DATAERR, "no data"); 141 if ((p = strchr(lbuf, '\n')) == NULL) 142 err(EX_DATAERR, "line too long"); 143 *p = '\0'; 144 145 /* Parse lines until reach a non-"From" line. */ 146 if (!strncmp(lbuf, "From ", 5)) 147 addrp = lbuf + 5; --- 232 unchanged lines hidden (view full) --- 380 err(EX_OSERR, "sm_io_open failed"); 381 (void) close(pdes[0]); 382 383 /* Copy the file down the pipe. */ 384 do 385 { 386 (void) sm_io_fprintf(fp, SM_TIME_DEFAULT, "%s", lbuf); 387 } while (sm_io_fgets(smioin, SM_TIME_DEFAULT, lbuf, | 140 err(EX_DATAERR, "no data"); 141 if ((p = strchr(lbuf, '\n')) == NULL) 142 err(EX_DATAERR, "line too long"); 143 *p = '\0'; 144 145 /* Parse lines until reach a non-"From" line. */ 146 if (!strncmp(lbuf, "From ", 5)) 147 addrp = lbuf + 5; --- 232 unchanged lines hidden (view full) --- 380 err(EX_OSERR, "sm_io_open failed"); 381 (void) close(pdes[0]); 382 383 /* Copy the file down the pipe. */ 384 do 385 { 386 (void) sm_io_fprintf(fp, SM_TIME_DEFAULT, "%s", lbuf); 387 } while (sm_io_fgets(smioin, SM_TIME_DEFAULT, lbuf, |
388 sizeof(lbuf)) != NULL); | 388 sizeof(lbuf)) >= 0); |
389 390 if (sm_io_error(smioin)) 391 err(EX_TEMPFAIL, "stdin: %s", sm_errstring(errno)); 392 393 if (sm_io_close(fp, SM_TIME_DEFAULT)) 394 err(EX_OSERR, "sm_io_close failed"); 395 396 if ((waitpid(pid, &status, 0)) == -1) --- 43 unchanged lines hidden --- | 389 390 if (sm_io_error(smioin)) 391 err(EX_TEMPFAIL, "stdin: %s", sm_errstring(errno)); 392 393 if (sm_io_close(fp, SM_TIME_DEFAULT)) 394 err(EX_OSERR, "sm_io_close failed"); 395 396 if ((waitpid(pid, &status, 0)) == -1) --- 43 unchanged lines hidden --- |