summaryrefslogtreecommitdiff
path: root/src/qmail-pop3d.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmail-pop3d.c')
-rw-r--r--src/qmail-pop3d.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/qmail-pop3d.c b/src/qmail-pop3d.c
index bd46d7b..795bedc 100644
--- a/src/qmail-pop3d.c
+++ b/src/qmail-pop3d.c
@@ -2,6 +2,8 @@
#include <sys/types.h>
#include <unistd.h>
+#include <stdio.h>
+
#include "alloc.h"
#include "buffer.h"
#include "exit.h"
@@ -21,8 +23,6 @@
#define FDIN 0
#define FDOUT 1
-int rename(const char *, const char *); // stdio.h
-
void die()
{
_exit(0);
@@ -54,14 +54,17 @@ void out(char *buf, int len)
{
buffer_put(&bo, buf, len);
}
+
void outs(char *s)
{
buffer_puts(&bo, s);
}
+
void flush()
{
buffer_flush(&bo);
}
+
void err(char *s)
{
outs("-ERR ");
@@ -75,11 +78,13 @@ void die_nomem()
err("out of memory");
die();
}
+
void die_nomaildir()
{
err("this user has no $HOME/Maildir");
die();
}
+
void die_scan()
{
err("unable to scan $HOME/Maildir");
@@ -90,26 +95,32 @@ void err_syntax()
{
err("syntax error");
}
+
void err_unimpl()
{
err("unimplemented");
}
+
void err_deleted()
{
err("already deleted");
}
+
void err_nozero()
{
err("messages are counted from 1");
}
+
void err_toobig()
{
err("not that many messages");
}
+
void err_nosuch()
{
err("unable to open that message");
}
+
void err_nounlink()
{
err("unable to unlink all deleted messages");
@@ -233,7 +244,7 @@ void pop3_quit()
{
int i;
- for (i = 0; i < numm; ++i)
+ for (i = 0; i < numm; ++i) {
if (m[i].flagdeleted) {
if (unlink(m[i].fn) == -1) err_nounlink();
} else {
@@ -245,6 +256,7 @@ void pop3_quit()
rename(m[i].fn, line.s); /* if it fails, bummer */
}
}
+ }
okay();
die();
}
@@ -318,6 +330,7 @@ void pop3_uidl(char *arg)
{
dolisting(arg, 1);
}
+
void pop3_list(char *arg)
{
dolisting(arg, 0);