defer_ok was not working if used on a callout with verify=header_sender.
[exim.git] / src / src / local_scan.h
CommitLineData
c988f1f4 1/* $Cambridge: exim/src/src/local_scan.h,v 1.3 2005/01/04 10:00:42 ph10 Exp $ */
059ec3d9
PH
2
3/*************************************************
4* Exim - an Internet mail transport agent *
5*************************************************/
6
c988f1f4 7/* Copyright (c) University of Cambridge 1995 - 2005 */
059ec3d9
PH
8/* See the file NOTICE for conditions of use and distribution. */
9
10/* This file is the header that is the only Exim header to be included in the
11source for the local_scan.c() function. It contains definitions that are made
12available for use in that function, and which are documented. */
13
14
15/* Some basic types that make some things easier, and the store functions. */
16
17#include <sys/types.h>
18#include "mytypes.h"
19#include "store.h"
20
21
22/* The function and its return codes. */
23
24extern int local_scan(int, uschar **);
25
26enum {
27 LOCAL_SCAN_ACCEPT, /* Accept */
28 LOCAL_SCAN_ACCEPT_FREEZE, /* Accept, but freeze */
29 LOCAL_SCAN_ACCEPT_QUEUE, /* Accept, but no immediate delivery */
30 LOCAL_SCAN_REJECT, /* Permanent rejection */
31 LOCAL_SCAN_REJECT_NOLOGHDR, /* Permanent rejection, no log header */
32 LOCAL_SCAN_TEMPREJECT, /* Temporary rejection */
33 LOCAL_SCAN_TEMPREJECT_NOLOGHDR /* Temporary rejection, no log header */
34};
35
36
37/* Return codes from the support functions lss_match_xxx(). */
38
39#define OK 0 /* Successful match */
40#define DEFER 1 /* Defer - some problem */
41#define FAIL 2 /* Matching failed */
42#define ERROR 3 /* Internal or config error */
43
44
45/* Available logging destinations */
46
47#define LOG_MAIN 1 /* Write to the main log */
48#define LOG_PANIC 2 /* Write to the panic log */
49#define LOG_REJECT 16 /* Write to the reject log, with headers */
50
51
52/* Accessible debugging bits */
53
54#define D_v 0x00000001
55#define D_local_scan 0x00000002
56
57
58/* Option types that can be used for local_scan_options. The boolean ones
59MUST be last so that they are contiguous with the internal boolean specials. */
60
61enum { opt_stringptr, opt_int, opt_octint, opt_mkint, opt_Kint, opt_fixed,
62 opt_time, opt_bool };
63
64
65/* The length of message identification strings. This is the id used internally
66by exim. The external version for use in Received: strings has a leading 'E'
67added to ensure it starts with a letter. */
68
69#define MESSAGE_ID_LENGTH 16
70
71/* The offset to the start of the data in the data file - this allows for
72the name of the data file to be present in the first line. */
73
74#define SPOOL_DATA_START_OFFSET (MESSAGE_ID_LENGTH+3)
75
76/* Some people (Marc Merlin et al) are maintaining a patch that allows for
77dynamic local_scan() libraries. This code is not yet in Exim proper, but it
78helps the maintainers if we keep their ABI version numbers here. This may
79mutate into more general support later. The major number is increased when the
80ABI is changed in a non backward compatible way. The minor number is increased
81each time a new feature is added (in a way that doesn't break backward
82compatibility). */
83
84#define LOCAL_SCAN_ABI_VERSION_MAJOR 1
85#define LOCAL_SCAN_ABI_VERSION_MINOR 0
86
87/* Structure definitions that are documented as visible in the function. */
88
89typedef struct header_line {
90 struct header_line *next;
91 int type;
92 int slen;
93 uschar *text;
94} header_line;
95
96/* Entries in lists options are in this form. */
97
98typedef struct {
99 char *name;
100 int type;
101 void *value;
102} optionlist;
103
104/*Structure for holding information about an envelope address. The errors_to
105field is always NULL except for one_time aliases that had errors_to on the
106routers that generated them. */
107
108typedef struct recipient_item {
109 uschar *address; /* the recipient address */
110 int pno; /* parent number for "one_time" alias, or -1 */
111 uschar *errors_to; /* the errors_to address or NULL */
8523533c
TK
112#ifdef EXPERIMENTAL_BRIGHTMAIL
113 uschar *bmi_optin;
114#endif
059ec3d9
PH
115} recipient_item;
116
117
118/* Global variables that are documented as visible in the function. */
119
120extern unsigned int debug_selector; /* Debugging bits */
121
122extern uschar *expand_string_message; /* Error info for failing expansion */
123extern uschar *headers_charset; /* Charset for RFC 2047 decoding */
124extern header_line *header_last; /* Final header */
125extern header_line *header_list; /* First header */
126extern BOOL host_checking; /* Set when checking a host */
127extern uschar *interface_address; /* Interface for incoming call */
128extern int interface_port; /* Port number for incoming call */
129extern uschar *message_id; /* Internal id of message being handled */
130extern uschar *received_protocol; /* Name of incoming protocol */
131extern int recipients_count; /* Number of recipients */
132extern recipient_item *recipients_list;/* List of recipient addresses */
133extern unsigned char *sender_address; /* Sender address */
134extern uschar *sender_host_address; /* IP address of sender, as chars */
135extern uschar *sender_host_authenticated; /* Name of authentication mechanism */
136extern uschar *sender_host_name; /* Host name from lookup */
137extern int sender_host_port; /* Port number of sender */
138extern BOOL smtp_batched_input; /* TRUE if SMTP batch (no interaction) */
139extern BOOL smtp_input; /* TRUE if input is via SMTP */
140
141
142/* Functions that are documented as visible in local_scan(). */
143
144extern int child_close(pid_t, int);
145extern pid_t child_open(uschar **, uschar **, int, int *, int *, BOOL);
146extern pid_t child_open_exim(int *);
147extern void debug_printf(char *, ...) PRINTF_FUNCTION;
148extern uschar *expand_string(uschar *);
149extern void header_add(int, char *, ...);
150extern void header_add_at_position(BOOL, uschar *, BOOL, int, char *, ...);
151extern void header_remove(int, uschar *);
152extern BOOL header_testname(header_line *, uschar *, int, BOOL);
8523533c 153extern BOOL header_testname_incomplete(header_line *, uschar *, int, BOOL);
059ec3d9
PH
154extern void log_write(unsigned int, int, char *format, ...);
155extern int lss_b64decode(uschar *, uschar **);
156extern uschar *lss_b64encode(uschar *, int);
157extern int lss_match_domain(uschar *, uschar *);
158extern int lss_match_local_part(uschar *, uschar *, BOOL);
159extern int lss_match_address(uschar *, uschar *, BOOL);
160extern int lss_match_host(uschar *, uschar *, uschar *);
161extern void receive_add_recipient(uschar *, int);
162extern BOOL receive_remove_recipient(uschar *);
163extern uschar *rfc2047_decode(uschar *, BOOL, uschar *, int, int *, uschar **);
164extern int smtp_fflush(void);
165extern void smtp_printf(char *, ...) PRINTF_FUNCTION;
166extern uschar *string_copy(uschar *);
167extern uschar *string_copyn(uschar *, int);
168extern uschar *string_sprintf(char *, ...);
169
170/* End of local_scan.h */