]>
diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/uip/rcvpack.c
1 /* rcvpack.c - a rcvmail program to keep a copy */
3 static char ident
[] = "@(#)$Id: rcvpack.c,v 1.5 1993/08/25 17:27:19 jromine Exp $";
7 #include "../h/dropsbr.h"
8 #include "../h/rcvmail.h"
9 #include "../zotnet/tws.h"
10 #include "../zotnet/mts.h"
17 static struct swit switches
[] = {
42 setlocale(LC_ALL
, "");
44 invo_name
= r1bindex (argv
[0], '/');
46 if ((cp
= m_find (invo_name
)) != NULL
) {
47 ap
= brkstring (cp
= getcpy (cp
), " ", "\n");
48 ap
= copyip (ap
, arguments
);
52 (void) copyip (argv
+ 1, ap
);
57 while (cp
= *argp
++) {
59 switch (smatch (++cp
, switches
)) {
61 ambigsw (cp
, switches
);
64 adios (NULLCP
, "-%s unknown", cp
);
66 (void) sprintf (buf
, "%s [switches] file", invo_name
);
71 adios (NULLCP
, "only one file at a time!");
79 adios (NULLCP
, "%s [switches] file", invo_name
);
81 (void) sprintf (ddate
, "Delivery-Date: %s\n", dtimenow ());
83 if ((md
= mbx_open (file
, getuid (), getgid (), m_gmprot ())) == NOTOK
84 || mbx_copy (file
, md
, fileno (stdin
), 1, ddate
, 0) == NOTOK
85 || mbx_close (file
, md
) == NOTOK
) {
87 (void) mbx_close (file
, md
);