summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/include
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2007-04-09 01:38:51 +0000
committergshapiro <gshapiro@FreeBSD.org>2007-04-09 01:38:51 +0000
commit14e22b52d4375b164f9fa21c0ab3abd9837e823f (patch)
tree2a4f38ae8ba223f3bf2402f56d35c997e5af6db5 /contrib/sendmail/include
parent0a9c74f73599b0ca2981b57815b436d1f6de6191 (diff)
downloadFreeBSD-src-14e22b52d4375b164f9fa21c0ab3abd9837e823f.zip
FreeBSD-src-14e22b52d4375b164f9fa21c0ab3abd9837e823f.tar.gz
Import sendmail 8.14.1
Diffstat (limited to 'contrib/sendmail/include')
-rw-r--r--contrib/sendmail/include/libmilter/mfapi.h124
-rw-r--r--contrib/sendmail/include/libmilter/mfdef.h141
-rw-r--r--contrib/sendmail/include/libmilter/milter.h31
-rw-r--r--contrib/sendmail/include/sm/conf.h89
-rw-r--r--contrib/sendmail/include/sm/errstring.h6
-rw-r--r--contrib/sendmail/include/sm/heap.h14
-rw-r--r--contrib/sendmail/include/sm/ldap.h31
-rw-r--r--contrib/sendmail/include/sm/misc.h19
-rw-r--r--contrib/sendmail/include/sm/os/sm_os_qnx.h20
-rw-r--r--contrib/sendmail/include/sm/sendmail.h24
-rw-r--r--contrib/sendmail/include/sm/tailq.h153
11 files changed, 505 insertions, 147 deletions
diff --git a/contrib/sendmail/include/libmilter/mfapi.h b/contrib/sendmail/include/libmilter/mfapi.h
index 6b85403..4338645 100644
--- a/contrib/sendmail/include/libmilter/mfapi.h
+++ b/contrib/sendmail/include/libmilter/mfapi.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2004 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2004, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Id: mfapi.h,v 8.61 2006/05/04 17:02:01 ca Exp $
+ * $Id: mfapi.h,v 8.77 2006/11/02 02:44:07 ca Exp $
*/
/*
@@ -18,9 +18,13 @@
# define _LIBMILTER_MFAPI_H 1
#ifndef SMFI_VERSION
-# define SMFI_VERSION 2 /* version number */
+# define SMFI_VERSION 0x01000000 /* libmilter version number */
#endif /* ! SMFI_VERSION */
+#define SM_LM_VRS_MAJOR(v) (((v) & 0x7f000000) >> 24)
+#define SM_LM_VRS_MINOR(v) (((v) & 0x007fff00) >> 8)
+#define SM_LM_VRS_PLVL(v) ((v) & 0x0000007f)
+
# include <sys/types.h>
# include <sys/socket.h>
@@ -40,11 +44,14 @@ extern "C" {
/*
** libmilter functions return one of the following to indicate
-** success/failure:
+** success/failure(/continue):
*/
#define MI_SUCCESS 0
#define MI_FAILURE (-1)
+#if _FFR_WORKERS_POOL
+# define MI_CONTINUE 1
+#endif /* _FFR_WORKERS_POOL */
/* "forward" declarations */
typedef struct smfi_str SMFICTX;
@@ -128,15 +135,24 @@ struct smfiDesc
/* connection cleanup */
sfsistat (*xxfi_close) SM__P((SMFICTX *));
-#if SMFI_VERSION > 2
/* any unrecognized or unimplemented command filter */
- sfsistat (*xxfi_unknown) SM__P((SMFICTX *, char *));
-#endif /* SMFI_VERSION > 2 */
+ sfsistat (*xxfi_unknown) SM__P((SMFICTX *, const char *));
-#if SMFI_VERSION > 3
/* SMTP DATA command filter */
sfsistat (*xxfi_data) SM__P((SMFICTX *));
-#endif /* SMFI_VERSION > 3 */
+
+ /* negotiation callback */
+ sfsistat (*xxfi_negotiate) SM__P((SMFICTX *,
+ unsigned long, unsigned long,
+ unsigned long, unsigned long,
+ unsigned long *, unsigned long *,
+ unsigned long *, unsigned long *));
+
+#if 0
+ /* signal handler callback, not yet implemented. */
+ int (*xxfi_signal) SM__P((int));
+#endif
+
};
LIBMILTER_API int smfi_opensocket __P((bool));
@@ -150,6 +166,7 @@ LIBMILTER_API int smfi_stop __P((void));
#if _FFR_MAXDATASIZE
LIBMILTER_API size_t smfi_setmaxdatasize __P((size_t));
#endif /* _FFR_MAXDATASIZE */
+LIBMILTER_API int smfi_version __P((unsigned int *, unsigned int *, unsigned int *));
/*
** What the filter might do -- values to be ORed together for
@@ -165,6 +182,33 @@ LIBMILTER_API size_t smfi_setmaxdatasize __P((size_t));
#define SMFIF_CHGHDRS 0x00000010L /* filter may change/delete headers */
#define SMFIF_QUARANTINE 0x00000020L /* filter may quarantine envelope */
+/* filter may change "from" (envelope sender) */
+#define SMFIF_CHGFROM 0x00000040L
+#define SMFIF_ADDRCPT_PAR 0x00000080L /* add recipients incl. args */
+
+/* filter can send set of symbols (macros) that it wants */
+#define SMFIF_SETSYMLIST 0x00000100L
+
+
+/*
+** Macro "places";
+** Notes:
+** - must be coordinated with libmilter/engine.c and sendmail/milter.c
+** - the order MUST NOT be changed as it would break compatibility between
+** different versions. It's ok to append new entries however
+** (hence the list is not sorted by the SMT protocol steps).
+*/
+
+#define SMFIM_FIRST 0 /* Do NOT use, internal marker only */
+#define SMFIM_CONNECT 0 /* connect */
+#define SMFIM_HELO 1 /* HELO/EHLO */
+#define SMFIM_ENVFROM 2 /* MAIL From */
+#define SMFIM_ENVRCPT 3 /* RCPT To */
+#define SMFIM_DATA 4 /* DATA */
+#define SMFIM_EOM 5 /* end of message (final dot) */
+#define SMFIM_EOH 6 /* end of header */
+#define SMFIM_LAST 6 /* Do NOT use, internal marker only */
+
/*
** Continue processing message/connection.
*/
@@ -209,6 +253,21 @@ LIBMILTER_API size_t smfi_setmaxdatasize __P((size_t));
#define SMFIS_TEMPFAIL 4
+/*
+** Do not send a reply to the MTA
+*/
+
+#define SMFIS_NOREPLY 7
+
+/*
+** Skip over rest of same callbacks, e.g., body.
+*/
+
+#define SMFIS_SKIP 8
+
+/* xxfi_negotiate: use all existing protocol options/actions */
+#define SMFIS_ALL_OPTS 10
+
#if 0
/*
** Filter Routine Details
@@ -261,12 +320,12 @@ extern sfsistat xxfi_envrcpt __P((SMFICTX *, char **));
/* unknown command filter */
-extern sfsistat *xxfi_unknown __P((SMFICTX *, char *));
+extern sfsistat *xxfi_unknown __P((SMFICTX *, const char *));
/*
** xxfi_unknown(ctx, arg) Invoked when SMTP command is not recognized or not
** implemented.
-** char *arg; Null-terminated SMTP command
+** const char *arg; Null-terminated SMTP command
*/
/* header filter */
@@ -414,6 +473,17 @@ LIBMILTER_API int smfi_insheader __P((SMFICTX *, int, char *, char *));
** char *headerv; Header field value
*/
+LIBMILTER_API int smfi_chgfrom __P((SMFICTX *, char *, char *));
+
+/*
+** Modify envelope sender address
+**
+** SMFICTX *ctx; Opaque context structure
+** char *mail; New envelope sender address
+** char *args; ESMTP arguments
+*/
+
+
LIBMILTER_API int smfi_addrcpt __P((SMFICTX *, char *));
/*
@@ -423,6 +493,17 @@ LIBMILTER_API int smfi_addrcpt __P((SMFICTX *, char *));
** char *rcpt; Recipient to be added
*/
+LIBMILTER_API int smfi_addrcpt_par __P((SMFICTX *, char *, char *));
+
+/*
+** Add a recipient to the envelope
+**
+** SMFICTX *ctx; Opaque context structure
+** char *rcpt; Recipient to be added
+** char *args; ESMTP arguments
+*/
+
+
LIBMILTER_API int smfi_delrcpt __P((SMFICTX *, char *));
/*
@@ -486,6 +567,27 @@ LIBMILTER_API int smfi_setpriv __P((SMFICTX *, void *));
LIBMILTER_API void *smfi_getpriv __P((SMFICTX *));
+/*
+** Get the private data pointer
+**
+** SMFICTX *ctx; Opaque context structure
+** void *privatedata; Pointer to private data area
+*/
+
+LIBMILTER_API int smfi_setsymlist __P((SMFICTX *, int, char *));
+
+/*
+** Set list of symbols (macros) to receive
+**
+** SMFICTX *ctx; Opaque context structure
+** int where; where in the SMTP dialogue should the macros be sent
+** char *macros; list of macros (space separated)
+*/
+
+#if _FFR_THREAD_MONITOR
+LIBMILTER_API int smfi_set_max_exec_time __P((unsigned int));
+#endif /* _FFR_THREAD_MONITOR */
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/contrib/sendmail/include/libmilter/mfdef.h b/contrib/sendmail/include/libmilter/mfdef.h
index 5b1ddff..6748567 100644
--- a/contrib/sendmail/include/libmilter/mfdef.h
+++ b/contrib/sendmail/include/libmilter/mfdef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2005 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2007 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Id: mfdef.h,v 8.22 2005/08/05 21:49:04 ca Exp $
+ * $Id: mfdef.h,v 8.38 2007/03/27 18:53:48 ca Exp $
*/
/*
@@ -17,83 +17,94 @@
#ifndef _LIBMILTER_MFDEF_H
# define _LIBMILTER_MFDEF_H 1
+#ifndef SMFI_PROT_VERSION
+# define SMFI_PROT_VERSION 6 /* MTA - libmilter protocol version */
+#endif /* SMFI_PROT_VERSION */
+
/* Shared protocol constants */
-# define MILTER_LEN_BYTES 4 /* length of 32 bit integer in bytes */
-# define MILTER_OPTLEN (MILTER_LEN_BYTES * 3) /* length of options */
-# define MILTER_CHUNK_SIZE 65535 /* body chunk size */
-# define MILTER_MAX_DATA_SIZE 65535 /* default milter command data limit */
+#define MILTER_LEN_BYTES 4 /* length of 32 bit integer in bytes */
+#define MILTER_OPTLEN (MILTER_LEN_BYTES * 3) /* length of options */
+#define MILTER_CHUNK_SIZE 65535 /* body chunk size */
+#define MILTER_MAX_DATA_SIZE 65535 /* default milter command data limit */
/* These apply to SMFIF_* flags */
#define SMFI_V1_ACTS 0x0000000FL /* The actions of V1 filter */
#define SMFI_V2_ACTS 0x0000003FL /* The actions of V2 filter */
-#define SMFI_CURR_ACTS SMFI_V2_ACTS /* The current version */
+#define SMFI_CURR_ACTS 0x000001FFL /* actions of current version */
/* address families */
-# define SMFIA_UNKNOWN 'U' /* unknown */
-# define SMFIA_UNIX 'L' /* unix/local */
-# define SMFIA_INET '4' /* inet */
-# define SMFIA_INET6 '6' /* inet6 */
+#define SMFIA_UNKNOWN 'U' /* unknown */
+#define SMFIA_UNIX 'L' /* unix/local */
+#define SMFIA_INET '4' /* inet */
+#define SMFIA_INET6 '6' /* inet6 */
/* commands: don't use anything smaller than ' ' */
-# define SMFIC_ABORT 'A' /* Abort */
-# define SMFIC_BODY 'B' /* Body chunk */
-# define SMFIC_CONNECT 'C' /* Connection information */
-# define SMFIC_MACRO 'D' /* Define macro */
-# define SMFIC_BODYEOB 'E' /* final body chunk (End) */
-# define SMFIC_HELO 'H' /* HELO/EHLO */
-# define SMFIC_HEADER 'L' /* Header */
-# define SMFIC_MAIL 'M' /* MAIL from */
-# define SMFIC_EOH 'N' /* EOH */
-# define SMFIC_OPTNEG 'O' /* Option negotiation */
-# define SMFIC_QUIT 'Q' /* QUIT */
-# define SMFIC_RCPT 'R' /* RCPT to */
-# if SMFI_VERSION > 3
-# define SMFIC_DATA 'T' /* DATA */
-# endif /* SMFI_VERSION > 3 */
-# if SMFI_VERSION > 2
-# define SMFIC_UNKNOWN 'U' /* Any unknown command */
-# endif /* SMFI_VERSION > 2 */
+#define SMFIC_ABORT 'A' /* Abort */
+#define SMFIC_BODY 'B' /* Body chunk */
+#define SMFIC_CONNECT 'C' /* Connection information */
+#define SMFIC_MACRO 'D' /* Define macro */
+#define SMFIC_BODYEOB 'E' /* final body chunk (End) */
+#define SMFIC_HELO 'H' /* HELO/EHLO */
+#define SMFIC_QUIT_NC 'K' /* QUIT but new connection follows */
+#define SMFIC_HEADER 'L' /* Header */
+#define SMFIC_MAIL 'M' /* MAIL from */
+#define SMFIC_EOH 'N' /* EOH */
+#define SMFIC_OPTNEG 'O' /* Option negotiation */
+#define SMFIC_QUIT 'Q' /* QUIT */
+#define SMFIC_RCPT 'R' /* RCPT to */
+#define SMFIC_DATA 'T' /* DATA */
+#define SMFIC_UNKNOWN 'U' /* Any unknown command */
/* actions (replies) */
-# define SMFIR_ADDRCPT '+' /* add recipient */
-# define SMFIR_DELRCPT '-' /* remove recipient */
-# define SMFIR_ACCEPT 'a' /* accept */
-# define SMFIR_REPLBODY 'b' /* replace body (chunk) */
-# define SMFIR_CONTINUE 'c' /* continue */
-# define SMFIR_DISCARD 'd' /* discard */
-# define SMFIR_CONN_FAIL 'f' /* cause a connection failure */
-# define SMFIR_CHGHEADER 'm' /* change header */
-# define SMFIR_PROGRESS 'p' /* progress */
-# define SMFIR_REJECT 'r' /* reject */
-# define SMFIR_TEMPFAIL 't' /* tempfail */
-# define SMFIR_SHUTDOWN '4' /* 421: shutdown (internal to MTA) */
-# define SMFIR_ADDHEADER 'h' /* add header */
-# define SMFIR_INSHEADER 'i' /* insert header */
-# define SMFIR_REPLYCODE 'y' /* reply code etc */
-# define SMFIR_QUARANTINE 'q' /* quarantine */
+#define SMFIR_ADDRCPT '+' /* add recipient */
+#define SMFIR_DELRCPT '-' /* remove recipient */
+#define SMFIR_ADDRCPT_PAR '2' /* add recipient (incl. ESMTP args) */
+#define SMFIR_SHUTDOWN '4' /* 421: shutdown (internal to MTA) */
+#define SMFIR_ACCEPT 'a' /* accept */
+#define SMFIR_REPLBODY 'b' /* replace body (chunk) */
+#define SMFIR_CONTINUE 'c' /* continue */
+#define SMFIR_DISCARD 'd' /* discard */
+#define SMFIR_CHGFROM 'e' /* change envelope sender (from) */
+#define SMFIR_CONN_FAIL 'f' /* cause a connection failure */
+#define SMFIR_ADDHEADER 'h' /* add header */
+#define SMFIR_INSHEADER 'i' /* insert header */
+#define SMFIR_SETSYMLIST 'l' /* set list of symbols (macros) */
+#define SMFIR_CHGHEADER 'm' /* change header */
+#define SMFIR_PROGRESS 'p' /* progress */
+#define SMFIR_QUARANTINE 'q' /* quarantine */
+#define SMFIR_REJECT 'r' /* reject */
+#define SMFIR_SKIP 's' /* skip */
+#define SMFIR_TEMPFAIL 't' /* tempfail */
+#define SMFIR_REPLYCODE 'y' /* reply code etc */
/* What the MTA can send/filter wants in protocol */
-# define SMFIP_NOCONNECT 0x00000001L /* MTA should not send connect info */
-# define SMFIP_NOHELO 0x00000002L /* MTA should not send HELO info */
-# define SMFIP_NOMAIL 0x00000004L /* MTA should not send MAIL info */
-# define SMFIP_NORCPT 0x00000008L /* MTA should not send RCPT info */
-# define SMFIP_NOBODY 0x00000010L /* MTA should not send body */
-# define SMFIP_NOHDRS 0x00000020L /* MTA should not send headers */
-# define SMFIP_NOEOH 0x00000040L /* MTA should not send EOH */
-# if _FFR_MILTER_NOHDR_RESP
-# define SMFIP_NOHREPL 0x00000080L /* No reply for headers */
-# endif /* _FFR_MILTER_NOHDR_RESP */
-# define SMFIP_NOUNKNOWN 0x00000100L /* MTA should not send unknown command */
-# define SMFIP_NODATA 0x00000200L /* MTA should not send DATA */
+#define SMFIP_NOCONNECT 0x00000001L /* MTA should not send connect info */
+#define SMFIP_NOHELO 0x00000002L /* MTA should not send HELO info */
+#define SMFIP_NOMAIL 0x00000004L /* MTA should not send MAIL info */
+#define SMFIP_NORCPT 0x00000008L /* MTA should not send RCPT info */
+#define SMFIP_NOBODY 0x00000010L /* MTA should not send body */
+#define SMFIP_NOHDRS 0x00000020L /* MTA should not send headers */
+#define SMFIP_NOEOH 0x00000040L /* MTA should not send EOH */
+#define SMFIP_NR_HDR 0x00000080L /* No reply for headers */
+#define SMFIP_NOHREPL SMFIP_NR_HDR /* No reply for headers */
+#define SMFIP_NOUNKNOWN 0x00000100L /* MTA should not send unknown commands */
+#define SMFIP_NODATA 0x00000200L /* MTA should not send DATA */
+#define SMFIP_SKIP 0x00000400L /* MTA understands SMFIS_SKIP */
+#define SMFIP_RCPT_REJ 0x00000800L /* MTA should also send rejected RCPTs */
+#define SMFIP_NR_CONN 0x00001000L /* No reply for connect */
+#define SMFIP_NR_HELO 0x00002000L /* No reply for HELO */
+#define SMFIP_NR_MAIL 0x00004000L /* No reply for MAIL */
+#define SMFIP_NR_RCPT 0x00008000L /* No reply for RCPT */
+#define SMFIP_NR_DATA 0x00010000L /* No reply for DATA */
+#define SMFIP_NR_UNKN 0x00020000L /* No reply for UNKN */
+#define SMFIP_NR_EOH 0x00040000L /* No reply for eoh */
+#define SMFIP_NR_BODY 0x00080000L /* No reply for body chunk */
+#define SMFIP_HDR_LEADSPC 0x00100000L /* header value leading space */
-# define SMFI_V1_PROT 0x0000003FL /* The protocol of V1 filter */
-# define SMFI_V2_PROT 0x0000007FL /* The protocol of V2 filter */
+#define SMFI_V1_PROT 0x0000003FL /* The protocol of V1 filter */
+#define SMFI_V2_PROT 0x0000007FL /* The protocol of V2 filter */
-/* Note: the "current" version is now determined dynamically in milter.c */
-# if _FFR_MILTER_NOHDR_RESP
-# define SMFI_CURR_PROT 0x000000FFL
-# else /* _FFR_MILTER_NOHDR_RESP */
-# define SMFI_CURR_PROT SMFI_V2_PROT
-# endif /* _FFR_MILTER_NOHDR_RESP */
+/* all defined protocol bits */
+#define SMFI_CURR_PROT 0x001FFFFFL
#endif /* !_LIBMILTER_MFDEF_H */
diff --git a/contrib/sendmail/include/libmilter/milter.h b/contrib/sendmail/include/libmilter/milter.h
index 5178f75..061a4db 100644
--- a/contrib/sendmail/include/libmilter/milter.h
+++ b/contrib/sendmail/include/libmilter/milter.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2003, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Id: milter.h,v 8.39 2003/12/02 00:21:42 msk Exp $
+ * $Id: milter.h,v 8.41 2006/05/22 23:23:55 ca Exp $
*/
/*
@@ -25,31 +25,4 @@
typedef pthread_t sthread_t;
typedef int socket_t;
-# define MAX_MACROS_ENTRIES 5 /* max size of macro pointer array */
-
-/*
-** context for milter
-** implementation hint:
-** macros are stored in mac_buf[] as sequence of:
-** macro_name \0 macro_value
-** (just as read from the MTA)
-** mac_ptr is a list of pointers into mac_buf to the beginning of each
-** entry, i.e., macro_name, macro_value, ...
-*/
-
-struct smfi_str
-{
- sthread_t ctx_id; /* thread id */
- socket_t ctx_sd; /* socket descriptor */
- int ctx_dbg; /* debug level */
- time_t ctx_timeout; /* timeout */
- int ctx_state; /* state */
- smfiDesc_ptr ctx_smfi; /* filter description */
- unsigned long ctx_pflags; /* protocol flags */
- char **ctx_mac_ptr[MAX_MACROS_ENTRIES];
- char *ctx_mac_buf[MAX_MACROS_ENTRIES];
- char *ctx_reply; /* reply code */
- void *ctx_privdata; /* private data */
-};
-
#endif /* ! _LIBMILTER_MILTER_H */
diff --git a/contrib/sendmail/include/sm/conf.h b/contrib/sendmail/include/sm/conf.h
index 919ff0d..4f05f33 100644
--- a/contrib/sendmail/include/sm/conf.h
+++ b/contrib/sendmail/include/sm/conf.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2007 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -10,14 +10,16 @@
* the sendmail distribution.
*
*
- * $Id: conf.h,v 1.128 2006/01/27 18:43:44 ca Exp $
+ * $Id: conf.h,v 1.132 2007/03/21 23:56:18 ca Exp $
*/
/*
** CONF.H -- All user-configurable parameters for sendmail
**
-** Send updates to sendmail@Sendmail.ORG so they will be
-** included in the next release.
+** Send updates to Sendmail.ORG so they will be
+** included in the next release; see
+** http://www.sendmail.org/email-addresses.html
+** for current e-mail address.
*/
#ifndef SM_CONF_H
@@ -160,6 +162,8 @@ extern void hard_syslog();
*/
# ifdef _AIX5
+# include <sys/signal.h>
+# include <sys/wait.h>
# define _AIX4 40300
# define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */
# define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */
@@ -444,6 +448,7 @@ typedef int pid_t;
# define SMRSH_CMDDIR "/var/adm/sm.bin"
# endif /* ! SMRSH_CMDDIR */
# define SL_FUDGE 34 /* fudge offset for SyslogPrefixLen */
+# define HASLDAPGETALIASBYNAME 1 /* added in S8 */
# endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */
# if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
# define HASURANDOMDEV 1 /* /dev/[u]random added in S9 */
@@ -852,36 +857,64 @@ extern unsigned int sleepX __P((unsigned int seconds));
# endif /* __bsdi__ */
+# if defined(__QNX__)
+# if defined(__QNXNTO__)
+/* QNX 6 */
+# include <unix.h>
+# define HASUNSETENV 1 /* has unsetenv(3) call */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# define HASSETSID 1 /* has POSIX setsid(2) call */
+# define USESETEUID 1 /* has usable seteuid(2) call */
+# define HASFCHMOD 1 /* has fchmod(2) syscall */
+# define HASFCHOWN 1 /* has fchown(2) syscall */
+# define HASUNAME 1 /* has uname(2) syscall */
+# define HASSTRERROR 1 /* has strerror(3) */
+# define BSD4_4_SOCKADDR /* has sa_len */
+# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+# define NETLINK 1 /* supports AF_LINK */
+# define GIDSET_T gid_t
+# define QUAD_T uint64_t
+# define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */
+# define HASGETUSERSHELL 0
+
+/*
+** We have a strrev() that doesn't allocate anything.
+** Make sure the one here is used.
+*/
+
+# define strrev strrev_sendmail
+
+# else /* defined(__QNXNTO__) */
+
/*
** QNX 4.2x
** Contributed by Glen McCready <glen@qnx.com>.
**
-** Should work with all versions of QNX.
+** Should work with all versions of QNX 4.
*/
-# if defined(__QNX__)
-# include <unix.h>
-# include <sys/select.h>
-# undef NGROUPS_MAX
-# define HASSETSID 1 /* has POSIX setsid(2) call */
-# define USESETEUID 1 /* has usable seteuid(2) call */
-# define HASFCHMOD 1 /* has fchmod(2) syscall */
-# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
-# define HASSETREUID 1 /* has setreuid(2) call */
-# define HASSTRERROR 1 /* has strerror(3) */
-# define HASFLOCK 0
-# undef HASINITGROUPS /* has initgroups(3) call */
-# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
-# define IP_SRCROUTE 1 /* can check IP source routing */
-# define TZ_TYPE TZ_TMNAME /* use tmname variable */
-# define GIDSET_T gid_t
-# define LA_TYPE LA_ZERO
-# define SFS_TYPE SFS_NONE
-# define SPT_TYPE SPT_REUSEARGV
-# define SPT_PADCHAR '\0' /* pad process title with nulls */
-# define HASGETUSERSHELL 0
-# define E_PSEUDOBASE 512
-# define _FILE_H_INCLUDED
+# include <unix.h>
+# include <sys/select.h>
+# undef NGROUPS_MAX
+# define HASSETSID 1 /* has POSIX setsid(2) call */
+# define USESETEUID 1 /* has usable seteuid(2) call */
+# define HASFCHMOD 1 /* has fchmod(2) syscall */
+# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define HASSTRERROR 1 /* has strerror(3) */
+# define HASFLOCK 0
+# undef HASINITGROUPS /* has initgroups(3) call */
+# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
+# define IP_SRCROUTE 1 /* can check IP source routing */
+# define TZ_TYPE TZ_TMNAME /* use tmname variable */
+# define GIDSET_T gid_t
+# define LA_TYPE LA_ZERO
+# define SFS_TYPE SFS_NONE
+# define SPT_TYPE SPT_REUSEARGV
+# define SPT_PADCHAR '\0' /* pad process title with nulls */
+# define HASGETUSERSHELL 0
+# define _FILE_H_INCLUDED
+# endif /* defined(__QNXNTO__) */
# endif /* defined(__QNX__) */
diff --git a/contrib/sendmail/include/sm/errstring.h b/contrib/sendmail/include/sm/errstring.h
index 2b93732..1d41526 100644
--- a/contrib/sendmail/include/sm/errstring.h
+++ b/contrib/sendmail/include/sm/errstring.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Id: errstring.h,v 1.9 2003/12/10 03:19:06 gshapiro Exp $
+ * $Id: errstring.h,v 1.10 2007/03/21 23:56:19 ca Exp $
*/
/*
@@ -16,6 +16,10 @@
#ifndef SM_ERRSTRING_H
# define SM_ERRSTRING_H
+#if defined(__QNX__)
+# define E_PSEUDOBASE 512
+#endif /* defined(__QNX__) */
+
#include <errno.h>
#if NEEDINTERRNO
extern int errno;
diff --git a/contrib/sendmail/include/sm/heap.h b/contrib/sendmail/include/sm/heap.h
index 8b56370..cd346b3 100644
--- a/contrib/sendmail/include/sm/heap.h
+++ b/contrib/sendmail/include/sm/heap.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2000-2001, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Id: heap.h,v 1.22 2001/09/04 22:41:55 ca Exp $
+ * $Id: heap.h,v 1.23 2006/08/15 00:53:46 ca Exp $
*/
/*
@@ -91,6 +91,16 @@ sm_fcalloc __P((
# define sm_heap_setgroup(g) (SmHeapGroup = (g))
# define sm_heap_newgroup() (SmHeapGroup = ++SmHeapMaxGroup)
+#define SM_FREE(ptr) \
+ do \
+ { \
+ if ((ptr) != NULL) \
+ { \
+ sm_free(ptr); \
+ (ptr) = NULL; \
+ } \
+ } while (0)
+
extern int SmHeapGroup;
extern int SmHeapMaxGroup;
diff --git a/contrib/sendmail/include/sm/ldap.h b/contrib/sendmail/include/sm/ldap.h
index 7db8355..63292f1 100644
--- a/contrib/sendmail/include/sm/ldap.h
+++ b/contrib/sendmail/include/sm/ldap.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2001-2003, 2005 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2001-2003, 2005, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Id: ldap.h,v 1.28 2005/06/23 23:11:21 ca Exp $
+ * $Id: ldap.h,v 1.32 2006/08/30 22:56:58 ca Exp $
*/
#ifndef SM_LDAP_H
@@ -17,7 +17,7 @@
/*
** NOTE: These should be changed from LDAPMAP_* to SM_LDAP_*
-** in the next major release (8.13) of sendmail.
+** in the next major release (8.x+1) of sendmail.
*/
# ifndef LDAPMAP_MAX_ATTR
@@ -32,6 +32,13 @@
# if LDAPMAP
+/* maximum number of arguments in a map lookup, see sendmail.h: MAX_MAP_ARGS */
+# define SM_LDAP_ARGS 10
+
+/* error codes from sm_ldap_search*() */
+# define SM_LDAP_ERR (-1) /* generic error: ldap_search(3) */
+# define SM_LDAP_ERR_ARG_MISS (-2) /* an argument is missing */
+
/* Attribute types */
# define SM_LDAP_ATTR_NONE (-1)
# define SM_LDAP_ATTR_OBJCLASS 0
@@ -75,6 +82,7 @@ struct sm_ldap_struct
int ldap_attr_type[LDAPMAP_MAX_ATTR + 1];
char *ldap_attr_needobjclass[LDAPMAP_MAX_ATTR + 1];
bool ldap_attrsonly;
+ bool ldap_multi_args;
/* args for ldap_result */
struct timeval ldap_timeout;
@@ -91,18 +99,18 @@ typedef struct sm_ldap_struct SM_LDAP_STRUCT;
struct sm_ldap_recurse_entry
{
- char *lr_search;
- int lr_type;
- LDAPURLDesc *lr_ludp;
- char **lr_attrs;
- bool lr_done;
+ char *lr_search;
+ int lr_type;
+ LDAPURLDesc *lr_ludp;
+ char **lr_attrs;
+ bool lr_done;
};
struct sm_ldap_recurse_list
{
- int lr_size;
- int lr_cnt;
- struct sm_ldap_recurse_entry **lr_data;
+ int lrl_size;
+ int lrl_cnt;
+ struct sm_ldap_recurse_entry **lrl_data;
};
typedef struct sm_ldap_recurse_entry SM_LDAP_RECURSE_ENTRY;
@@ -112,6 +120,7 @@ typedef struct sm_ldap_recurse_list SM_LDAP_RECURSE_LIST;
extern void sm_ldap_clear __P((SM_LDAP_STRUCT *));
extern bool sm_ldap_start __P((char *, SM_LDAP_STRUCT *));
extern int sm_ldap_search __P((SM_LDAP_STRUCT *, char *));
+extern int sm_ldap_search_m __P((SM_LDAP_STRUCT *, char **));
extern int sm_ldap_results __P((SM_LDAP_STRUCT *, int, int, int,
SM_RPOOL_T *, char **, int *, int *,
SM_LDAP_RECURSE_LIST *));
diff --git a/contrib/sendmail/include/sm/misc.h b/contrib/sendmail/include/sm/misc.h
new file mode 100644
index 0000000..a9d6637
--- /dev/null
+++ b/contrib/sendmail/include/sm/misc.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2006 Sendmail, Inc. and its suppliers.
+ * All rights reserved.
+ *
+ * By using this file, you agree to the terms and conditions set
+ * forth in the LICENSE file which can be found at the top level of
+ * the sendmail distribution.
+ *
+ * $Id: misc.h,v 1.1 2006/06/28 23:57:59 ca Exp $
+ */
+
+#ifndef SM_MISC_H
+# define SM_MISC_H 1
+
+int sm_memstat_open __P((void));
+int sm_memstat_close __P((void));
+int sm_memstat_get __P((char *, long *));
+
+#endif /* ! SM_MISC_H */
diff --git a/contrib/sendmail/include/sm/os/sm_os_qnx.h b/contrib/sendmail/include/sm/os/sm_os_qnx.h
new file mode 100644
index 0000000..9769827
--- /dev/null
+++ b/contrib/sendmail/include/sm/os/sm_os_qnx.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2007 Sendmail, Inc. and its suppliers.
+ * All rights reserved.
+ *
+ * By using this file, you agree to the terms and conditions set
+ * forth in the LICENSE file which can be found at the top level of
+ * the sendmail distribution.
+ *
+ * $Id: sm_os_qnx.h,v 1.1 2007/03/21 23:56:20 ca Exp $
+ */
+
+/*
+** sm_os_qnx.h -- platform definitions for QNX
+*/
+
+#define SM_CONF_SYS_CDEFS_H 1
+
+#ifndef SM_CONF_SETITIMER
+# define SM_CONF_SETITIMER 0
+#endif /* SM_CONF_SETITIMER */
diff --git a/contrib/sendmail/include/sm/sendmail.h b/contrib/sendmail/include/sm/sendmail.h
new file mode 100644
index 0000000..3008934
--- /dev/null
+++ b/contrib/sendmail/include/sm/sendmail.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2006 Sendmail, Inc. and its suppliers.
+ * All rights reserved.
+ *
+ * By using this file, you agree to the terms and conditions set
+ * forth in the LICENSE file which can be found at the top level of
+ * the sendmail distribution.
+ */
+
+/*
+** SENDMAIL.H -- MTA-specific definitions for sendmail.
+*/
+
+#ifndef _SM_SENDMAIL_H
+# define _SM_SENDMAIL_H 1
+
+/* "out of band" indicator */
+#define METAQUOTE ((unsigned char)0377) /* quotes the next octet */
+
+extern int dequote_internal_chars __P((char *, char *, int));
+extern char *quote_internal_chars __P((char *, char *, int *));
+extern char *str2prt __P((char *));
+
+#endif /* ! _SM_SENDMAIL_H */
diff --git a/contrib/sendmail/include/sm/tailq.h b/contrib/sendmail/include/sm/tailq.h
new file mode 100644
index 0000000..cfb09be
--- /dev/null
+++ b/contrib/sendmail/include/sm/tailq.h
@@ -0,0 +1,153 @@
+/* $OpenBSD: queue.h,v 1.30 2005/10/25 06:37:47 otto Exp $ */
+/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
+
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef SM_TAILQ_H_
+#define SM_TAILQ_H_
+
+/*
+ * This file is a modified copy of queue.h from a BSD system:
+ * we only need tail queues here.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ */
+
+/*
+ * Tail queue definitions.
+ */
+#define SM_TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; /* first element */ \
+ struct type **tqh_last; /* addr of last next element */ \
+}
+
+#define SM_TAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).tqh_first }
+
+#define SM_TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+
+/*
+ * tail queue access methods
+ */
+#define SM_TAILQ_FIRST(head) ((head)->tqh_first)
+#define SM_TAILQ_END(head) NULL
+#define SM_TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#define SM_TAILQ_LAST(head, headname) \
+ (*(((struct headname *)((head)->tqh_last))->tqh_last))
+/* XXX */
+#define SM_TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+#define SM_TAILQ_EMPTY(head) \
+ (SM_TAILQ_FIRST(head) == SM_TAILQ_END(head))
+
+#define SM_TAILQ_FOREACH(var, head, field) \
+ for((var) = SM_TAILQ_FIRST(head); \
+ (var) != SM_TAILQ_END(head); \
+ (var) = SM_TAILQ_NEXT(var, field))
+
+#define SM_TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for((var) = SM_TAILQ_LAST(head, headname); \
+ (var) != SM_TAILQ_END(head); \
+ (var) = SM_TAILQ_PREV(var, headname, field))
+
+/*
+ * Tail queue functions.
+ */
+#define SM_TAILQ_INIT(head) do { \
+ (head)->tqh_first = NULL; \
+ (head)->tqh_last = &(head)->tqh_first; \
+} while (0)
+
+#define SM_TAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+} while (0)
+
+#define SM_TAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.tqe_next = NULL; \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+} while (0)
+
+#define SM_TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+} while (0)
+
+#define SM_TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (0)
+
+#define SM_TAILQ_REMOVE(head, elm, field) do { \
+ if (((elm)->field.tqe_next) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+} while (0)
+
+#define SM_TAILQ_REPLACE(head, elm, elm2, field) do { \
+ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \
+ (elm2)->field.tqe_next->field.tqe_prev = \
+ &(elm2)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm2)->field.tqe_next; \
+ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
+ *(elm2)->field.tqe_prev = (elm2); \
+} while (0)
+
+#endif /* !SM_TAILQ_H_ */
OpenPOWER on IntegriCloud