File: reject-backend.c

package info (click to toggle)
mailfront 0.98-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 648 kB
  • ctags: 495
  • sloc: ansic: 3,033; sh: 1,487; makefile: 78
file content (72 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <stdlib.h>
#include <unistd.h>
#include "mailfront.h"
#include "responses.h"

static response resp = {451,"You are not allowed to use this mail server."};

int authenticated = 0;
const int authenticating = 0;
unsigned long maxdatabytes = 0;
const char* relayclient = "";
const char UNKNOWN[] = "unknown";

const response* handle_init(void)
{
  return 0;
}

const response* handle_reset(void)
{
  return 0;
}

const response* handle_sender(str* unused)
{
  return &resp;
  (void)unused;
}

const response* handle_recipient(str* unused)
{
  return &resp;
  (void)unused;
}

const response* handle_data_start(const char* unused1, const char* unused2)
{
  return &resp;
  (void)unused1;
  (void)unused2;
}

void handle_data_bytes(const char* unused1, unsigned unused2)
{
  (void)unused1;
  (void)unused2;
}

const response* handle_data_end(void)
{
  return &resp;
}

extern int mainloop(void);

int main(int argc, char* argv[])
{
  const char* sr;
  if ((sr = getenv("SMTPREJECT")) != 0) {
    if (sr[0] == '-') {
      ++sr;
      resp.number = 553;
    }
    resp.message = sr;
    return mainloop();
  }
  else {
    execvp(argv[1], argv+1);
    return 1;
  }
  (void)argc;
}