/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
#pragma ident "%Z%%M% %I% %E% SMI"
#include "mail.h"
/*
* NAME
* sendlist - send copy to specified users
*
* SYNOPSIS
* int sendlist(reciplist *list, int letnum, int level)
*
* DESCRIPTION
* sendlist() will traverse the current recipient list and
* send a copy of the given letter to each user specified,
* invoking send() to do the sending. It returns
* 1 if the sending fails, 0 otherwise.
*/
/*
* mailx and mailtool read the SENDMAIL from an environment, since few
* called as root or made setuid it's safer to leave this hardwired.
*/
static void notifybiff(char *);
int
{
int rc = 0;
char **argv;
char **p;
/* Deliver mail directly to a mailbox */
if (deliverflag) {
/*
* Note failure to deliver to any one of the recipients
* should be considered a failure, so that the user
* get's an indication of that failure.
*/
rc = 1;
}
return (rc);
}
/*
* build argv list, allowing for arbitrarily long deliver lists
* and then hand the message off to sendmail
*/
if (!ismail)
nargs++;
return (1);
p = argv;
*p++ = sendmail_prog;
/* If we're rmail add "-f", "Rpath" to the the command line */
if (!ismail) {
*p++ = "-f";
*p++ = Rpath;
}
*p++ = "-oi";
*p++ = "--"; /* extra protection: end of argument list */
*p = NULL;
return (1);
if (!rc)
return (0);
else
return (1);
}
/*
* send_mbox(user, letnum) Sends the letter specified by letnum to the
* "user"'s mailbox. It returns 1 if the sending fails;
* 0 on success.
*/
int
{
int mbfd;
int rc;
return (1);
goto done;
}
/*
* We need to setgid and seteuid here since the users's mail box
* might be NFS mounted and since root can't write across NFS.
* NFS mounted directories isn't really supported that's OK for now.
*/
/* ignore signals */
/* now access mail box */
unlock();
goto done;
} else {
/* mail box is ok, now do append */
}
}
else
done:
/* restore signal */
unlock();
return (rc);
}
static void
{
static int f = -1;
if (addr.sin_family == 0) {
}
if (f < 0)
sizeof (addr));
}