/*
** prototypes
*/
-int mbx_open(char *, uid_t, gid_t, mode_t);
-int mbx_copy(int, int);
-int mbx_close(char *, int);
+int mbox_open(char *, uid_t, gid_t, mode_t);
+int mbox_copy(int, int);
+int mbox_close(char *, int);
** a file or maildrop.
*/
int
-mbx_open(char *file, uid_t uid, gid_t gid, mode_t mode)
+mbox_open(char *file, uid_t uid, gid_t gid, mode_t mode)
{
int i, count, fd;
struct stat st;
** Append message to end of mbox.
*/
int
-mbx_copy(int to, int from)
+mbox_copy(int to, int from)
{
int i;
char buffer[BUFSIZ];
** Close and unlock file/maildrop.
*/
int
-mbx_close(char *mailbox, int md)
+mbox_close(char *mailbox, int md)
{
if (lkclose(md, mailbox) == 0)
return OK;
admonish(msgnam, "unable to read message");
break;
}
- if (mbx_copy(fileno(stdout), fd) == NOTOK) {
+ if (mbox_copy(fileno(stdout), fd) == NOTOK) {
adios(NULL, "error writing to stdout");
}
close(fd);
/* copy stdin to stdout, converting rfc822 message to mbox */
if (!file) {
- if (mbx_copy(fileno(stdout), fileno(stdin)) == NOTOK) {
+ if (mbox_copy(fileno(stdout), fileno(stdin)) == NOTOK) {
done(RCV_MBX);
}
done(RCV_MOK);
}
/* open and lock the file */
- if ((md = mbx_open(file, getuid(), getgid(), m_gmprot()))
+ if ((md = mbox_open(file, getuid(), getgid(), m_gmprot()))
== NOTOK)
done(RCV_MBX);
/* append the message */
- if (mbx_copy(md, fileno(stdin)) == NOTOK) {
- mbx_close(file, md);
+ if (mbox_copy(md, fileno(stdin)) == NOTOK) {
+ mbox_close(file, md);
done(RCV_MBX);
}
/* close and unlock the file */
- if (mbx_close(file, md) == NOTOK)
+ if (mbox_close(file, md) == NOTOK)
done(RCV_MBX);
done(RCV_MOK);
verbose_printf(" (mbox style)");
/* open and lock the file */
- if ((md = mbx_open(mailbox, pw->pw_uid, pw->pw_gid,
+ if ((md = mbox_open(mailbox, pw->pw_uid, pw->pw_gid,
m_gmprot())) == -1) {
if (verbose)
adorn("", "unable to open:");
lseek(fd, (off_t) 0, SEEK_SET);
/* append message to file */
- if (mbx_copy(md, fd) == -1) {
+ if (mbox_copy(md, fd) == -1) {
if (verbose)
adorn("", "error writing to:");
return -1;
}
/* close and unlock file */
- if (mbx_close(mailbox, md) == NOTOK) {
+ if (mbox_close(mailbox, md) == NOTOK) {
if (verbose)
adorn("", "error closing:");
return -1;