--- sendmail-8.12.9/include//libmilter/mfapi.h.orig Fri Nov 6 01:57:08 2009 +++ sendmail-8.12.9/include//libmilter/mfapi.h Sun Jan 5 20:00:40 2014 @@ -17,6 +17,11 @@ #ifndef _LIBMILTER_MFAPI_H # define _LIBMILTER_MFAPI_H 1 +/* Only need to export C interface if used by C++ source code */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + #ifndef SMFI_VERSION # if _FFR_MDS_NEGOTIATE # define SMFI_VERSION 0x01000002 /* libmilter version number */ @@ -35,16 +40,11 @@ # include # include -#include "libmilter/mfdef.h" +#include # 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 */ --- sendmail-8.12.9/include/libmilter/mfdef.h.orig Fri Nov 6 01:57:08 2009 +++ sendmail-8.12.9/include/libmilter/mfdef.h Sun Jan 5 20:05:21 2014 @@ -17,6 +17,10 @@ #ifndef _LIBMILTER_MFDEF_H # define _LIBMILTER_MFDEF_H 1 +#ifdef __cplusplus +extern "C" { +#endif + #ifndef SMFI_PROT_VERSION # define SMFI_PROT_VERSION 6 /* MTA - libmilter protocol version */ #endif /* SMFI_PROT_VERSION */ @@ -123,4 +127,8 @@ # define SMFIP_TEST 0x80000000L #endif /* _FFR_MILTER_CHECK */ +#ifdef __cplusplus +} +#endif + #endif /* !_LIBMILTER_MFDEF_H */ --- sendmail-8.12.9/libmilter/README.orig Thu Jun 29 19:10:16 2006 +++ sendmail-8.12.9/libmilter/README Sun Jan 5 20:46:18 2014 @@ -6,14 +6,14 @@ This README file describes the steps needed to compile and run a filter, through reference to a sample filter which is attached at the end of this -file. It is necessary to first build libmilter.a, which can be done by -issuing the './Build' command in SRCDIR/libmilter . +file. Starting with 8.13 sendmail is compiled by default with support for the milter API. Note: if you want to write a milter in Java, then see -http://sendmail-jilter.sourceforge.net/ +http://sendmail-jilter.sourceforge.net/ or +http://iws.cs.uni-magdeburg.de/~elkner/milter4j.tgz +----------------+ | SECURITY HINTS | @@ -41,23 +41,13 @@ +-------------------+ The following command presumes that the sample code from the end of this -README is saved to a file named 'sample.c' and built in the local platform- -specific build subdirectory (SRCDIR/obj.*/libmilter). +README is saved to a file named 'sample.c'. - cc -I../../include -o sample sample.c libmilter.a ../libsm/libsm.a -pthread + cc -m64 -D_REENTRANT -o sample sample.c -lmilter -It is recommended that you build your filters in a location outside of -the sendmail source tree. Modify the compiler include references (-I) -and the library locations accordingly. Also, some operating systems may -require additional libraries. For example, SunOS 5.X requires '-lresolv --lsocket -lnsl'. Depending on your operating system you may need a library -instead of the option -pthread, e.g., -lpthread. - Filters must be thread-safe! Many operating systems now provide support for POSIX threads in the standard C libraries. The compiler flag to link with -threading support differs according to the compiler and linker used. Check -the Makefile in your appropriate obj.*/libmilter build subdirectory if you -are unsure of the local flag used. +threading support differs according to the compiler and linker used. Note that since filters use threads, it may be necessary to alter per process limits in your filter. For example, you might look at using