~ubuntu-branches/ubuntu/vivid/exim4/vivid

« back to all changes in this revision

Viewing changes to .pc/fix_smtp_banner.patch/src/exim.h

  • Committer: Package Import Robot
  • Author(s): Corey Bryant
  • Date: 2014-08-04 11:48:39 UTC
  • mfrom: (56.1.2 utopic)
  • Revision ID: package-import@ubuntu.com-20140804114839-xoulpcx9nxi5m72u
Tags: 4.84~RC1-3ubuntu1
* Merge from Debian unstable (LP: #1351470). Remaining changes:
  - Show Ubuntu distribution on smtp:
    + debian/patches/fix_smtp_banner.patch: updated SMTP banner
      with Ubuntu distribution
    + debian/control: added lsb-release build dependency
  - Don't provide default-mta; in Ubuntu, we want postfix to be the
    default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
*     Exim - an Internet mail transport agent    *
3
3
*************************************************/
4
4
 
5
 
/* Copyright (c) University of Cambridge 1995 - 2012 */
 
5
/* Copyright (c) University of Cambridge 1995 - 2014 */
6
6
/* See the file NOTICE for conditions of use and distribution. */
7
7
 
8
8
 
35
35
/* If it didn't define os_find_running_interfaces, use the common function. */
36
36
 
37
37
#ifndef os_find_running_interfaces
38
 
#define os_find_running_interfaces os_common_find_running_interfaces
 
38
# define os_find_running_interfaces os_common_find_running_interfaces
39
39
#endif
40
40
 
41
41
/* If it didn't define the base for "base 62" numbers, we really do use 62.
44
44
making unique names. */
45
45
 
46
46
#ifndef BASE_62
47
 
#define BASE_62 62
 
47
# define BASE_62 62
48
48
#endif
49
49
 
50
50
/* The maximum value of localhost_number depends on the base being used */
51
51
 
52
52
#if BASE_62 == 62
53
 
#define LOCALHOST_MAX  16
 
53
# define LOCALHOST_MAX  16
54
54
#else
55
 
#define LOCALHOST_MAX  10
 
55
# define LOCALHOST_MAX  10
56
56
#endif
57
57
 
58
58
/* If not overridden by os.h, dynamic libraries have filenames ending .so */
77
77
 
78
78
#include <errno.h>
79
79
#if defined(__svr4__) && defined(__sparc) && ! defined(__EXTENSIONS__)
80
 
#define __EXTENSIONS__  /* so that SunOS 5 gets NGROUPS_MAX */
81
 
#include <limits.h>
82
 
#undef  __EXTENSIONS__
 
80
# define __EXTENSIONS__  /* so that SunOS 5 gets NGROUPS_MAX */
 
81
# include <limits.h>
 
82
# undef  __EXTENSIONS__
83
83
#else
84
 
#include <limits.h>
 
84
# include <limits.h>
85
85
#endif
86
86
 
87
87
/* C99 integer types, figure out how to undo this if needed for older systems */
91
91
/* Just in case some aged system doesn't define them... */
92
92
 
93
93
#ifndef INT_MAX
94
 
#define INT_MAX 2147483647
 
94
# define INT_MAX 2147483647
95
95
#endif
96
96
 
97
97
#ifndef INT_MIN
98
 
#define INT_MIN (-INT_MAX - 1)
 
98
# define INT_MIN (-INT_MAX - 1)
99
99
#endif
100
100
 
101
101
#ifndef SHRT_MAX
102
 
#define SHRT_MAX 32767
 
102
# define SHRT_MAX 32767
103
103
#endif
104
104
 
105
105
#ifndef UCHAR_MAX
106
 
#define UCHAR_MAX 255
 
106
# define UCHAR_MAX 255
107
107
#endif
108
108
 
109
109
 
118
118
/* Some systems have PATH_MAX and some have MAX_PATH_LEN. */
119
119
 
120
120
#ifndef PATH_MAX
121
 
#ifdef MAX_PATH_LEN
122
 
#define PATH_MAX MAX_PATH_LEN
123
 
#else
124
 
#define PATH_MAX 1024
125
 
#endif
 
121
# ifdef MAX_PATH_LEN
 
122
#  define PATH_MAX MAX_PATH_LEN
 
123
# else
 
124
#  define PATH_MAX 1024
 
125
# endif
126
126
#endif
127
127
 
128
128
#include <sys/types.h>
130
130
#include <dirent.h>
131
131
#include <netdb.h>
132
132
#ifndef NO_POLL_H
133
 
#include <poll.h>
 
133
# include <poll.h>
134
134
#endif
135
135
#include <pwd.h>
136
136
#include <grp.h>
140
140
in sys/file.h. */
141
141
 
142
142
#ifndef LOCK_SH
143
 
#define NO_FLOCK
 
143
# define NO_FLOCK
144
144
#endif
145
145
 
146
146
#ifndef NO_SYSEXITS        /* some OS don't have this */
147
 
#include <sysexits.h>
 
147
# include <sysexits.h>
148
148
#endif
149
149
 
150
150
/* A few OS don't have socklen_t; their os.h files define EXIM_SOCKLEN_T to
152
152
that this is used by the AIX include files. */
153
153
 
154
154
#ifndef EXIM_SOCKLEN_T
155
 
#define EXIM_SOCKLEN_T socklen_t
 
155
# define EXIM_SOCKLEN_T socklen_t
156
156
#endif
157
157
 
158
158
/* Ensure that the sysexits we reference are defined */
159
159
 
160
160
#ifndef EX_UNAVAILABLE
161
 
#define EX_UNAVAILABLE 69        /* service unavailable; used for execv fail */
 
161
# define EX_UNAVAILABLE 69        /* service unavailable; used for execv fail */
162
162
#endif
163
163
#ifndef EX_CANTCREAT
164
 
#define EX_CANTCREAT   73        /* can't create file: treat as temporary */
 
164
# define EX_CANTCREAT   73        /* can't create file: treat as temporary */
165
165
#endif
166
166
#ifndef EX_TEMPFAIL
167
 
#define EX_TEMPFAIL    75        /* temp failure; user is invited to retry */
 
167
# define EX_TEMPFAIL    75        /* temp failure; user is invited to retry */
168
168
#endif
169
169
#ifndef EX_CONFIG
170
 
#define EX_CONFIG      78        /* configuration error */
 
170
# define EX_CONFIG      78        /* configuration error */
171
171
#endif
172
172
 
173
173
/* This one is not in any sysexits file that I've come across */
179
179
#include <sys/param.h>
180
180
 
181
181
#ifndef NO_SYS_RESOURCE_H  /* QNX doesn't have this */
182
 
#include <sys/resource.h>
 
182
# include <sys/resource.h>
183
183
#endif
184
184
 
185
185
#include <sys/socket.h>
190
190
the code is run. It saves some #ifdef occurrences. */
191
191
 
192
192
#ifndef AF_INET6
193
 
#define AF_INET6 24
 
193
# define AF_INET6 24
194
194
#endif
195
195
 
196
196
#include <sys/ioctl.h>
231
231
  f_free. */
232
232
 
233
233
  #ifndef F_BAVAIL
234
 
  #define F_BAVAIL f_bavail
 
234
  # define F_BAVAIL f_bavail
235
235
  #endif
236
236
 
237
237
  #ifndef F_FAVAIL
238
 
  #define F_FAVAIL f_ffree
 
238
  # define F_FAVAIL f_ffree
239
239
  #endif
240
240
 
241
241
  /* All the systems I've been able to look at seem to have F_FILES */
242
242
 
243
243
  #ifndef F_FILES
244
 
  #define F_FILES  f_files
 
244
  # define F_FILES  f_files
245
245
  #endif
246
246
 
247
247
#endif
248
248
 
249
249
 
250
250
#ifndef  SIOCGIFCONF   /* HACK for SunOS 5 */
251
 
#include <sys/sockio.h>
 
251
# include <sys/sockio.h>
252
252
#endif
253
253
 
254
254
#include <sys/stat.h>
265
265
disabused of the notion. Luckily, since EX_OK is not used, it didn't matter.] */
266
266
 
267
267
#ifdef EX_OK
268
 
#undef EX_OK
 
268
# undef EX_OK
269
269
#endif
270
270
 
271
271
#include <unistd.h>
272
272
 
273
273
#include <utime.h>
274
274
#ifndef NO_NET_IF_H
275
 
#include <net/if.h>
 
275
# include <net/if.h>
276
276
#endif
277
277
#include <sys/un.h>
278
278
#include <netinet/in.h>
308
308
header files. I don't suppose they have T_SRV either. */
309
309
 
310
310
#ifndef T_TXT
311
 
#define T_TXT 16
 
311
# define T_TXT 16
312
312
#endif
313
313
 
314
314
#ifndef T_SRV
315
 
#define T_SRV 33
 
315
# define T_SRV 33
316
316
#endif
317
317
 
318
318
/* Many systems do not have T_SPF. */
319
319
 
320
320
#ifndef T_SPF
321
 
#define T_SPF 99
322
 
#endif
 
321
# define T_SPF 99
 
322
#endif
 
323
 
 
324
/* New TLSA record for DANE */
 
325
#ifndef T_TLSA
 
326
# define T_TLSA 52
 
327
#endif
 
328
#define MAX_TLSA_EXPANDED_SIZE 8192
323
329
 
324
330
/* It seems that some versions of arpa/nameser.h don't define *any* of the
325
331
T_xxx macros, which seem to be non-standard nowadays. Just to be on the safe
326
332
side, put in definitions for all the ones that Exim uses. */
327
333
 
328
334
#ifndef T_A
329
 
#define T_A 1
 
335
# define T_A 1
330
336
#endif
331
337
 
332
338
#ifndef T_CNAME
333
 
#define T_CNAME 5
 
339
# define T_CNAME 5
334
340
#endif
335
341
 
336
342
#ifndef T_SOA
337
 
#define T_SOA 6
 
343
# define T_SOA 6
338
344
#endif
339
345
 
340
346
#ifndef T_MX
341
 
#define T_MX 15
 
347
# define T_MX 15
342
348
#endif
343
349
 
344
350
#ifndef T_NS
345
 
#define T_NS 2
 
351
# define T_NS 2
346
352
#endif
347
353
 
348
354
#ifndef T_PTR
349
 
#define T_PTR 12
 
355
# define T_PTR 12
350
356
#endif
351
357
 
352
358
 
358
364
 
359
365
 . T_CSA gets the domain's Client SMTP Authorization SRV record
360
366
 
 
367
 . T_ADDRESSES looks up both AAAA (or A6) and A records
 
368
 
 
369
If any of these names appear in the RRtype list at:
 
370
  <http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml>
 
371
then we should rename Exim's private type away from the conflict.
361
372
*/
362
373
 
363
374
#define T_ZNS (-1)
364
375
#define T_MXH (-2)
365
376
#define T_CSA (-3)
366
 
#define T_APL (-4)
 
377
#define T_ADDRESSES (-4)
367
378
 
368
379
/* The resolv.h header defines __P(x) on some Solaris 2.5.1 systems (without
369
380
checking that it is already defined, in fact). This conflicts with other
371
382
to undefine it if resolv.h defines it. */
372
383
 
373
384
#if defined(__P)
374
 
#define __P_WAS_DEFINED_BEFORE_RESOLV
 
385
# define __P_WAS_DEFINED_BEFORE_RESOLV
375
386
#endif
376
387
 
377
388
#include <resolv.h>
378
389
 
379
390
#if defined(__P) && ! defined (__P_WAS_DEFINED_BEFORE_RESOLV)
380
 
#undef __P
 
391
# undef __P
381
392
#endif
382
393
 
383
394
/* If not defined by os.h, we do nothing special to push DNS resolver state
399
410
#include <netinet/ip.h>
400
411
 
401
412
#ifndef NO_IP_VAR_H
402
 
#include <netinet/ip_var.h>
 
413
# include <netinet/ip_var.h>
403
414
#endif
404
415
 
405
416
/* Linux (and some others) uses a different type for the 2nd argument of
407
418
here. */
408
419
 
409
420
#ifndef ICONV_ARG2_TYPE
410
 
#define ICONV_ARG2_TYPE const char **
 
421
# define ICONV_ARG2_TYPE const char **
411
422
#endif
412
423
 
413
424
/* One OS uses a different type for the 5th argument of getsockopt */
414
425
 
415
426
#ifndef GETSOCKOPT_ARG5_TYPE
416
 
#define GETSOCKOPT_ARG5_TYPE socklen_t *
 
427
# define GETSOCKOPT_ARG5_TYPE socklen_t *
417
428
#endif
418
429
 
419
430
/* One operating system uses a different type for the 2nd argument of select().
420
431
Its os.h file defines SELECT_ARG2_TYPE. For the rest, define a default here. */
421
432
 
422
433
#ifndef SELECT_ARG2_TYPE
423
 
#define SELECT_ARG2_TYPE fd_set
 
434
# define SELECT_ARG2_TYPE fd_set
424
435
#endif
425
436
 
426
437
/* One operating system uses a different type for the 4th argument of
428
439
default here. */
429
440
 
430
441
#ifndef DN_EXPAND_ARG4_TYPE
431
 
#define DN_EXPAND_ARG4_TYPE char *
 
442
# define DN_EXPAND_ARG4_TYPE char *
432
443
#endif
433
444
 
434
445
/* One operating system defines a different type for the yield of inet_addr().
439
450
use different values for specific OS if ever necessary. */
440
451
 
441
452
#ifndef S_ADDR_TYPE
442
 
#define S_ADDR_TYPE u_long
 
453
# define S_ADDR_TYPE u_long
443
454
#endif
444
455
 
445
456
/* (At least) one operating system (Solaris) defines a different type for the
448
459
here. */
449
460
 
450
461
#ifndef PAM_CONVERSE_ARG2_TYPE
451
 
#define PAM_CONVERSE_ARG2_TYPE const struct pam_message
 
462
# define PAM_CONVERSE_ARG2_TYPE const struct pam_message
452
463
#endif
453
464
 
454
465
/* One operating system (SunOS4) defines getc, ungetc, feof, and ferror as
456
467
flag gets set to cause this to be sorted out here. */
457
468
 
458
469
#ifdef FUDGE_GETC_AND_FRIENDS
459
 
#undef getc
 
470
# undef getc
460
471
extern int getc(FILE *);
461
 
#undef ungetc
 
472
# undef ungetc
462
473
extern int ungetc(int, FILE *);
463
 
#undef feof
 
474
# undef feof
464
475
extern int feof(FILE *);
465
 
#undef ferror
 
476
# undef ferror
466
477
extern int ferror(FILE *);
467
478
#endif
468
479
 
484
495
#include "osfunctions.h"
485
496
 
486
497
#ifdef EXPERIMENTAL_BRIGHTMAIL
487
 
#include "bmi_spam.h"
 
498
# include "bmi_spam.h"
488
499
#endif
489
500
#ifdef EXPERIMENTAL_SPF
490
 
#include "spf.h"
 
501
# include "spf.h"
491
502
#endif
492
503
#ifdef EXPERIMENTAL_SRS
493
 
#include "srs.h"
 
504
# include "srs.h"
494
505
#endif
495
506
#ifndef DISABLE_DKIM
496
 
#include "dkim.h"
 
507
# include "dkim.h"
497
508
#endif
498
509
#ifdef EXPERIMENTAL_DMARC
499
 
#include "dmarc.h"
500
 
#include <opendmarc/dmarc.h>
 
510
# include "dmarc.h"
 
511
# include <opendmarc/dmarc.h>
501
512
#endif
502
513
 
503
514
/* The following stuff must follow the inclusion of config.h because it
504
515
requires various things that are set therein. */
505
516
 
506
517
#if HAVE_ICONV             /* Not all OS have this */
507
 
#include <iconv.h>
 
518
# include <iconv.h>
508
519
#endif
509
520
 
510
521
#if defined(USE_READLINE) || defined(EXPAND_DLFUNC) || defined (LOOKUP_MODULE_DIR)
511
 
#include <dlfcn.h>
 
522
# include <dlfcn.h>
512
523
#endif
513
524
 
514
525
#ifdef ENABLE_DISABLE_FSYNC
515
 
#define EXIMfsync(f) (disable_fsync? 0 : fsync(f))
 
526
# define EXIMfsync(f) (disable_fsync? 0 : fsync(f))
516
527
#else
517
 
#define EXIMfsync(f) fsync(f)
 
528
# define EXIMfsync(f) fsync(f)
518
529
#endif
519
530
 
520
531
/* Backward compatibility; LOOKUP_LSEARCH now includes all three */
521
532
 
522
533
#if (!defined LOOKUP_LSEARCH) && (defined LOOKUP_WILDLSEARCH || defined LOOKUP_NWILDLSEARCH)
523
 
#define LOOKUP_LSEARCH yes
 
534
# define LOOKUP_LSEARCH yes
524
535
#endif
525
536
 
526
537
/* Define a union to hold either an IPv4 or an IPv6 sockaddr structure; this
539
550
so that if USE_GNUTLS *is* set, we can assume SUPPORT_TLS is also set. */
540
551
 
541
552
#ifndef SUPPORT_TLS
542
 
#undef USE_GNUTLS
 
553
# undef USE_GNUTLS
543
554
#endif
544
555
 
545
556
/* If SPOOL_DIRECTORY, LOG_FILE_PATH or PID_FILE_PATH have not been defined,
563
574
default to EDQUOT if it exists, otherwise ENOSPC. */
564
575
 
565
576
#ifndef ERRNO_QUOTA
566
 
#ifdef  EDQUOT
567
 
#define ERRNO_QUOTA EDQUOT
568
 
#else
569
 
#define ERRNO_QUOTA ENOSPC
570
 
#endif
 
577
# ifdef  EDQUOT
 
578
#  define ERRNO_QUOTA EDQUOT
 
579
# else
 
580
#  define ERRNO_QUOTA ENOSPC
 
581
# endif
571
582
#endif
572
583
 
573
584
/* Ensure PATH_MAX is defined */
574
585
 
575
586
#ifndef PATH_MAX
576
587
  #ifdef MAXPATHLEN
577
 
  #define PATH_MAX MAXPATHLEN
 
588
  # define PATH_MAX MAXPATHLEN
578
589
  #else
579
 
  #define PATH_MAX 1024
 
590
  # define PATH_MAX 1024
580
591
  #endif
581
592
#endif
582
593