summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/sendmail/include/libmilter
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.sbin/sendmail/include/libmilter')
-rw-r--r--gnu/usr.sbin/sendmail/include/libmilter/mfapi.h85
-rw-r--r--gnu/usr.sbin/sendmail/include/libmilter/mfdef.h34
-rw-r--r--gnu/usr.sbin/sendmail/include/libmilter/milter.h6
3 files changed, 87 insertions, 38 deletions
diff --git a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
index a385012566e..957726f4168 100644
--- a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
+++ b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2004 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.
*
*
- * $Sendmail: mfapi.h,v 8.44.2.4 2003/10/20 21:51:49 msk Exp $
+ * $Sendmail: mfapi.h,v 8.58 2004/04/29 18:04:48 gshapiro Exp $
*/
/*
@@ -17,14 +17,23 @@
#ifndef _LIBMILTER_MFAPI_H
# define _LIBMILTER_MFAPI_H 1
-# include <sys/types.h>
+#ifndef SMFI_VERSION
+# define SMFI_VERSION 2 /* version number */
+#endif /* ! SMFI_VERSION */
+# include <sys/types.h>
# include <sys/socket.h>
-# include "libmilter/mfdef.h"
+
+#include "libmilter/mfdef.h"
# define LIBMILTER_API extern
+/* Only need to export C interface if used by C++ source code */
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#ifndef _SOCK_ADDR
# define _SOCK_ADDR struct sockaddr
#endif /* ! _SOCK_ADDR */
@@ -66,6 +75,19 @@ typedef int sfsistat;
# endif /* __STDC__ */
#endif /* __P */
+#if SM_CONF_STDBOOL_H
+# include <stdbool.h>
+#else /* SM_CONF_STDBOOL_H */
+# ifndef __cplusplus
+# ifndef bool
+# ifndef __bool_true_false_are_defined
+typedef int bool;
+# define __bool_true_false_are_defined 1
+# endif /* ! __bool_true_false_are_defined */
+# endif /* bool */
+# endif /* ! __cplusplus */
+#endif /* SM_CONF_STDBOOL_H */
+
/*
** structure describing one milter
*/
@@ -105,11 +127,19 @@ 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 */
+
+#if SMFI_VERSION > 3
+ /* any unrecognized or unimplemented command filter */
+ sfsistat (*xxfi_data) SM__P((SMFICTX *));
+#endif /* SMFI_VERSION > 3 */
};
-#if _FFR_SMFI_OPENSOCKET
LIBMILTER_API int smfi_opensocket __P((bool));
-#endif /* _FFR_SMFI_OPENSOCKET */
LIBMILTER_API int smfi_register __P((struct smfiDesc));
LIBMILTER_API int smfi_main __P((void));
LIBMILTER_API int smfi_setbacklog __P((int));
@@ -118,8 +148,6 @@ LIBMILTER_API int smfi_settimeout __P((int));
LIBMILTER_API int smfi_setconn __P((char *));
LIBMILTER_API int smfi_stop __P((void));
-#define SMFI_VERSION 2 /* version number */
-
/*
** What the filter might do -- values to be ORed together for
** smfiDesc.xxfi_flags.
@@ -132,9 +160,7 @@ LIBMILTER_API int smfi_stop __P((void));
#define SMFIF_ADDRCPT 0x00000004L /* filter may add recipients */
#define SMFIF_DELRCPT 0x00000008L /* filter may delete recipients */
#define SMFIF_CHGHDRS 0x00000010L /* filter may change/delete headers */
-#if _FFR_QUARANTINE
-# define SMFIF_QUARANTINE 0x00000020L /* filter may quarantine envelope */
-#endif /* _FFR_QUARANTINE */
+#define SMFIF_QUARANTINE 0x00000020L /* filter may quarantine envelope */
/*
** Continue processing message/connection.
@@ -230,6 +256,16 @@ extern sfsistat xxfi_envrcpt __P((SMFICTX *, char **));
** Later arguments are the ESMTP arguments.
*/
+/* unknown command filter */
+
+extern sfsistat *xxfi_unknown __P((SMFICTX *, char *));
+
+/*
+** xxfi_unknown(ctx, arg) Invoked when SMTP command is not recognized or not
+** implemented.
+** char *arg; Null-terminated SMTP command
+*/
+
/* header filter */
extern sfsistat xxfi_header __P((SMFICTX *, char *, char *));
@@ -311,14 +347,12 @@ LIBMILTER_API char * smfi_getsymval __P((SMFICTX *, char *));
LIBMILTER_API int smfi_setreply __P((SMFICTX *, char *, char *, char *));
-#if _FFR_MULTILINE
/*
** Alternatively, smfi_setmlreply can be called if a multi-line SMTP reply
** is needed.
*/
LIBMILTER_API int smfi_setmlreply __P((SMFICTX *, const char *, const char *, ...));
-#endif /* _FFR_MULTILINE */
/*
** Set the specific reply code to be used in response to the active
@@ -342,10 +376,9 @@ LIBMILTER_API int smfi_setmlreply __P((SMFICTX *, const char *, const char *, ..
LIBMILTER_API int smfi_addheader __P((SMFICTX *, char *, char *));
/*
-** Add a header to the message. This header is not passed to other
-** filters. It is not checked for standards compliance; the mail filter
-** must ensure that no protocols are violated as a result of adding this
-** header.
+** Add a header to the message. It is not checked for standards
+** compliance; the mail filter must ensure that no protocols are violated
+** as a result of adding this header.
**
** SMFICTX *ctx; Opaque context structure
** char *headerf; Header field name
@@ -365,6 +398,19 @@ LIBMILTER_API int smfi_chgheader __P((SMFICTX *, char *, int, char *));
** char *headerv; New header field value (empty for delete header)
*/
+LIBMILTER_API int smfi_insheader __P((SMFICTX *, int, char *, char *));
+
+/*
+** Insert a header into the message. It is not checked for standards
+** compliance; the mail filter must ensure that no protocols are violated
+** as a result of adding this header.
+**
+** SMFICTX *ctx; Opaque context structure
+** int idx; index into the header list where the insertion should happen
+** char *headerh; Header field name
+** char *headerv; Header field value
+*/
+
LIBMILTER_API int smfi_addrcpt __P((SMFICTX *, char *));
/*
@@ -413,7 +459,6 @@ LIBMILTER_API int smfi_replacebody __P((SMFICTX *, unsigned char *, int));
** xxfi_abort is called. This can be used to reset state.
*/
-#if _FFR_QUARANTINE
/*
** Quarantine an envelope
**
@@ -422,7 +467,6 @@ LIBMILTER_API int smfi_replacebody __P((SMFICTX *, unsigned char *, int));
*/
LIBMILTER_API int smfi_quarantine __P((SMFICTX *ctx, char *reason));
-#endif /* _FFR_QUARANTINE */
/*
** Connection-private data (specific to an SMTP connection) can be
@@ -441,5 +485,8 @@ LIBMILTER_API int smfi_setpriv __P((SMFICTX *, void *));
LIBMILTER_API void *smfi_getpriv __P((SMFICTX *));
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
#endif /* ! _LIBMILTER_MFAPI_H */
diff --git a/gnu/usr.sbin/sendmail/include/libmilter/mfdef.h b/gnu/usr.sbin/sendmail/include/libmilter/mfdef.h
index 6d15611b238..faca3ecdc70 100644
--- a/gnu/usr.sbin/sendmail/include/libmilter/mfdef.h
+++ b/gnu/usr.sbin/sendmail/include/libmilter/mfdef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2004 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.
*
*
- * $Sendmail: mfdef.h,v 8.11.2.1 2002/11/11 23:22:28 ca Exp $
+ * $Sendmail: mfdef.h,v 8.20 2004/06/16 17:45:49 ca Exp $
*/
/*
@@ -24,11 +24,7 @@
/* These apply to SMFIF_* flags */
#define SMFI_V1_ACTS 0x0000000FL /* The actions of V1 filter */
-#if _FFR_QUARANTINE
-# define SMFI_V2_ACTS 0x0000003FL /* The actions of V2 filter */
-#else /* _FFR_QUARANTINE */
-# define SMFI_V2_ACTS 0x0000001FL /* The actions of V2 filter */
-#endif /* _FFR_QUARANTINE */
+#define SMFI_V2_ACTS 0x0000003FL /* The actions of V2 filter */
#define SMFI_CURR_ACTS SMFI_V2_ACTS /* The current version */
/* address families */
@@ -50,6 +46,12 @@
# 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 */
/* actions (replies) */
# define SMFIR_ADDRCPT '+' /* add recipient */
@@ -62,14 +64,11 @@
# define SMFIR_PROGRESS 'p' /* progress */
# define SMFIR_REJECT 'r' /* reject */
# define SMFIR_TEMPFAIL 't' /* tempfail */
-# if _FFR_MILTER_421
-# define SMFIR_SHUTDOWN '4' /* 421: shutdown (internal to MTA) */
-# endif /* _FFR_MILTER_421 */
+# 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 */
-# if _FFR_QUARANTINE
-# define SMFIR_QUARANTINE 'q' /* quarantine */
-# endif /* _FFR_QUARANTINE */
+# define SMFIR_QUARANTINE 'q' /* quarantine */
/* What the MTA can send/filter wants in protocol */
# define SMFIP_NOCONNECT 0x00000001L /* MTA should not send connect info */
@@ -79,9 +78,16 @@
# 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 SMFI_V1_PROT 0x0000003FL /* The protocol of V1 filter */
# define SMFI_V2_PROT 0x0000007FL /* The protocol of V2 filter */
-# define SMFI_CURR_PROT SMFI_V2_PROT /* The current version */
+# if _FFR_MILTER_NOHDR_RESP
+# define SMFI_CURR_PROT 0x000000FFL /* The current version */
+# else /* _FFR_MILTER_NOHDR_RESP */
+# define SMFI_CURR_PROT SMFI_V2_PROT /* The current version */
+# endif /* _FFR_MILTER_NOHDR_RESP */
#endif /* !_LIBMILTER_MFDEF_H */
diff --git a/gnu/usr.sbin/sendmail/include/libmilter/milter.h b/gnu/usr.sbin/sendmail/include/libmilter/milter.h
index 832096de886..e7d5eb0249a 100644
--- a/gnu/usr.sbin/sendmail/include/libmilter/milter.h
+++ b/gnu/usr.sbin/sendmail/include/libmilter/milter.h
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Sendmail: milter.h,v 8.37.2.3 2003/12/02 00:19:51 msk Exp $
+ * $Sendmail: milter.h,v 8.39 2003/12/02 00:21:42 msk Exp $
*/
/*
@@ -25,11 +25,7 @@
typedef pthread_t sthread_t;
typedef int socket_t;
-#if _FFR_MILTER_MACROS_EOM
# define MAX_MACROS_ENTRIES 5 /* max size of macro pointer array */
-#else /* _FFR_MILTER_MACROS_EOM */
-# define MAX_MACROS_ENTRIES 4 /* max size of macro pointer array */
-#endif /* _FFR_MILTER_MACROS_EOM */
/*
** context for milter