summaryrefslogtreecommitdiff
path: root/src/qreceipt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qreceipt.c')
-rw-r--r--src/qreceipt.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/qreceipt.c b/src/qreceipt.c
index 6b629ba..ee9fc52 100644
--- a/src/qreceipt.c
+++ b/src/qreceipt.c
@@ -23,45 +23,54 @@ void die_noreceipt()
{
_exit(0);
}
+
void die()
{
_exit(100);
}
+
void die_temp()
{
_exit(111);
}
+
void die_nomem()
{
buffer_putsflush(buffer_2, "qreceipt: fatal: out of memory\n");
die_temp();
}
+
void die_fork()
{
buffer_putsflush(buffer_2, "qreceipt: fatal: unable to fork\n");
die_temp();
}
+
void die_qqperm()
{
buffer_putsflush(buffer_2, "qreceipt: fatal: permanent qmail-queue error\n");
die();
}
+
void die_qqtemp()
{
buffer_putsflush(buffer_2, "qreceipt: fatal: temporary qmail-queue error\n");
die_temp();
}
+
void die_usage()
{
buffer_putsflush(buffer_2, "qreceipt: usage: qreceipt deliveryaddress\n");
die();
}
+
void die_read()
{
if (errno == ENOMEM) die_nomem();
buffer_putsflush(buffer_2, "qreceipt: fatal: read error\n");
die_temp();
}
+
void doordie(sa, r) stralloc *sa;
int r;
{
@@ -114,10 +123,9 @@ void finishheader()
qmail_puts(&qqt, ">\n");
qmail_puts(
&qqt,
- "Subject: success notice\n\
-\n\
-Hi! This is the qreceipt program. Your message was delivered to the\n\
-following address: ");
+ "Subject: success notice\n\n"
+ "Hi! This is the qreceipt program. Your message was delivered to the\n"
+ "following address: ");
qmail_puts(&qqt, target);
qmail_puts(&qqt, ". Thanks for asking.\n");
if (messageid.s) {
@@ -129,11 +137,12 @@ following address: ");
qmail_to(&qqt, returnpath);
qqx = qmail_close(&qqt);
- if (*qqx)
+ if (*qqx) {
if (*qqx == 'D')
die_qqperm();
else
die_qqtemp();
+ }
}
stralloc hfbuf = {0};
@@ -154,10 +163,7 @@ void doheaderfield(stralloc *h)
}
}
-void dobody(stralloc *h)
-{
- ;
-}
+void dobody(stralloc *h) {}
int main(int argc, char **argv)
{