/* rcvpack.c - a rcvmail program to keep a copy */
static char ident
[] = "@(#)$Id: rcvpack.c,v 1.5 1993/08/25 17:27:19 jromine Exp $";
#include "../h/dropsbr.h"
#include "../h/rcvmail.h"
#include "../zotnet/tws.h"
#include "../zotnet/mts.h"
static struct swit switches
[] = {
invo_name
= r1bindex (argv
[0], '/');
if ((cp
= m_find (invo_name
)) != NULL
) {
ap
= brkstring (cp
= getcpy (cp
), " ", "\n");
ap
= copyip (ap
, arguments
);
(void) copyip (argv
+ 1, ap
);
switch (smatch (++cp
, switches
)) {
adios (NULLCP
, "-%s unknown", cp
);
(void) sprintf (buf
, "%s [switches] file", invo_name
);
adios (NULLCP
, "only one file at a time!");
adios (NULLCP
, "%s [switches] file", invo_name
);
(void) sprintf (ddate
, "Delivery-Date: %s\n", dtimenow ());
if ((md
= mbx_open (file
, getuid (), getgid (), m_gmprot ())) == NOTOK
|| mbx_copy (file
, md
, fileno (stdin
), 1, ddate
, 0) == NOTOK
|| mbx_close (file
, md
) == NOTOK
) {
(void) mbx_close (file
, md
);