|
|
f67e08 |
--- sendmail-8.14.4/cf/m4/proto.m4.orig 2011-01-11 20:02:14.000000000 -0700
|
|
|
f67e08 |
+++ sendmail-8.14.4/cf/m4/proto.m4 2011-01-11 20:02:14.000000000 -0700
|
|
|
f67e08 |
@@ -251,6 +251,9 @@ _OPTION(SevenBitInput, `confSEVEN_BIT_IN
|
|
|
f67e08 |
# 8-bit data handling
|
|
|
f67e08 |
_OPTION(EightBitMode, `confEIGHT_BIT_HANDLING', `pass8')
|
|
|
f67e08 |
|
|
|
f67e08 |
+# DSCP marking of traffic (IP_TOS)
|
|
|
f67e08 |
+_OPTION(InetQoS, `confINET_QOS', `none')
|
|
|
f67e08 |
+
|
|
|
f67e08 |
# wait for alias file rebuild (default units: minutes)
|
|
|
f67e08 |
_OPTION(AliasWait, `confALIAS_WAIT', `5m')
|
|
|
f67e08 |
|
|
|
f67e08 |
--- sendmail-8.14.4/cf/cf/submit.mc.orig 2011-01-11 20:02:14.000000000 -0700
|
|
|
f67e08 |
+++ sendmail-8.14.4/cf/cf/submit.mc 2011-01-11 20:02:14.000000000 -0700
|
|
|
f67e08 |
@@ -22,6 +22,8 @@ define(`__OSTYPE__',`')dnl dirty hack to
|
|
|
f67e08 |
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
|
|
|
f67e08 |
define(`confTIME_ZONE', `USE_TZ')dnl
|
|
|
f67e08 |
define(`confDONT_INIT_GROUPS', `True')dnl
|
|
|
f67e08 |
+dnl # If you're operating in a DSCP/RFC-4594 environment with QoS
|
|
|
f67e08 |
+dnl define(`confINET_QOS', `AF11')dnl
|
|
|
f67e08 |
define(`confPID_FILE', `/run/sm-client.pid')dnl
|
|
|
f67e08 |
dnl define(`confDIRECT_SUBMISSION_MODIFIERS',`C')dnl
|
|
|
f67e08 |
FEATURE(`use_ct_file')dnl
|
|
|
f67e08 |
--- sendmail-8.14.4/sendmail/sendmail.h.orig 2009-12-18 10:08:01.000000000 -0700
|
|
|
f67e08 |
+++ sendmail-8.14.4/sendmail/sendmail.h 2011-01-11 20:39:35.000000000 -0700
|
|
|
f67e08 |
@@ -2387,7 +2387,14 @@ EXTERN struct termescape TermEscape; /*
|
|
|
f67e08 |
EXTERN SOCKADDR ConnectOnlyTo; /* override connection address (for testing) */
|
|
|
f67e08 |
EXTERN SOCKADDR RealHostAddr; /* address of host we are talking to */
|
|
|
f67e08 |
extern const SM_EXC_TYPE_T EtypeQuickAbort; /* type of a QuickAbort exception */
|
|
|
f67e08 |
-
|
|
|
f67e08 |
+#if _FFR_QOS
|
|
|
f67e08 |
+# if !defined(SOL_IP) && defined(IPPROTO_IP)
|
|
|
f67e08 |
+# define SOL_IP IPPROTO_IP
|
|
|
f67e08 |
+# endif
|
|
|
f67e08 |
+# if defined(SOL_IP) && defined(IP_TOS)
|
|
|
f67e08 |
+EXTERN int InetQoS; /* QoS mapping */
|
|
|
f67e08 |
+# endif
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
|
|
|
f67e08 |
EXTERN int ConnectionRateWindowSize;
|
|
|
f67e08 |
#if STARTTLS && USE_OPENSSL_ENGINE
|
|
|
f67e08 |
--- sendmail-8.14.4/sendmail/conf.c.orig 2011-01-11 20:02:14.000000000 -0700
|
|
|
f67e08 |
+++ sendmail-8.14.4/sendmail/conf.c 2011-01-11 20:24:29.000000000 -0700
|
|
|
f67e08 |
@@ -6298,6 +6298,10 @@ char *FFRCompileOptions[] =
|
|
|
f67e08 |
#if _FFR_QF_PARANOIA
|
|
|
f67e08 |
"_FFR_QF_PARANOIA",
|
|
|
f67e08 |
#endif /* _FFR_QF_PARANOIA */
|
|
|
f67e08 |
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
|
|
|
f67e08 |
+ /* QoS */
|
|
|
f67e08 |
+ "_FFR_QOS",
|
|
|
f67e08 |
+#endif /* _FFR_QOS && defined(SOL_IP) && defined(IP_TOS) */
|
|
|
f67e08 |
#if _FFR_QUEUEDELAY
|
|
|
f67e08 |
/* Exponential queue delay; disabled in 8.13 since it isn't used. */
|
|
|
f67e08 |
"_FFR_QUEUEDELAY",
|
|
|
f67e08 |
--- sendmail-8.14.4/sendmail/daemon.c.orig 2009-12-17 18:12:40.000000000 -0700
|
|
|
f67e08 |
+++ sendmail-8.14.4/sendmail/daemon.c 2011-01-11 20:46:37.000000000 -0700
|
|
|
f67e08 |
@@ -104,6 +104,10 @@ static int NDaemons = 0; /* actual num
|
|
|
f67e08 |
|
|
|
f67e08 |
static time_t NextDiskSpaceCheck = 0;
|
|
|
f67e08 |
|
|
|
f67e08 |
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
|
|
|
f67e08 |
+int InetQoS = 0; /* none by default */
|
|
|
f67e08 |
+#endif /* _FFR_QOS && defined(SOL_IP) && defined(IP_TOS) */
|
|
|
f67e08 |
+
|
|
|
f67e08 |
/*
|
|
|
f67e08 |
** GETREQUESTS -- open mail IPC port and get requests.
|
|
|
f67e08 |
**
|
|
|
f67e08 |
@@ -1131,6 +1135,16 @@ opendaemonsocket(d, firsttime)
|
|
|
f67e08 |
(void) setsockopt(d->d_socket, SOL_SOCKET,
|
|
|
f67e08 |
SO_KEEPALIVE, (char *)&on, sizeof(on));
|
|
|
f67e08 |
|
|
|
f67e08 |
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
|
|
|
f67e08 |
+ if (InetQoS != 0x00
|
|
|
f67e08 |
+ && (d->d_addr.sa.sa_family == AF_INET
|
|
|
f67e08 |
+ || (d->d_addr.sin6.sin6_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(d->d_addr.sin6.sin6_addr.s6_addr32)))) {
|
|
|
f67e08 |
+ if (setsockopt(d->d_socket, SOL_IP,
|
|
|
f67e08 |
+ IP_TOS, (char *)&InetQoS, sizeof(InetQoS)) < 0)
|
|
|
f67e08 |
+ syserr("opendaemonsock: daemon %s: setsockopt(IP_TOS)", d->d_name);
|
|
|
f67e08 |
+ }
|
|
|
f67e08 |
+#endif /* _FFR_QOS && defined(SOL_IP) && defined(IP_TOS) */
|
|
|
f67e08 |
+
|
|
|
f67e08 |
#ifdef SO_RCVBUF
|
|
|
f67e08 |
if (d->d_tcprcvbufsize > 0)
|
|
|
f67e08 |
{
|
|
|
f67e08 |
@@ -2565,6 +2579,16 @@ gothostent:
|
|
|
f67e08 |
return EX_TEMPFAIL;
|
|
|
f67e08 |
}
|
|
|
f67e08 |
|
|
|
f67e08 |
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
|
|
|
f67e08 |
+ if (InetQoS != 0x00
|
|
|
f67e08 |
+ && (family == AF_INET
|
|
|
f67e08 |
+ || (family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(addr.sin6.sin6_addr.s6_addr32))))
|
|
|
f67e08 |
+ {
|
|
|
f67e08 |
+ if (setsockopt(s, SOL_IP, IP_TOS,
|
|
|
f67e08 |
+ (char *)&InetQoS, sizeof(InetQoS)) < 0)
|
|
|
f67e08 |
+ syserr("makeconnection: setsockopt(IP_TOS)");
|
|
|
f67e08 |
+ }
|
|
|
f67e08 |
+#endif /* _FFR_QOS && defined(SOL_IP) && defined(IP_TOS) */
|
|
|
f67e08 |
#ifdef SO_SNDBUF
|
|
|
f67e08 |
if (ClientSettings[family].d_tcpsndbufsize > 0)
|
|
|
f67e08 |
{
|
|
|
f67e08 |
--- sendmail-8.14.7/sendmail/readcf.c.orig 2013-03-15 18:54:12.000000000 +0100
|
|
|
f67e08 |
+++ sendmail-8.14.7/sendmail/readcf.c 2013-04-21 17:58:19.000000000 +0200
|
|
|
f67e08 |
@@ -18,6 +18,7 @@
|
|
|
f67e08 |
|
|
|
f67e08 |
#if NETINET || NETINET6
|
|
|
f67e08 |
# include <arpa/inet.h>
|
|
|
f67e08 |
+# include <netinet/ip.h>
|
|
|
f67e08 |
#endif /* NETINET || NETINET6 */
|
|
|
f67e08 |
|
|
|
f67e08 |
|
|
|
f67e08 |
@@ -2280,8 +2281,8 @@
|
|
|
f67e08 |
# define O_RCPTTHROTDELAY 0xe6
|
|
|
f67e08 |
{ "BadRcptThrottleDelay", O_RCPTTHROTDELAY, OI_SAFE },
|
|
|
f67e08 |
#endif /* _FFR_RCPTTHROTDELAY */
|
|
|
f67e08 |
-#if 0 && _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
|
|
|
f67e08 |
-# define O_INETQOS 0xe7 /* reserved for FFR_QOS */
|
|
|
f67e08 |
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
|
|
|
f67e08 |
+# define O_INETQOS 0xe7
|
|
|
f67e08 |
{ "InetQoS", O_INETQOS, OI_NONE },
|
|
|
f67e08 |
#endif
|
|
|
f67e08 |
#if STARTTLS && _FFR_FIPSMODE
|
|
|
f67e08 |
@@ -2389,6 +2390,77 @@
|
|
|
f67e08 |
};
|
|
|
f67e08 |
#endif /* STARTTLS && _FFR_TLS_1 */
|
|
|
f67e08 |
|
|
|
f67e08 |
+#ifdef O_INETQOS
|
|
|
f67e08 |
+static struct qosmap
|
|
|
f67e08 |
+{
|
|
|
f67e08 |
+ char *name; /* name of the setting */
|
|
|
f67e08 |
+ int value; /* corresponding setsockopt() value */
|
|
|
f67e08 |
+} QoSMap[] = {
|
|
|
f67e08 |
+#ifdef IPTOS_CLASS_CS0
|
|
|
f67e08 |
+ { "CS0", IPTOS_CLASS_CS0 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_CLASS_CS1
|
|
|
f67e08 |
+ { "CS1", IPTOS_CLASS_CS1 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF11
|
|
|
f67e08 |
+ { "AF11", IPTOS_DSCP_AF11 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF12
|
|
|
f67e08 |
+ { "AF12", IPTOS_DSCP_AF12 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF13
|
|
|
f67e08 |
+ { "AF13", IPTOS_DSCP_AF13 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_CLASS_CS2
|
|
|
f67e08 |
+ { "CS2", IPTOS_CLASS_CS2 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF21
|
|
|
f67e08 |
+ { "AF21", IPTOS_DSCP_AF21 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF22
|
|
|
f67e08 |
+ { "AF22", IPTOS_DSCP_AF22 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF23
|
|
|
f67e08 |
+ { "AF23", IPTOS_DSCP_AF23 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_CLASS_CS3
|
|
|
f67e08 |
+ { "CS3", IPTOS_CLASS_CS3 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF31
|
|
|
f67e08 |
+ { "AF31", IPTOS_DSCP_AF31 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF32
|
|
|
f67e08 |
+ { "AF32", IPTOS_DSCP_AF32 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF33
|
|
|
f67e08 |
+ { "AF33", IPTOS_DSCP_AF33 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_CLASS_CS4
|
|
|
f67e08 |
+ { "CS4", IPTOS_CLASS_CS4 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF41
|
|
|
f67e08 |
+ { "AF41", IPTOS_DSCP_AF41 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF42
|
|
|
f67e08 |
+ { "AF42", IPTOS_DSCP_AF42 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_DSCP_AF43
|
|
|
f67e08 |
+ { "AF43", IPTOS_DSCP_AF43 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_CLASS_CS5
|
|
|
f67e08 |
+ { "CS5", IPTOS_CLASS_CS5 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_CLASS_CS6
|
|
|
f67e08 |
+ { "CS6", IPTOS_CLASS_CS6 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+#ifdef IPTOS_CLASS_CS7
|
|
|
f67e08 |
+ { "CS7", IPTOS_CLASS_CS7 },
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+ { "none", 0x00 },
|
|
|
f67e08 |
+ { NULL, 0 }
|
|
|
f67e08 |
+};
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+
|
|
|
f67e08 |
|
|
|
f67e08 |
# define CANONIFY(val)
|
|
|
f67e08 |
|
|
|
f67e08 |
@@ -4035,6 +4107,33 @@
|
|
|
f67e08 |
break;
|
|
|
f67e08 |
#endif /* _FFR_REJECT_NUL_BYTE */
|
|
|
f67e08 |
|
|
|
f67e08 |
+#ifdef O_INETQOS
|
|
|
f67e08 |
+ case O_INETQOS:
|
|
|
f67e08 |
+ {
|
|
|
f67e08 |
+ struct qosmap *qmp;
|
|
|
f67e08 |
+ InetQoS = -1;
|
|
|
f67e08 |
+
|
|
|
f67e08 |
+ for (qmp = QoSMap; qmp->name != NULL; ++qmp) {
|
|
|
f67e08 |
+ if (!strcmp(val, qmp->name)) {
|
|
|
f67e08 |
+ InetQoS = qmp->value;
|
|
|
f67e08 |
+ break;
|
|
|
f67e08 |
+ }
|
|
|
f67e08 |
+ }
|
|
|
f67e08 |
+
|
|
|
f67e08 |
+ /*
|
|
|
f67e08 |
+ ** we could allow writing it as a hex value, but
|
|
|
f67e08 |
+ ** we don't at this time.
|
|
|
f67e08 |
+ **/
|
|
|
f67e08 |
+ if (qmp->name == NULL) {
|
|
|
f67e08 |
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
|
|
|
f67e08 |
+ "Warning: Option: %s unknown parameter '%s'\n",
|
|
|
f67e08 |
+ OPTNAME, val);
|
|
|
f67e08 |
+ break;
|
|
|
f67e08 |
+ }
|
|
|
f67e08 |
+ break;
|
|
|
f67e08 |
+ }
|
|
|
f67e08 |
+#endif
|
|
|
f67e08 |
+
|
|
|
f67e08 |
default:
|
|
|
f67e08 |
if (tTd(37, 1))
|
|
|
f67e08 |
{
|