diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2008-05-04 18:34:06 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2008-05-04 18:34:06 +0000 |
commit | e34f09884a7068658966cd935b293f1aa9a270fe (patch) | |
tree | 34d98fafbab9818a6c780111ac5963c05a40eb32 /gnu | |
parent | 433bcb0f720364f69046d40cd22dca62aef4d2c0 (diff) |
Update to sendmail-8.14.3
Diffstat (limited to 'gnu')
59 files changed, 1066 insertions, 601 deletions
diff --git a/gnu/usr.sbin/sendmail/CACerts b/gnu/usr.sbin/sendmail/CACerts index 6093d2f5b3c..37c09635c52 100644 --- a/gnu/usr.sbin/sendmail/CACerts +++ b/gnu/usr.sbin/sendmail/CACerts @@ -1,4 +1,4 @@ -# $Sendmail: CACerts,v 8.1 2004/03/01 22:05:47 ca Exp $ +# $Sendmail: CACerts,v 8.3 2007/06/11 22:04:46 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. @@ -78,73 +78,6 @@ Certificate: Version: 3 (0x2) Serial Number: 0 (0x0) Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=California, L=Emeryville, O=gshapiro.net, CN=Certificate Authority/emailAddress=certificates@gshapiro.net - Validity - Not Before: Jan 1 04:39:54 2002 GMT - Not After : Dec 31 04:39:54 2006 GMT - Subject: C=US, ST=California, L=Emeryville, O=gshapiro.net, CN=Certificate Authority/emailAddress=certificates@gshapiro.net - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:aa:dd:a2:fe:3b:fa:2f:5c:3d:f1:e1:d4:1d:55: - 04:27:6b:01:62:00:d7:02:cb:74:47:69:84:d7:c6: - c5:71:55:79:35:3a:a8:ce:de:48:23:53:80:3c:cd: - 54:2e:e9:fe:b1:76:5a:be:cb:fd:2d:dc:a3:36:c5: - c7:1e:4e:ef:76:f0:55:8f:a0:a5:f8:07:c5:52:1d: - a2:42:81:4d:8a:c8:42:3f:f3:01:80:f9:46:35:a6: - bc:c0:9b:9f:33:8b:49:9b:1d:87:8f:19:48:15:21: - 23:57:df:6e:4d:03:ed:ae:9f:0b:91:b7:a9:47:66: - f1:0d:1b:1c:5d:b4:57:60:c7 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - A0:6D:E0:06:AF:61:94:B4:C6:84:15:B4:8B:74:22:67:4A:43:60:CA - X509v3 Authority Key Identifier: - keyid:A0:6D:E0:06:AF:61:94:B4:C6:84:15:B4:8B:74:22:67:4A:43:60:CA - DirName:/C=US/ST=California/L=Emeryville/O=gshapiro.net/CN=Certificate Authority/emailAddress=certificates@gshapiro.net - serial:00 - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 87:27:d2:2a:3a:dc:04:cd:ef:e8:7b:1c:34:47:2e:13:34:a5: - 08:f9:4d:df:d8:e1:6d:e6:9a:db:38:ee:20:6d:4a:ae:6f:1e: - bc:71:61:a4:b4:d6:40:24:ee:65:ca:e9:81:5a:ef:ee:62:57: - 70:05:46:91:6b:d0:c6:a6:e9:38:65:ae:ea:50:b3:5c:27:c4: - 7a:bd:95:8c:cb:45:ef:fc:fc:99:e5:6a:61:c3:44:77:d8:1f: - d6:b4:17:44:15:9a:bc:26:5b:ec:4e:29:5d:fd:cf:61:f3:be: - 91:a4:3b:51:e6:73:5b:17:82:9d:5a:56:2c:63:c2:f1:d6:a2: - 4c:5a ------BEGIN CERTIFICATE----- -MIIDoTCCAwqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBmDELMAkGA1UEBhMCVVMx -EzARBgNVBAgTCkNhbGlmb3JuaWExEzARBgNVBAcTCkVtZXJ5dmlsbGUxFTATBgNV -BAoTDGdzaGFwaXJvLm5ldDEeMBwGA1UEAxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5 -MSgwJgYJKoZIhvcNAQkBFhljZXJ0aWZpY2F0ZXNAZ3NoYXBpcm8ubmV0MB4XDTAy -MDEwMTA0Mzk1NFoXDTA2MTIzMTA0Mzk1NFowgZgxCzAJBgNVBAYTAlVTMRMwEQYD -VQQIEwpDYWxpZm9ybmlhMRMwEQYDVQQHEwpFbWVyeXZpbGxlMRUwEwYDVQQKEwxn -c2hhcGlyby5uZXQxHjAcBgNVBAMTFUNlcnRpZmljYXRlIEF1dGhvcml0eTEoMCYG -CSqGSIb3DQEJARYZY2VydGlmaWNhdGVzQGdzaGFwaXJvLm5ldDCBnzANBgkqhkiG -9w0BAQEFAAOBjQAwgYkCgYEAqt2i/jv6L1w98eHUHVUEJ2sBYgDXAst0R2mE18bF -cVV5NTqozt5II1OAPM1ULun+sXZavsv9LdyjNsXHHk7vdvBVj6Cl+AfFUh2iQoFN -ishCP/MBgPlGNaa8wJufM4tJmx2HjxlIFSEjV99uTQPtrp8LkbepR2bxDRscXbRX -YMcCAwEAAaOB+DCB9TAdBgNVHQ4EFgQUoG3gBq9hlLTGhBW0i3QiZ0pDYMowgcUG -A1UdIwSBvTCBuoAUoG3gBq9hlLTGhBW0i3QiZ0pDYMqhgZ6kgZswgZgxCzAJBgNV -BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRMwEQYDVQQHEwpFbWVyeXZpbGxl -MRUwEwYDVQQKEwxnc2hhcGlyby5uZXQxHjAcBgNVBAMTFUNlcnRpZmljYXRlIEF1 -dGhvcml0eTEoMCYGCSqGSIb3DQEJARYZY2VydGlmaWNhdGVzQGdzaGFwaXJvLm5l -dIIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GBAIcn0io63ATN7+h7 -HDRHLhM0pQj5Td/Y4W3mmts47iBtSq5vHrxxYaS01kAk7mXK6YFa7+5iV3AFRpFr -0Mam6ThlrupQs1wnxHq9lYzLRe/8/JnlamHDRHfYH9a0F0QVmrwmW+xOKV39z2Hz -vpGkO1Hmc1sXgp1aVixjwvHWokxa ------END CERTIFICATE----- - - -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: md5WithRSAEncryption Issuer: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu Validity Not Before: May 12 00:40:50 2000 GMT @@ -210,93 +143,94 @@ xBJlUbs98fcltM0L9lt6YSWtBgoBVdxxBSkNc+kwUb7T4bKJ/A8o9wZ1lhs0deAH Certificate: Data: Version: 3 (0x2) - Serial Number: 0 (0x0) + Serial Number: + fa:7c:2c:80:29:3f:c2:64 Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2003/emailAddress=ca+ca-rsa2003@esmtp.org + Issuer: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2007/emailAddress=ca+ca-rsa2007@esmtp.org Validity - Not Before: Aug 7 15:56:45 2003 GMT - Not After : Aug 6 15:56:45 2006 GMT - Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2003/emailAddress=ca+ca-rsa2003@esmtp.org + Not Before: May 4 02:07:56 2007 GMT + Not After : May 3 02:07:56 2010 GMT + Subject: C=US, ST=California, L=Berkeley, O=Endmail Org, OU=MTA, CN=Claus Assmann CA RSA 2007/emailAddress=ca+ca-rsa2007@esmtp.org Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): - 00:aa:37:0f:09:a9:1c:e3:1a:0c:fe:bd:6c:37:a4: - cf:87:db:af:6b:b4:19:d4:11:db:c6:56:ca:39:80: - c6:a4:38:b0:bc:ac:7e:be:71:30:86:2c:dc:fa:b5: - fd:58:23:a0:c1:ad:11:53:85:ca:fb:e6:d8:7e:28: - eb:84:3b:cd:a3:fa:28:a5:cb:c7:b2:54:99:3e:40: - 2a:27:43:4b:0c:26:4b:af:97:3d:92:82:d9:eb:2c: - 7f:77:fd:b8:cd:7e:1e:04:81:17:3c:e2:44:68:ce: - 88:66:02:90:24:35:24:c4:4c:ad:77:04:1a:3a:d5: - 59:28:28:03:da:03:9d:f4:2e:52:6e:b5:36:96:4b: - 14:f8:fc:8e:c6:d3:9b:e2:80:90:8b:71:d7:d0:5c: - 43:b2:49:f1:5a:26:f3:5d:9e:3b:01:98:db:e3:ed: - 5e:8d:dd:cf:aa:68:9d:0b:c9:e2:4e:fc:16:44:72: - 93:07:62:18:05:c1:47:81:3c:3d:e4:e4:22:da:2c: - d6:4a:44:52:06:7a:83:b5:e9:52:38:97:2f:75:a6: - 5c:6f:87:8a:8d:83:f4:d0:04:a5:34:18:5e:a1:06: - 16:b3:54:ce:64:47:ca:70:56:a3:6f:b9:7f:af:91: - 76:78:70:b4:ab:ae:8e:d5:22:26:57:b1:ba:e7:4b: - 18:21 + 00:b0:28:91:31:af:82:ce:72:ef:36:ab:7d:e9:b1: + f5:77:66:38:4b:38:1f:5f:3d:12:d3:c8:fd:9a:f4: + d4:f6:b8:90:f9:26:5f:29:f7:43:f9:34:ec:65:62: + 01:bb:64:f1:5d:ea:75:04:3d:92:65:60:a2:06:62: + fa:88:ca:d8:20:50:c8:1e:38:53:b5:18:dd:b7:bd: + c7:08:35:4c:d9:dc:c6:97:56:37:b6:65:33:74:5a: + b2:c3:85:08:2b:b7:26:70:ff:38:02:1a:67:6a:d0: + 49:18:10:4b:f8:db:af:06:9c:b1:a8:82:a1:b1:75: + d2:52:9b:53:0c:ca:a7:e3:15:38:79:6d:a1:f5:ef: + 7c:8b:fd:bd:04:78:f9:e8:1e:b9:92:ea:74:d7:45: + 1e:4c:c8:bd:f4:5c:fc:1a:7f:e7:31:c6:ab:cb:78: + c7:4d:2f:b5:72:10:35:27:4a:1a:fa:53:19:f8:a7: + 59:63:eb:e9:15:ab:dc:71:69:8c:42:1c:96:4e:89: + 80:66:c9:9e:21:d5:3d:08:19:74:a5:f5:07:a0:ae: + de:79:af:fd:42:c2:79:7e:8c:f8:39:22:3b:c3:c4: + 58:3b:d0:0d:e6:a9:11:b6:a2:cd:2e:e5:16:66:fd: + 7e:65:33:94:b0:36:80:27:f5:80:76:a9:e5:df:f2: + cf:ef Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 3A:12:03:DB:0F:9E:28:45:A6:34:8D:38:AB:BA:47:8C:2A:A0:E4:2E + B2:49:6B:52:45:EE:90:36:D2:79:47:03:33:D9:A0:BA:80:50:DA:1C X509v3 Authority Key Identifier: - keyid:3A:12:03:DB:0F:9E:28:45:A6:34:8D:38:AB:BA:47:8C:2A:A0:E4:2E - DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2003/emailAddress=ca+ca-rsa2003@esmtp.org - serial:00 + keyid:B2:49:6B:52:45:EE:90:36:D2:79:47:03:33:D9:A0:BA:80:50:DA:1C + DirName:/C=US/ST=California/L=Berkeley/O=Endmail Org/OU=MTA/CN=Claus Assmann CA RSA 2007/emailAddress=ca+ca-rsa2007@esmtp.org + serial:FA:7C:2C:80:29:3F:C2:64 X509v3 Basic Constraints: - CA:TRUE + CA:TRUE X509v3 Subject Alternative Name: - email:ca+ca-rsa2003@esmtp.org + email:ca+ca-rsa2007@esmtp.org X509v3 Issuer Alternative Name: - email:ca+ca-rsa2003@esmtp.org + email:ca+ca-rsa2007@esmtp.org Signature Algorithm: md5WithRSAEncryption - 96:83:b6:54:93:df:38:d0:48:a7:a1:c8:08:c9:0f:e9:80:05: - e3:7e:c3:61:51:88:7b:7a:bb:24:b0:69:a3:22:e4:98:38:da: - c8:c3:eb:52:70:63:e2:66:f2:59:ef:56:be:aa:7c:87:6e:94: - 85:d4:71:ba:35:f7:ee:d0:6e:52:1d:1f:e4:fd:2f:e2:70:31: - 5d:b7:8b:13:cc:70:10:21:fa:34:29:8f:8d:d8:4a:c7:0f:b2: - 36:e7:1e:1e:46:d1:11:84:80:7c:bb:24:c4:63:be:2a:24:53: - 74:0c:89:e0:6a:f4:08:63:bf:54:d3:0a:d9:fc:fe:6c:de:4f: - 97:61:08:a0:10:92:eb:af:06:ec:50:86:c4:cc:6b:31:32:60: - 25:7a:09:47:f8:42:7a:a2:d5:90:fa:48:be:bf:0a:e1:03:b8: - 56:24:b9:12:e9:ba:09:30:47:be:a5:8e:a2:92:a4:dc:a6:a7: - c6:29:39:65:6e:64:4a:1b:b2:c3:07:29:f5:c0:7e:78:e0:22: - 9b:98:d4:87:91:ca:e1:66:9d:2f:70:f1:4c:a5:8e:2e:68:52: - b3:bd:95:76:56:40:0e:46:47:e4:b3:ec:aa:3c:e8:86:96:5a: - ed:fa:c9:10:95:53:04:13:71:01:91:ce:cd:3a:51:c6:30:e9: - 48:49:64:a3 + 98:98:7c:d3:d0:5b:72:47:15:e6:22:68:bb:78:0e:78:66:e9: + 56:16:d8:bc:9d:5a:dc:27:29:fb:91:2d:6a:21:35:18:56:b4: + 4f:2a:09:c0:08:6f:9a:59:2b:2e:72:9a:fb:50:ba:c7:a9:91: + a0:f9:6c:be:cf:78:42:43:02:70:53:97:ba:6a:e3:da:17:e8: + 1f:c7:3a:5b:e7:bc:eb:e5:24:4c:f5:cf:61:34:1e:20:ed:17: + 63:ef:81:d3:9e:25:fe:cc:05:19:cc:8a:82:c9:4c:3a:b5:6b: + 49:51:76:46:02:aa:60:bb:c4:b9:61:48:33:da:79:8d:46:a3: + 06:20:98:f3:b2:db:3b:ad:c9:1d:0e:97:3d:b7:14:19:d3:7d: + 04:8b:6a:81:e0:11:5b:e1:35:a3:ff:2f:11:86:1c:31:85:7a: + fd:3f:36:ef:99:25:46:2e:b0:cb:43:45:4a:ec:be:d3:3f:a4: + 77:9b:79:cc:ce:92:63:a5:d9:ed:db:a0:9d:5d:7c:d7:80:f6: + c9:41:fb:02:96:8e:fd:f3:da:05:9d:81:a7:25:da:26:35:3b: + a9:0c:8c:f5:a7:5d:48:ec:87:c7:7a:60:51:76:f2:de:9b:14: + 2b:55:8a:43:df:99:19:f3:eb:e7:03:e6:a7:a2:a2:28:dd:d5: + 07:6a:3f:f7 -----BEGIN CERTIFICATE----- -MIIFFzCCA/+gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBpTELMAkGA1UEBhMCVVMx -EzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCEJlcmtlbGV5MRQwEgYDVQQK -EwtFbmRtYWlsIE9yZzEMMAoGA1UECxMDTVRBMSIwIAYDVQQDExlDbGF1cyBBc3Nt -YW5uIENBIFJTQSAyMDAzMSYwJAYJKoZIhvcNAQkBFhdjYStjYS1yc2EyMDAzQGVz -bXRwLm9yZzAeFw0wMzA4MDcxNTU2NDVaFw0wNjA4MDYxNTU2NDVaMIGlMQswCQYD +MIIFJzCCBA+gAwIBAgIJAPp8LIApP8JkMA0GCSqGSIb3DQEBBAUAMIGlMQswCQYD VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIQmVya2VsZXkx FDASBgNVBAoTC0VuZG1haWwgT3JnMQwwCgYDVQQLEwNNVEExIjAgBgNVBAMTGUNs -YXVzIEFzc21hbm4gQ0EgUlNBIDIwMDMxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz -YTIwMDNAZXNtdHAub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA -qjcPCakc4xoM/r1sN6TPh9uva7QZ1BHbxlbKOYDGpDiwvKx+vnEwhizc+rX9WCOg -wa0RU4XK++bYfijrhDvNo/oopcvHslSZPkAqJ0NLDCZLr5c9koLZ6yx/d/24zX4e -BIEXPOJEaM6IZgKQJDUkxEytdwQaOtVZKCgD2gOd9C5SbrU2lksU+PyOxtOb4oCQ -i3HX0FxDsknxWibzXZ47AZjb4+1ejd3PqmidC8niTvwWRHKTB2IYBcFHgTw95OQi -2izWSkRSBnqDtelSOJcvdaZcb4eKjYP00ASlNBheoQYWs1TOZEfKcFajb7l/r5F2 -eHC0q66O1SImV7G650sYIQIDAQABo4IBTjCCAUowHQYDVR0OBBYEFDoSA9sPnihF -pjSNOKu6R4wqoOQuMIHSBgNVHSMEgcowgceAFDoSA9sPnihFpjSNOKu6R4wqoOQu -oYGrpIGoMIGlMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8G -A1UEBxMIQmVya2VsZXkxFDASBgNVBAoTC0VuZG1haWwgT3JnMQwwCgYDVQQLEwNN -VEExIjAgBgNVBAMTGUNsYXVzIEFzc21hbm4gQ0EgUlNBIDIwMDMxJjAkBgkqhkiG -9w0BCQEWF2NhK2NhLXJzYTIwMDNAZXNtdHAub3JnggEAMAwGA1UdEwQFMAMBAf8w -IgYDVR0RBBswGYEXY2ErY2EtcnNhMjAwM0Blc210cC5vcmcwIgYDVR0SBBswGYEX -Y2ErY2EtcnNhMjAwM0Blc210cC5vcmcwDQYJKoZIhvcNAQEEBQADggEBAJaDtlST -3zjQSKehyAjJD+mABeN+w2FRiHt6uySwaaMi5Jg42sjD61JwY+Jm8lnvVr6qfIdu -lIXUcbo19+7QblIdH+T9L+JwMV23ixPMcBAh+jQpj43YSscPsjbnHh5G0RGEgHy7 -JMRjviokU3QMieBq9Ahjv1TTCtn8/mzeT5dhCKAQkuuvBuxQhsTMazEyYCV6CUf4 -Qnqi1ZD6SL6/CuEDuFYkuRLpugkwR76ljqKSpNymp8YpOWVuZEobssMHKfXAfnjg -IpuY1IeRyuFmnS9w8Uylji5oUrO9lXZWQA5GR+Sz7Ko86IaWWu36yRCVUwQTcQGR -zs06UcYw6UhJZKM= +YXVzIEFzc21hbm4gQ0EgUlNBIDIwMDcxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz +YTIwMDdAZXNtdHAub3JnMB4XDTA3MDUwNDAyMDc1NloXDTEwMDUwMzAyMDc1Nlow +gaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhC +ZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAKBgNVBAsTA01UQTEiMCAG +A1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAwNzEmMCQGCSqGSIb3DQEJARYX +Y2ErY2EtcnNhMjAwN0Blc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCwKJExr4LOcu82q33psfV3ZjhLOB9fPRLTyP2a9NT2uJD5Jl8p90P5 +NOxlYgG7ZPFd6nUEPZJlYKIGYvqIytggUMgeOFO1GN23vccINUzZ3MaXVje2ZTN0 +WrLDhQgrtyZw/zgCGmdq0EkYEEv4268GnLGogqGxddJSm1MMyqfjFTh5baH173yL +/b0EePnoHrmS6nTXRR5MyL30XPwaf+cxxqvLeMdNL7VyEDUnShr6Uxn4p1lj6+kV +q9xxaYxCHJZOiYBmyZ4h1T0IGXSl9Qegrt55r/1Cwnl+jPg5IjvDxFg70A3mqRG2 +os0u5RZm/X5lM5SwNoAn9YB2qeXf8s/vAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU +sklrUkXukDbSeUcDM9mguoBQ2hwwgdoGA1UdIwSB0jCBz4AUsklrUkXukDbSeUcD +M9mguoBQ2hyhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9y +bmlhMREwDwYDVQQHEwhCZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAK +BgNVBAsTA01UQTEiMCAGA1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAwNzEm +MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAwN0Blc210cC5vcmeCCQD6fCyAKT/C +ZDAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMDdAZXNtdHAu +b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMDdAZXNtdHAub3JnMA0GCSqGSIb3 +DQEBBAUAA4IBAQCYmHzT0FtyRxXmImi7eA54ZulWFti8nVrcJyn7kS1qITUYVrRP +KgnACG+aWSsucpr7ULrHqZGg+Wy+z3hCQwJwU5e6auPaF+gfxzpb57zr5SRM9c9h +NB4g7Rdj74HTniX+zAUZzIqCyUw6tWtJUXZGAqpgu8S5YUgz2nmNRqMGIJjzsts7 +rckdDpc9txQZ030Ei2qB4BFb4TWj/y8RhhwxhXr9PzbvmSVGLrDLQ0VK7L7TP6R3 +m3nMzpJjpdnt26CdXXzXgPbJQfsClo7989oFnYGnJdomNTupDIz1p11I7IfHemBR +dvLemxQrVYpD35kZ8+vnA+anoqIo3dUHaj/3 -----END CERTIFICATE----- diff --git a/gnu/usr.sbin/sendmail/KNOWNBUGS b/gnu/usr.sbin/sendmail/KNOWNBUGS index 32fdedb5c76..198ec2476bd 100644 --- a/gnu/usr.sbin/sendmail/KNOWNBUGS +++ b/gnu/usr.sbin/sendmail/KNOWNBUGS @@ -47,6 +47,17 @@ This list is not guaranteed to be complete. but some characters might be lost. Fix: obey RFC (2)822 and do not send lines that are longer than 1000 characters. +* milter communication fails if a single header is larger than 64K. + + If a single header is larger than 64KB (which is not possible in the + default configuration) then it cannot be transferred in one block to + libmilter and hence the communication fails. This can be avoided by + increasing the constant MILTER_CHUNK_SIZE in + include/libmilter/mfdef.h and recompiling sendmail, libmilter, and + all (statically linked) milters (or by using an undocumented compile + time option: _FFR_MAXDATASIZE; you have to read the source code in + order to use this properly). + * Sender addresses whose domain part cause a temporary A record lookup failure but have a valid MX record will be temporarily rejected in the default configuration. Solution: fix the DNS at the sender side. @@ -247,4 +258,4 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 1.11 $, Last updated $Date: 2007/04/04 14:43:48 $ +$Revision: 1.12 $, Last updated $Date: 2008/05/04 18:34:04 $ diff --git a/gnu/usr.sbin/sendmail/README b/gnu/usr.sbin/sendmail/README index 425511e59e6..8609e12be72 100644 --- a/gnu/usr.sbin/sendmail/README +++ b/gnu/usr.sbin/sendmail/README @@ -312,7 +312,7 @@ nicer to animals and plants. If the Berkeley DB include files are installed in a location other than those which your compiler searches, you will need to provide that directory when building: - Build -I/path/to/include/directory + ./Build -I/path/to/include/directory If you are using Berkeley DB versions 1.85 or 1.86, you are *strongly* urged to upgrade to DB version 2 or later, available from @@ -464,4 +464,4 @@ sendmail Source for the sendmail program itself. test Some test scripts (currently only for compilation aids). vacation Source for the vacation program. NOT PART OF SENDMAIL! -$Revision: 1.10 $, Last updated $Date: 2006/03/22 18:43:52 $ +$Revision: 1.11 $, Last updated $Date: 2008/05/04 18:34:04 $ diff --git a/gnu/usr.sbin/sendmail/RELEASE_NOTES b/gnu/usr.sbin/sendmail/RELEASE_NOTES index 91c2c1a8ddb..30df00b5c06 100644 --- a/gnu/usr.sbin/sendmail/RELEASE_NOTES +++ b/gnu/usr.sbin/sendmail/RELEASE_NOTES @@ -1,11 +1,112 @@ SENDMAIL RELEASE NOTES - $Sendmail: RELEASE_NOTES,v 8.1888 2007/04/03 23:28:40 ca Exp $ + $Sendmail: RELEASE_NOTES,v 8.1926 2008/05/03 03:34:26 ca Exp $ This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.14.3/8.14.3 2008/05/03 + During ruleset processing the generation of a key for a map + lookup and the parsing of the default value was broken + for some macros, e.g., $|, which caused the BlankSub + character to be inserted into the workspace and thus + failures, e.g., rules that should have matched did not. + 8.14.2 caused a regression: it accessed (macro) storage which was + freed before. First instance of the problem reported by + Matthew Dillon of DragonFlyBSD; variations of the same + bug reported by Todd C. Miller of OpenBSD, Moritz + Jodeit, and Dave Hayes. + Improve pathname length checks for persistent host status. Patch + from Joerg Sonnenberger of DragonFlyBSD. + Reword misleading SMTP reply text for FEATURE(`badmx'). Problem + noted by Beth Halsema. + The read timeout was fixed to be Timeout.datablock if STARTTLS + was activated. This may cause problems if that value + is lowered from its default. Problem noted by Jens Elkner. + CONFIG: Using LOCAL_TLS_CLIENT caused the tls_client ruleset + to operate incorrectly. Problem found by Werner Wiethege. + LIBMILTER: Omitting some protocol steps via the xxfi_negotiate() + callback did not work properly. The patchlevel of + libmilter has been set to 1 so a milter can determine + whether libmilter contains this fix. + MAKEMAP: If a delimiter is specified (-t) use that also when + dumping a map. Patch from Todd C. Miller of OpenBSD. + Portability: + Add support for Darwin 9.x (Mac OS X 10.5). + Support shared libraries in Darwin 8 and 9. Patch from + Chris Behrens of Concentric. + Add support for SCO OpenServer 6, patch from Boyd Gerber. + DEVTOOLS: Clarify that confSHAREDLIBDIR requires a trailing path. + Added Files: + devtools/OS/Darwin.9.x + devtools/OS/OSR.i386 + +8.14.2/8.14.2 2007/11/01 + If a message was queued and it contained 8 bit characters in + a From: or To: header, then those characters could be + "mistaken" for internal control characters during a queue + run and trigger various consistency checks. Problem + noted by Neil Rickert of Northern Illinois University. + If MaxMimeHeaderLength is set to a value greater than 0 (which + it is by default) then even if the Linelimit parameter + is 0, sendmail corrupted in the non-transfer-encoding + case every MAXLINE-1 characters. Patch from John Gardiner + Myers of Proofpoint. + Setting the suboption DeliveryMode for DaemonPortOptions did not + work in earlier 8.14 versions. + Note: DeliveryMode=interactive is silently converted to + background if a milter can reject or delete a recipient. + Prior to 8.14 this happened only if milter could delete + recipients. + ClientRate should trigger when the limit was exceeded (as + documented), not when it was reached. Patch from + John Beck of Sun Microsystems. + Force a queue run for -qGqueuegroup even if no runners are + specified (R=0) and forking (F=f) is requested. + When multiple results are requested for a DNS map lookup + (-z and -Z), return only those that are relevant for + the query (not also those in the "additional section".) + If the message transfer time to sendmail (when acting as server) + exceeds Timeout.queuewarn or Timeout.queuereturn and + the message is refused (by a milter), sendmail previously + created a delivery status notification (DSN). Patch + from Doug Heath of The Hertz Corporation. + A code change in Cyrus-SASL 2.1.22 for sasl_decode64() requires + the MTA to deal with some input (i.e., "=") itself. + Problem noted by Eliot Lear. + sendmail counted a delivery as successful if PIPELINING is + compiled in but not offered by the server and the + delivery failed temporarily. Patch from Werner Wiethege. + If getting the result of an LDAP query times out then close the + map so it will be reopened on the next lookup. This + should help "failover" configurations that specify more + than one LDAP server. + If check_compat returns $#discard then a "savemail panic" could + be triggered under some circumstances (e.g., requiring + a system which does not have the compile time flag + HASFLOCK set). Based on patch by Motonori Nakamura + of National Institute of Informatics, Japan. + If a milter rejected a recipient, the count for nrcpts= in the + logfile entry might have been wrong. Problem found by + Petra Humann of TU Dresden. + If a milter invoked smfi_chgfrom() where ESMTP arguments are not + NULL, the message body was lost. Patch from Motonori + Nakamura of National Institute of Informatics, Japan. + sendmail(8) had a bogus space in -qGname. Patch from Peng Haitao. + CONTRIB: buildvirtuser: Preserve ownership and permissions when + replacing files. + CONTRIB: buildvirtuser: Skip dot-files (e.g., .cvsignore) when + reading the /etc/mail/virtusers/ directory. + CONTRIB: buildvirtuser: Emit warnings instead of exiting where + appropriate. + LIBMILTER: Fix ABI backwards compatibility so milters compiled + against an older libmilter.so shared library can use an + 8.14 libmilter.so shared library. + LIBMILTER: smfi_version() did not properly extract the patchlevel + from the version number, however, the returned value was + correct for the current libmilter version. + 8.14.1/8.14.1 2007/04/03 Even though a milter rejects a recipient the MTA will still keep it in its list of recipients and deliver to it if the diff --git a/gnu/usr.sbin/sendmail/cf/README b/gnu/usr.sbin/sendmail/cf/README index c781e3e02cf..f03d9d5cd5a 100644 --- a/gnu/usr.sbin/sendmail/cf/README +++ b/gnu/usr.sbin/sendmail/cf/README @@ -1008,7 +1008,9 @@ virtusertable A domain-specific form of aliasing, allowing multiple MASQUERADE_DOMAIN_FILE, see below). If VIRTUSER_DOMAIN or VIRTUSER_DOMAIN_FILE is used, then the entries of class {VirtHost} are added to class {R}, i.e., relaying is allowed - to (and from) those domains. The default map definition is: + to (and from) those domains, which by default includes also + all subdomains (see relay_hosts_only). The default map + definition is: hash /etc/mail/virtusertable @@ -4699,4 +4701,4 @@ M4 DIVERSIONS 8 DNS based blacklists 9 special local rulesets (1 and 2) -$Revision: 1.27 $, Last updated $Date: 2007/04/04 14:43:48 $ +$Revision: 1.28 $, Last updated $Date: 2008/05/04 18:34:04 $ diff --git a/gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m4 b/gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m4 index 2c408ad20d5..23dc343d61f 100644 --- a/gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m4 +++ b/gnu/usr.sbin/sendmail/cf/feature/ldap_routing.m4 @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1999-2002, 2004 Sendmail, Inc. and its suppliers. +# Copyright (c) 1999-2002, 2004, 2007 Sendmail, Inc. and its suppliers. # All rights reserved. # # By using this file, you agree to the terms and conditions set @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Sendmail: ldap_routing.m4,v 8.14 2004/02/18 02:45:11 gshapiro Exp $') +VERSIONID(`$Sendmail: ldap_routing.m4,v 8.15 2007/05/01 17:38:25 ca Exp $') divert(-1) # Check first two arguments. If they aren't set, may need to warn in proto.m4 diff --git a/gnu/usr.sbin/sendmail/cf/m4/proto.m4 b/gnu/usr.sbin/sendmail/cf/m4/proto.m4 index 31ea4410543..640b89f401d 100644 --- a/gnu/usr.sbin/sendmail/cf/m4/proto.m4 +++ b/gnu/usr.sbin/sendmail/cf/m4/proto.m4 @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Sendmail: proto.m4,v 8.730 2007/02/01 18:50:03 ca Exp $') +VERSIONID(`$Sendmail: proto.m4,v 8.734 2008/01/24 23:42:01 ca Exp $') # level CF_LEVEL config file format V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley') @@ -1956,7 +1956,7 @@ R<MX><$+><:$*<TEMP>:><$*> $#error $@ 4.1.2 $: "450 MX lookup failure for "$1 # Recursively run badmx check on each mx. R<MX><$*><:$+:$*><:$*> <MX><$1><:$3><: $4 $(badmx $2 $):> # See if any of them fail. -R<MX><$*><$*><$*<BADMX>:$*> $#error $@ 5.1.2 $:"550 Illegal MX record for recipient host "$1 +R<MX><$*><$*><$*<BADMX>:$*> $#error $@ 5.1.2 $:"550 Illegal MX record for host "$1 # Reverse the mxlists so we can use the same argument order again. R<MX><$*><$*><$*> $:<MX><$1><$3><$2> R<MX><$*><:$+:$*><:$*> <MX><$1><:$3><:$4 $(dnsA $2 $) :> @@ -1965,7 +1965,7 @@ R<MX><$*><:$+:$*><:$*> <MX><$1><:$3><:$4 $(dnsA $2 $) :> R<MX><$*><$*><$*> $:<MX><$1><$3><$2> R<MX><$*><:$+:$*><:$*> <MX><$1><:$3><:$4 $(BadMXIP $2 $) :> -R<MX><$*><$*><$*<BADMXIP>:$*> $#error $@ 5.1.2 $:"550 Invalid MX record for recipient host "$1', +R<MX><$*><$*><$*<BADMXIP>:$*> $#error $@ 5.1.2 $:"550 Invalid MX record for host "$1', `dnl') @@ -2686,9 +2686,9 @@ dnl MAIL: called from check_mail dnl STARTTLS: called from smtp() after STARTTLS has been accepted Stls_client ifdef(`_LOCAL_TLS_CLIENT_', `dnl -R$* $: $1 $| $>"Local_tls_client" $1 -R$* $| $#$* $#$2 -R$* $| $* $: $1', `dnl') +R$* $: $1 <?> $>"Local_tls_client" $1 +R$* <?> $#$* $#$2 +R$* <?> $* $: $1', `dnl') ifdef(`_ACCESS_TABLE_', `dnl dnl store name of other side R$* $: $(macro {TLS_Name} $@ $&{server_name} $) $1 @@ -2962,9 +2962,9 @@ ifdef(`_ATMPF_', `dnl tempfail? R<$* _ATMPF_> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."', `dnl') dnl use the generic routine (for now) R<0> $@ OK no limit -R<$+> $: <$1> $| $(arith l $@ $&{client_rate} $@ $1 $) +R<$+> $: <$1> $| $(arith l $@ $1 $@ $&{client_rate} $) dnl log this? Connection rate $&{client_rate} exceeds limit $1. -R<$+> $| FALSE $#error $@ 4.3.2 $: _RATE_CONTROL_REPLY Connection rate limit exceeded. +R<$+> $| TRUE $#error $@ 4.3.2 $: _RATE_CONTROL_REPLY Connection rate limit exceeded. ')') ifdef(`_CONN_CONTROL_',`dnl @@ -2984,9 +2984,9 @@ ifdef(`_ATMPF_', `dnl tempfail? R<$* _ATMPF_> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."', `dnl') dnl use the generic routine (for now) R<0> $@ OK no limit -R<$+> $: <$1> $| $(arith l $@ $&{client_connections} $@ $1 $) +R<$+> $: <$1> $| $(arith l $@ $1 $@ $&{client_connections} $) dnl log this: Open connections $&{client_connections} exceeds limit $1. -R<$+> $| FALSE $#error $@ 4.3.2 $: _CONN_CONTROL_REPLY Too many open connections. +R<$+> $| TRUE $#error $@ 4.3.2 $: _CONN_CONTROL_REPLY Too many open connections. ')') undivert(9)dnl LOCAL_RULESETS diff --git a/gnu/usr.sbin/sendmail/cf/m4/version.m4 b/gnu/usr.sbin/sendmail/cf/m4/version.m4 index b48c167f072..fb3f1c13164 100644 --- a/gnu/usr.sbin/sendmail/cf/m4/version.m4 +++ b/gnu/usr.sbin/sendmail/cf/m4/version.m4 @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2007 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2008 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -11,8 +11,8 @@ divert(-1) # the sendmail distribution. # # -VERSIONID(`$Sendmail: version.m4,v 8.178 2007/04/03 21:21:18 ca Exp $') +VERSIONID(`$Sendmail: version.m4,v 8.195 2008/04/17 17:04:30 ca Exp $') # divert(0) # Configuration version number -DZ8.14.1`'ifdef(`confCF_VERSION', `/confCF_VERSION') +DZ8.14.3`'ifdef(`confCF_VERSION', `/confCF_VERSION') diff --git a/gnu/usr.sbin/sendmail/contrib/buildvirtuser b/gnu/usr.sbin/sendmail/contrib/buildvirtuser index 3a81d81584e..3adb6fb651a 100644 --- a/gnu/usr.sbin/sendmail/contrib/buildvirtuser +++ b/gnu/usr.sbin/sendmail/contrib/buildvirtuser @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (c) 1999-2003 Gregory Neil Shapiro. All Rights Reserved. +# Copyright (c) 1999-2004, 2007 Gregory Neil Shapiro. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,7 +27,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# $Sendmail: buildvirtuser,v 1.6 2003/03/15 23:30:09 gshapiro Exp $ +# $Sendmail: buildvirtuser,v 1.8 2007/10/08 18:44:15 gshapiro Exp $ =head1 NAME @@ -70,30 +70,21 @@ to take affect. =head1 EXAMPLES -Here are some example files from the /etc/mail/virtusers/ directory: +Here is an example file from the /etc/mail/virtusers/ directory: -=head2 /etc/mail/virtusers/bsdunix.org: +=head2 /etc/mail/virtusers/example.org: # Services - MAILER-DAEMON gshapiro+bounce.$DOMAIN@gshapiro.net - postmaster gshapiro+$LHS.$DOMAIN@gshapiro.net - webmaster gshapiro+$LHS.$DOMAIN@gshapiro.net + MAILER-DAEMON gshapiro+bounce.$DOMAIN@example.net + postmaster gshapiro+$LHS.$DOMAIN@example.net + webmaster gshapiro+$LHS.$DOMAIN@example.net # Defaults error:nouser No such user # Users - gshapiro gshapiro+$DOMAIN@gshapiro.net - bob robert@smtp.org - -=head2 /etc/mail/virtusers/smtp.org: - - # Defaults - gshapiro+$DOMAIN@gshapiro.net - - # Users - john john@wookie.org - nancy n@milter.com + gshapiro gshapiro+$DOMAIN@example.net + zoe zoe@example.com =head1 AUTHOR @@ -102,6 +93,7 @@ Gregory Neil Shapiro E<lt>F<gshapiro@gshapiro.net>E<gt> =cut use strict; +use File::stat; use Getopt::Std; my $makemap = "/usr/sbin/makemap"; @@ -117,6 +109,18 @@ my $newest = 0; my ($lhs, $domain, $key, $value); my $opts = {}; +sub preserve_perms ($$) +{ + my $old = shift; + my $new = shift; + my $st; + + $st = stat($old); + return if (!defined($st)); + chmod($st->mode, $new) || warn "Could not chmod($st->mode, $new): $!\n"; + chown($st->uid, $st->gid, $new) || warn "Could not chmod($st->uid, $st->gid, $new): $!\n"; +} + getopts('ft', $opts) || die "Usage: $0 [-f] [-t]\n"; if ($opts->{t}) @@ -131,9 +135,12 @@ closedir(VIRTS) || die "Could not close directory $virts: $!\n"; foreach $domain (@virts) { + next if ($domain =~ m/^\./); open(DOMAIN, "$virts/$domain") || die "Could not open file $virts/$domain: $!\n"; my $line = 0; - my $mtime = (stat(DOMAIN))[9] || 0; + my $mtime = 0; + my $st = stat("$virts/$domain"); + $mtime = $st->mtime if (defined($st)); if ($mtime > $newest) { $newest = $mtime; @@ -160,7 +167,7 @@ LINE: while (<DOMAIN>) } else { - die "Bogus line $line in $virts/$domain\n"; + warn "Bogus line $line in $virts/$domain\n"; } # Variable subsitution @@ -172,7 +179,9 @@ LINE: while (<DOMAIN>) close(DOMAIN) || die "Could not close $virts/$domain: $!\n"; } -my $virtmtime = (stat($virt))[9] || 0; +my $virtmtime = 0; +my $st = stat($virt); +$virtmtime = $st->mtime if (defined($st)); if ($opts->{f} || $virtmtime < $newest) { print STDOUT "Rebuilding $virt\n"; @@ -191,14 +200,17 @@ if ($opts->{f} || $virtmtime < $newest) print MAKEMAP "$key\t\t$virt{$key}\n"; } close(MAKEMAP) || die "Could not close makemap ($?): $!\n"; + preserve_perms($virt, $newvirt); rename($newvirt, $virt) || die "Could not rename $newvirt to $virt: $!\n"; open(VIRTHOST, ">$newvirthosts") || die "Could not open file $newvirthosts: $!\n"; foreach $domain (sort @virts) { + next if ($domain =~ m/^\./); print VIRTHOST "$domain\n"; } close(VIRTHOST) || die "Could not close $newvirthosts: $!\n"; + preserve_perms($virthosts, $newvirthosts); rename($newvirthosts, $virthosts) || die "Could not rename $newvirthosts to $virthosts: $!\n"; } exit 0; diff --git a/gnu/usr.sbin/sendmail/doc/op/op.me b/gnu/usr.sbin/sendmail/doc/op/op.me index 3c655c1807b..9ea96ebe8bc 100644 --- a/gnu/usr.sbin/sendmail/doc/op/op.me +++ b/gnu/usr.sbin/sendmail/doc/op/op.me @@ -9,7 +9,7 @@ .\" the sendmail distribution. .\" .\" -.\" $Sendmail: op.me,v 8.739 2007/03/22 17:56:01 ca Exp $ +.\" $Sendmail: op.me,v 8.741 2007/06/22 23:08:59 ca Exp $ .\" .\" eqn op.me | pic | troff -me .\" @@ -90,7 +90,7 @@ Sendmail, Inc. .de Ve Version \\$2 .. -.Ve $Revision: 1.26 $ +.Ve $Revision: 1.27 $ .rm Ve .sp For Sendmail Version 8.14 @@ -6939,6 +6939,10 @@ The .b \-v command line flag sets this to .b i . +Note: for internal reasons, +``i'' does not work +if a milter is enabled which can reject or delete recipients. +In that case the mode will be changed to ``b''. .ip DialDelay=\fIsleeptime\fP [no short name] Dial-on-demand network connections can see timeouts @@ -8932,7 +8936,8 @@ The server responds with a status indicator and the result (if any): <status> ' ' <result> .)b -The status indicator is one of the following upper case words: +The status indicator specifies the result of the lookup operation itself +and is one of the following upper case words: .(b .ta 9n OK the key was found, result contains the looked up value @@ -8944,13 +8949,19 @@ PERM a permanent failure occured In case of errors (status TEMP, TIMEOUT or PERM) the result field may contain an explanatory message. +However, the explanatory message is not used any further by +.i sendmail . Example replies: .(b 31:OK resolved.address@example.com, .)b -in case of a successful lookup, or: +.(b +56:OK error:550 5.7.1 User does not accept mail from sender, +.)b + +in case of successful lookups, or: .(b 8:NOTFOUND, .)b @@ -8960,7 +8971,7 @@ in case the key was not found, or: 55:TEMP this text explains that we had a temporary failure, .)b -in case of a failure. +in case of a temporary map lookup failure. The socket map uses the same syntax as milters (see Section "X \*- Mail Filter (Milter) Definitions") @@ -11424,7 +11435,7 @@ replace it with a blank sheet for double-sided output. .\".sz 10 .\"Eric Allman .\".sp -.\"Version $Revision: 1.26 $ +.\"Version $Revision: 1.27 $ .\".ce 0 .bp 3 .ce diff --git a/gnu/usr.sbin/sendmail/editmap/editmap.c b/gnu/usr.sbin/sendmail/editmap/editmap.c index a4c562eab05..3cce4ca2b14 100644 --- a/gnu/usr.sbin/sendmail/editmap/editmap.c +++ b/gnu/usr.sbin/sendmail/editmap/editmap.c @@ -22,7 +22,7 @@ SM_UNUSED(static char copyright[]) = #endif /* ! lint */ #ifndef lint -SM_UNUSED(static char id[]) = "@(#)$Sendmail: editmap.c,v 1.24 2004/08/03 18:40:10 ca Exp $"; +SM_UNUSED(static char id[]) = "@(#)$Sendmail: editmap.c,v 1.25 2007/05/11 18:50:35 ca Exp $"; #endif /* ! lint */ @@ -46,7 +46,7 @@ uid_t RealUid; gid_t RealGid; char *RealUserName; uid_t RunAsUid; -uid_t RunAsGid; +gid_t RunAsGid; char *RunAsUserName; int Verbose = 2; bool DontInitGroups = false; diff --git a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h index 1654d6280d0..06717365228 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-2004, 2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2004, 2006, 2008 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.77 2006/11/02 02:44:07 ca Exp $ + * $Sendmail: mfapi.h,v 8.78 2008/02/27 22:30:34 ca Exp $ */ /* @@ -18,7 +18,7 @@ # define _LIBMILTER_MFAPI_H 1 #ifndef SMFI_VERSION -# define SMFI_VERSION 0x01000000 /* libmilter version number */ +# define SMFI_VERSION 0x01000001 /* libmilter version number */ #endif /* ! SMFI_VERSION */ #define SM_LM_VRS_MAJOR(v) (((v) & 0x7f000000) >> 24) diff --git a/gnu/usr.sbin/sendmail/include/sm/conf.h b/gnu/usr.sbin/sendmail/include/sm/conf.h index 1b215c5c4f1..15b87552aed 100644 --- a/gnu/usr.sbin/sendmail/include/sm/conf.h +++ b/gnu/usr.sbin/sendmail/include/sm/conf.h @@ -10,7 +10,7 @@ * the sendmail distribution. * * - * $Sendmail: conf.h,v 1.132 2007/03/21 23:56:18 ca Exp $ + * $Sendmail: conf.h,v 1.134 2007/09/24 23:05:37 ca Exp $ */ /* @@ -458,6 +458,9 @@ typedef int pid_t; # if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) # define HASUNSETENV 1 /* unsetenv() added in S10 */ # endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */ +# if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) +# define GETLDAPALIASBYNAME_VERSION 2 /* changed in S11 */ +# endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ # endif /* ! HASGETUSERSHELL */ diff --git a/gnu/usr.sbin/sendmail/include/sm/ldap.h b/gnu/usr.sbin/sendmail/include/sm/ldap.h index 5c7fb158c17..2be6fbf11b4 100644 --- a/gnu/usr.sbin/sendmail/include/sm/ldap.h +++ b/gnu/usr.sbin/sendmail/include/sm/ldap.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2001-2003, 2005, 2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 2001-2003, 2005-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. * - * $Sendmail: ldap.h,v 1.32 2006/08/30 22:56:58 ca Exp $ + * $Sendmail: ldap.h,v 1.33 2007/10/10 00:06:44 ca Exp $ */ #ifndef SM_LDAP_H @@ -91,6 +91,10 @@ struct sm_ldap_struct /* ldapmap_lookup options */ char ldap_attrsep; +# if _FFR_LDAP_NETWORK_TIMEOUT + struct timeval ldap_networktmo; +# endif /* _FFR_LDAP_NETWORK_TIMEOUT */ + /* Linked list of maps sharing the same LDAP binding */ void *ldap_next; }; diff --git a/gnu/usr.sbin/sendmail/include/sm/tailq.h b/gnu/usr.sbin/sendmail/include/sm/tailq.h index 41b8bd93cd0..cd1af7c56a3 100644 --- a/gnu/usr.sbin/sendmail/include/sm/tailq.h +++ b/gnu/usr.sbin/sendmail/include/sm/tailq.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tailq.h,v 1.1 2007/02/04 13:17:35 millert Exp $ */ +/* $OpenBSD: tailq.h,v 1.2 2008/05/04 18:34:04 millert Exp $ */ /* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ /* @@ -36,8 +36,12 @@ #define SM_TAILQ_H_ /* + * $Sendmail: tailq.h,v 1.2 2007/06/29 23:09:57 ca Exp $ + * * This file is a modified copy of queue.h from a BSD system: * we only need tail queues here. + * We do not use queue.h directly because there is a conflict with + * some versions of that file on some OSs. * * 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 diff --git a/gnu/usr.sbin/sendmail/libmilter/docs/smfi_opensocket.html b/gnu/usr.sbin/sendmail/libmilter/docs/smfi_opensocket.html index bfc3c7c9cb9..f23a76aeb24 100644 --- a/gnu/usr.sbin/sendmail/libmilter/docs/smfi_opensocket.html +++ b/gnu/usr.sbin/sendmail/libmilter/docs/smfi_opensocket.html @@ -2,7 +2,7 @@ <HEAD><TITLE>smfi_opensocket</TITLE></HEAD> <BODY> <!-- -$Sendmail: smfi_opensocket.html,v 1.6 2006/12/21 18:30:35 ca Exp $ +$Sendmail: smfi_opensocket.html,v 1.7 2008/01/31 17:29:33 ca Exp $ --> <H1>smfi_opensocket</H1> @@ -24,16 +24,21 @@ filter. <TABLE border="1" cellspacing=1 cellpadding=4> <TR align="left" valign=top> <TH width="80">Called When</TH> -<TD>Called only from program mainline, before calling -<TT>smfi_main()</TT>.</TD> +<TD>Called only from program mainline, +after calling <TT>smfi_setconn()</TT> and <TT>smfi_register()</TT>, +but before calling <TT>smfi_main()</TT>. +</TD> </TR> <TR align="left" valign=top> <TH width="80">Effects</TH> <TD>smfi_opensocket attempts to create the socket specified previously by a call to <TT>smfi_setconn()</TT> which will be the interface between MTAs -and the filter. This allows the calling application to ensure that the -socket can be created. If this is not called, <TT>smfi_main()</TT> will -do so implicitly. </TD> +and the filter. +This allows the calling application to ensure that the +socket can be created. +If this is not called, +<TT>smfi_main()</TT> will do so implicitly. +</TD> </TR> </TABLE> @@ -58,7 +63,8 @@ do so implicitly. </TD> <LI>The interface socket could not be created for any reason. <LI><TT>rmsocket</TT> was <TT>true</TT>, and either the socket could not be examined, or exists and could not be removed. - <LI><TT>smfi_setconn()</TT> has not been called. + <LI><TT>smfi_setconn()</TT> or <TT>smfi_register()</TT> + have not been called. </UL> Otherwise, it will return MI_SUCCESS </TD> @@ -68,7 +74,7 @@ Otherwise, it will return MI_SUCCESS <HR size="1"> <FONT size="-1"> -Copyright (c) 2003 Sendmail, Inc. and its suppliers. +Copyright (c) 2003, 2008 Sendmail, Inc. and its suppliers. All rights reserved. <BR> By using this file, you agree to the terms and conditions set diff --git a/gnu/usr.sbin/sendmail/libmilter/docs/smfi_version.html b/gnu/usr.sbin/sendmail/libmilter/docs/smfi_version.html index c75e054ae0d..3ac3d66a76a 100644 --- a/gnu/usr.sbin/sendmail/libmilter/docs/smfi_version.html +++ b/gnu/usr.sbin/sendmail/libmilter/docs/smfi_version.html @@ -2,7 +2,7 @@ <HEAD><TITLE>smfi_version()</TITLE></HEAD> <BODY> <!-- -$Sendmail: smfi_version.html,v 1.5 2007/03/22 17:30:57 ca Exp $ +$Sendmail: smfi_version.html,v 1.6 2008/05/02 23:06:26 ca Exp $ --> <H1>smfi_version()</H1> @@ -59,24 +59,30 @@ Get the (runtime) version of libmilter. Note: the compile time version of libmilter is available in the macro <CODE>SMFI_VERSION</CODE>. -A milter can check this macro to determine which functions to use -(at compile time via C preprocessor statements). -Using this macro and the -<CODE>smfi_version()</CODE> -function, -a milter can determine at runtime whether it has been (dynamically) -linked against the expected libmilter version. To extract the major and minor version as well as the current patch level from this macro, the macros <CODE>SM_LM_VRS_MAJOR(v)</CODE>, <CODE>SM_LM_VRS_MINOR(v)</CODE>, and <CODE>SM_LM_VRS_PLVL(v)</CODE> can be used, respectively. +A milter can check the +<CODE>SMFI_VERSION</CODE> +macro to determine which functions to use +(at compile time via C preprocessor statements). +Using this macro and the +<CODE>smfi_version()</CODE> +function, +a milter can determine at runtime whether it has been (dynamically) +linked against the expected libmilter version. +Such a function should only compare the major and minor version, +not the patch level, +i.e., the libmilter library will be compatible despite +different patch levels. <HR SIZE="1"> <FONT SIZE="-1"> -Copyright (c) 2006, 2007 Sendmail, Inc. and its suppliers. +Copyright (c) 2006-2008 Sendmail, Inc. and its suppliers. All rights reserved. <BR> By using this file, you agree to the terms and conditions set diff --git a/gnu/usr.sbin/sendmail/libmilter/docs/xxfi_unknown.html b/gnu/usr.sbin/sendmail/libmilter/docs/xxfi_unknown.html index 43c6b8fed31..6f942d20d20 100644 --- a/gnu/usr.sbin/sendmail/libmilter/docs/xxfi_unknown.html +++ b/gnu/usr.sbin/sendmail/libmilter/docs/xxfi_unknown.html @@ -2,7 +2,7 @@ <HEAD><TITLE>xxfi_unknown</TITLE></HEAD> <BODY> <!-- -$Sendmail: xxfi_unknown.html,v 1.3 2006/12/21 18:30:36 ca Exp $ +$Sendmail: xxfi_unknown.html,v 1.4 2007/04/23 16:30:42 ca Exp $ --> <H1>xxfi_unknown</H1> @@ -53,12 +53,12 @@ that is either unknown or not implemented by the MTA. <TR bgcolor="#dddddd"><TH>Return value</TH><TH>Description</TH></TR> <TR valign="top"> <TD>SMFIS_TEMPFAIL</TD> - <TD>Reject this message with a temporary error. + <TD>Reject this command with a temporary error. </TD> </TR> <TR valign="top"> <TD>SMFIS_REJECT</TD> - <TD>Reject this message. + <TD>Reject this command. </TD> </TR> </TABLE> diff --git a/gnu/usr.sbin/sendmail/libmilter/engine.c b/gnu/usr.sbin/sendmail/libmilter/engine.c index f8f17e83d58..c29cd8fcd56 100644 --- a/gnu/usr.sbin/sendmail/libmilter/engine.c +++ b/gnu/usr.sbin/sendmail/libmilter/engine.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2004, 2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2004, 2006-2008 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: engine.c,v 8.157 2007/03/26 18:10:04 ca Exp $") +SM_RCSID("@(#)$Sendmail: engine.c,v 8.162 2008/02/27 01:34:14 ca Exp $") #include "libmilter.h" @@ -855,6 +855,7 @@ st_optionneg(g) ; if (g->a_ctx->ctx_smfi != NULL && + g->a_ctx->ctx_smfi->xxfi_version > 4 && (fi_negotiate = g->a_ctx->ctx_smfi->xxfi_negotiate) != NULL) { int r; @@ -1000,6 +1001,7 @@ st_optionneg(g) (long) ctx->ctx_id, ctx->ctx_mta_pflags, i); return _SMFIS_ABORT; } + fix_stm(ctx); if (ctx->ctx_dbg > 3) sm_dprintf("[%ld] milter_negotiate:" @@ -1177,6 +1179,7 @@ st_data(g) if (g == NULL) return _SMFIS_ABORT; if (g->a_ctx->ctx_smfi != NULL && + g->a_ctx->ctx_smfi->xxfi_version > 3 && (fi_data = g->a_ctx->ctx_smfi->xxfi_data) != NULL) return (*fi_data)(g->a_ctx); return SMFIS_CONTINUE; @@ -1310,6 +1313,7 @@ st_unknown(g) if (g == NULL) return _SMFIS_ABORT; if (g->a_ctx->ctx_smfi != NULL && + g->a_ctx->ctx_smfi->xxfi_version > 2 && (fi_unknown = g->a_ctx->ctx_smfi->xxfi_unknown) != NULL) return (*fi_unknown)(g->a_ctx, (const char *) g->a_buf); return SMFIS_CONTINUE; @@ -1722,9 +1726,9 @@ mi_rd_socket_ready (sd) int n; int nerr = 0; #if SM_CONF_POLL - struct pollfd pfd; + struct pollfd pfd; #else /* SM_CONF_POLL */ - fd_set rd_set, exc_set; + fd_set rd_set, exc_set; #endif /* SM_CONF_POLL */ do diff --git a/gnu/usr.sbin/sendmail/libmilter/listener.c b/gnu/usr.sbin/sendmail/libmilter/listener.c index 5810c89f33c..05c070be186 100644 --- a/gnu/usr.sbin/sendmail/libmilter/listener.c +++ b/gnu/usr.sbin/sendmail/libmilter/listener.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2006 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 @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: listener.c,v 8.122 2006/11/02 17:54:44 ca Exp $") +SM_RCSID("@(#)$Sendmail: listener.c,v 8.124 2007/04/23 22:22:50 ca Exp $") /* ** listener.c -- threaded network listener @@ -927,9 +927,9 @@ mi_listener(conn, dbg, smfi, timeout, backlog) ctx->ctx_pflags |= SMFIP_NOEOH; if (smfi->xxfi_body == NULL) ctx->ctx_pflags |= SMFIP_NOBODY; - if (smfi->xxfi_data == NULL) + if (smfi->xxfi_version <= 3 || smfi->xxfi_data == NULL) ctx->ctx_pflags |= SMFIP_NODATA; - if (smfi->xxfi_unknown == NULL) + if (smfi->xxfi_version <= 2 || smfi->xxfi_unknown == NULL) ctx->ctx_pflags |= SMFIP_NOUNKNOWN; #if _FFR_WORKERS_POOL diff --git a/gnu/usr.sbin/sendmail/libmilter/main.c b/gnu/usr.sbin/sendmail/libmilter/main.c index 29bf74311c2..7233e7c48ef 100644 --- a/gnu/usr.sbin/sendmail/libmilter/main.c +++ b/gnu/usr.sbin/sendmail/libmilter/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2003, 2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2003, 2006, 2007 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: main.c,v 8.81 2006/11/02 18:31:43 ca Exp $") +SM_RCSID("@(#)$Sendmail: main.c,v 8.83 2007/04/23 22:22:50 ca Exp $") #define _DEFINE 1 #include "libmilter.h" @@ -52,7 +52,10 @@ smfi_register(smfilter) (void) sm_strlcpy(smfi->xxfi_name, smfilter.xxfi_name, len); /* compare milter version with hard coded version */ - if (smfi->xxfi_version != SMFI_VERSION) + if (smfi->xxfi_version != SMFI_VERSION && + smfi->xxfi_version != 2 && + smfi->xxfi_version != 3 && + smfi->xxfi_version != 4) { /* hard failure for now! */ smi_log(SMI_LOG_ERR, diff --git a/gnu/usr.sbin/sendmail/libmilter/monitor.c b/gnu/usr.sbin/sendmail/libmilter/monitor.c index 3d23f0c27e4..17d2e275040 100644 --- a/gnu/usr.sbin/sendmail/libmilter/monitor.c +++ b/gnu/usr.sbin/sendmail/libmilter/monitor.c @@ -8,6 +8,8 @@ * */ +#include <sm/gen.h> +SM_RCSID("@(#)$Sendmail: monitor.c,v 8.7 2007/04/23 16:26:28 ca Exp $") #include "libmilter.h" #if _FFR_THREAD_MONITOR diff --git a/gnu/usr.sbin/sendmail/libmilter/shlib_version b/gnu/usr.sbin/sendmail/libmilter/shlib_version index b52599a164f..c6e3f4d3fc0 100644 --- a/gnu/usr.sbin/sendmail/libmilter/shlib_version +++ b/gnu/usr.sbin/sendmail/libmilter/shlib_version @@ -1,2 +1,2 @@ major=2 -minor=0 +minor=1 diff --git a/gnu/usr.sbin/sendmail/libmilter/smfi.c b/gnu/usr.sbin/sendmail/libmilter/smfi.c index d561a93359a..5c550131305 100644 --- a/gnu/usr.sbin/sendmail/libmilter/smfi.c +++ b/gnu/usr.sbin/sendmail/libmilter/smfi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2006 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 @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: smfi.c,v 8.82 2007/01/20 06:37:19 ca Exp $") +SM_RCSID("@(#)$Sendmail: smfi.c,v 8.83 2007/04/23 16:44:39 ca Exp $") #include <sm/varargs.h> #include "libmilter.h" @@ -884,6 +884,6 @@ smfi_version(major, minor, patchlevel) if (minor != NULL) *minor = SM_LM_VRS_MINOR(SMFI_VERSION); if (patchlevel != NULL) - *patchlevel = SM_LM_VRS_MINOR(SMFI_VERSION); + *patchlevel = SM_LM_VRS_PLVL(SMFI_VERSION); return MI_SUCCESS; } diff --git a/gnu/usr.sbin/sendmail/libmilter/worker.c b/gnu/usr.sbin/sendmail/libmilter/worker.c index 7ae3f315919..3787598e941 100644 --- a/gnu/usr.sbin/sendmail/libmilter/worker.c +++ b/gnu/usr.sbin/sendmail/libmilter/worker.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004, 2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 2003-2004, 2007 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -11,7 +11,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: worker.c,v 8.9 2006/12/18 18:26:51 ca Exp $") +SM_RCSID("@(#)$Sendmail: worker.c,v 8.10 2007/12/03 22:06:05 ca Exp $") #include "libmilter.h" @@ -263,8 +263,6 @@ mi_pool_controller_init() return MI_FAILURE; } - POOL_LEV_DPRINTF(4, ("PIPE r=[%d] w=[%d]", RD_PIPE, WR_PIPE)); - (void) smutex_init(&Tskmgr.tm_w_mutex); (void) scond_init(&Tskmgr.tm_w_cond); diff --git a/gnu/usr.sbin/sendmail/libsm/ldap.c b/gnu/usr.sbin/sendmail/libsm/ldap.c index be5d2c5cf0c..9424825154b 100644 --- a/gnu/usr.sbin/sendmail/libsm/ldap.c +++ b/gnu/usr.sbin/sendmail/libsm/ldap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 2001-2007 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -11,7 +11,7 @@ #define LDAP_DEPRECATED 1 #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: ldap.c,v 1.78 2006/08/30 22:56:59 ca Exp $") +SM_RCSID("@(#)$Sendmail: ldap.c,v 1.80 2007/10/12 00:19:44 ca Exp $") #if LDAPMAP # include <sys/types.h> @@ -1103,26 +1103,25 @@ sm_ldap_results(lmap, msgid, flags, delim, rpool, result, if (save_errno != LDAP_SUCCESS) { statp = EX_TEMPFAIL; - if (ret != 0) + switch (save_errno) { - switch (save_errno) - { #ifdef LDAP_SERVER_DOWN - case LDAP_SERVER_DOWN: + case LDAP_SERVER_DOWN: #endif /* LDAP_SERVER_DOWN */ - case LDAP_TIMEOUT: - case LDAP_UNAVAILABLE: + case LDAP_TIMEOUT: + case ETIMEDOUT: + case LDAP_UNAVAILABLE: - /* - ** server disappeared, - ** try reopen on next search - */ + /* + ** server disappeared, + ** try reopen on next search + */ - statp = EX_RESTART; - break; - } - save_errno += E_LDAPBASE; + statp = EX_RESTART; + break; } + if (ret != 0) + save_errno += E_LDAPBASE; SM_LDAP_ERROR_CLEANUP(); errno = save_errno; return statp; @@ -1272,6 +1271,7 @@ sm_ldap_results(lmap, msgid, flags, delim, rpool, result, case LDAP_SERVER_DOWN: #endif /* LDAP_SERVER_DOWN */ case LDAP_TIMEOUT: + case ETIMEDOUT: case LDAP_UNAVAILABLE: /* @@ -1370,6 +1370,9 @@ sm_ldap_setopts(ld, lmap) ldap_set_option(ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF); ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &lmap->ldap_sizelimit); ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &lmap->ldap_timelimit); +# if _FFR_LDAP_NETWORK_TIMEOUT && defined(LDAP_OPT_NETWORK_TIMEOUT) + ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &lmap->ldap_networktmo); +# endif /* _FFR_LDAP_NETWORK_TIMEOUT && defined(LDAP_OPT_NETWORK_TIMEOUT) */ # ifdef LDAP_OPT_RESTART ldap_set_option(ld, LDAP_OPT_RESTART, LDAP_OPT_ON); # endif /* LDAP_OPT_RESTART */ diff --git a/gnu/usr.sbin/sendmail/libsm/mpeix.c b/gnu/usr.sbin/sendmail/libsm/mpeix.c index 995834c87e6..0550f456207 100644 --- a/gnu/usr.sbin/sendmail/libsm/mpeix.c +++ b/gnu/usr.sbin/sendmail/libsm/mpeix.c @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: mpeix.c,v 1.6 2002/05/24 20:50:14 gshapiro Exp $") +SM_RCSID("@(#)$Sendmail: mpeix.c,v 1.7 2007/05/11 18:51:22 gshapiro Exp $") #ifdef MPE /* @@ -506,7 +506,7 @@ sendmail_mpe_emuluid() ** emulated egid if present, else true egid. */ -static uid_t sendmail_mpe_egid = -1; +static gid_t sendmail_mpe_egid = -1; #undef getegid gid_t diff --git a/gnu/usr.sbin/sendmail/mail.local/mail.local.c b/gnu/usr.sbin/sendmail/mail.local/mail.local.c index 4e2c90b8ac4..3536e97e2c9 100644 --- a/gnu/usr.sbin/sendmail/mail.local/mail.local.c +++ b/gnu/usr.sbin/sendmail/mail.local/mail.local.c @@ -18,7 +18,7 @@ SM_IDSTR(copyright, Copyright (c) 1990, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Sendmail: mail.local.c,v 8.254 2006/10/12 22:23:45 ca Exp $") +SM_IDSTR(id, "@(#)$Sendmail: mail.local.c,v 8.256 2008/02/19 07:13:30 gshapiro Exp $") #include <stdlib.h> #include <sm/errstring.h> @@ -79,6 +79,15 @@ SM_IDSTR(id, "@(#)$Sendmail: mail.local.c,v 8.254 2006/10/12 22:23:45 ca Exp $") # endif /* HASHSPOOLMD5 */ #endif /* HASHSPOOL */ +#if _FFR_SPOOL_PATH + /* + ** Override path to mail store at run time (using -p). + ** From: Eugene Grosbein of Svyaz Service JSC + ** See: http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/114195 + ** NOTE: Update man page before adding this to a release. + */ +#endif /* _FFR_SPOOL_PATH */ + #ifndef LOCKTO_RM # define LOCKTO_RM 300 /* timeout for stale lockfile removal */ @@ -227,7 +236,11 @@ main(argc, argv) #if HASHSPOOL while ((ch = getopt(argc, argv, "7bdD:f:h:r:lH:p:n")) != -1) #else /* HASHSPOOL */ +# if _FFR_SPOOL_PATH + while ((ch = getopt(argc, argv, "7bdD:f:h:r:lp:")) != -1) +# else /* _FFR_SPOOL_PATH */ while ((ch = getopt(argc, argv, "7bdD:f:h:r:l")) != -1) +# endif /* _FFR_SPOOL_PATH */ #endif /* HASHSPOOL */ { switch(ch) @@ -308,6 +321,12 @@ main(argc, argv) } break; + case 'n': + StripRcptDomain = false; + break; +#endif /* HASHSPOOL */ + +#if HASHSPOOL || _FFR_SPOOL_PATH case 'p': if (optarg == NULL || *optarg == '\0') { @@ -321,11 +340,7 @@ main(argc, argv) usage(); } break; - - case 'n': - StripRcptDomain = false; - break; -#endif /* HASHSPOOL */ +#endif /* HASHSPOOL || _FFR_SPOOL_PATH */ case '?': default: @@ -1566,7 +1581,11 @@ void usage() { ExitVal = EX_USAGE; +# if _FFR_SPOOL_PATH + mailerr(NULL, "usage: mail.local [-7] [-b] [-d] [-l] [-f from|-r from] [-h filename] [-p path] user ..."); +# else /* _FFR_SPOOL_PATH */ mailerr(NULL, "usage: mail.local [-7] [-b] [-d] [-l] [-f from|-r from] [-h filename] user ..."); +# endif /* _FFR_SPOOL_PATH */ sm_exit(ExitVal); } diff --git a/gnu/usr.sbin/sendmail/makemap/makemap.8 b/gnu/usr.sbin/sendmail/makemap/makemap.8 index 07053c0dd3e..3eacb432117 100644 --- a/gnu/usr.sbin/sendmail/makemap/makemap.8 +++ b/gnu/usr.sbin/sendmail/makemap/makemap.8 @@ -8,9 +8,9 @@ .\" the sendmail distribution. .\" .\" -.\" $Sendmail: makemap.8,v 8.30 2002/06/27 23:41:04 gshapiro Exp $ +.\" $Sendmail: makemap.8,v 8.31 2008/05/02 23:07:48 ca Exp $ .\" -.Dd October 10, 2001 +.Dd May 2, 2008 .Dt MAKEMAP 8 .Os .Sh NAME @@ -151,7 +151,8 @@ Ignore safety checks on maps being created. This includes checking for hard or symbolic links in world writable directories. .It Fl t -Use the specified delimiter instead of white space. +Use the specified delimiter instead of white space +(also for dumping a map). .It Fl u dump (unmap) the content of the database to standard output. .It Fl v diff --git a/gnu/usr.sbin/sendmail/makemap/makemap.c b/gnu/usr.sbin/sendmail/makemap/makemap.c index 588c856bcde..f38e7b2aafd 100644 --- a/gnu/usr.sbin/sendmail/makemap/makemap.c +++ b/gnu/usr.sbin/sendmail/makemap/makemap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2002, 2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2002, 2004, 2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1992 Eric P. Allman. All rights reserved. * Copyright (c) 1992, 1993 @@ -20,7 +20,7 @@ SM_IDSTR(copyright, Copyright (c) 1992, 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Sendmail: makemap.c,v 8.177 2004/08/03 23:57:24 ca Exp $") +SM_IDSTR(id, "@(#)$Sendmail: makemap.c,v 8.179 2008/04/14 02:06:16 ca Exp $") #include <sys/types.h> @@ -42,7 +42,7 @@ uid_t RealUid; gid_t RealGid; char *RealUserName; uid_t RunAsUid; -uid_t RunAsGid; +gid_t RunAsGid; char *RunAsUserName; int Verbose = 2; bool DontInitGroups = false; @@ -381,7 +381,7 @@ main(argc, argv) "%.*s%c%.*s\n", (int) db_key.size, (char *) db_key.data, - sep ? sep : '\t', + (sep != '\0') ? sep : '\t', (int) db_val.size, (char *)db_val.data); diff --git a/gnu/usr.sbin/sendmail/praliases/praliases.c b/gnu/usr.sbin/sendmail/praliases/praliases.c index 5ac7a3fdec0..0094148e1a3 100644 --- a/gnu/usr.sbin/sendmail/praliases/praliases.c +++ b/gnu/usr.sbin/sendmail/praliases/praliases.c @@ -20,7 +20,7 @@ SM_IDSTR(copyright, Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Sendmail: praliases.c,v 8.93 2001/09/11 04:05:07 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Sendmail: praliases.c,v 8.94 2007/05/11 18:50:36 ca Exp $") #include <sys/types.h> #include <ctype.h> @@ -45,7 +45,7 @@ uid_t RealUid; gid_t RealGid; char *RealUserName; uid_t RunAsUid; -uid_t RunAsGid; +gid_t RunAsGid; char *RunAsUserName; int Verbose = 2; bool DontInitGroups = false; diff --git a/gnu/usr.sbin/sendmail/sendmail/README b/gnu/usr.sbin/sendmail/sendmail/README index 884c8b50fde..7c77f0928d1 100644 --- a/gnu/usr.sbin/sendmail/sendmail/README +++ b/gnu/usr.sbin/sendmail/sendmail/README @@ -9,7 +9,7 @@ # the sendmail distribution. # # -# $Sendmail: README,v 8.390 2006/11/13 22:27:27 ca Exp $ +# $Sendmail: README,v 8.391 2008/02/12 16:38:21 ca Exp $ # This directory contains the source files for sendmail(TM). @@ -41,7 +41,7 @@ Sendmail is a trademark of Sendmail, Inc. By far, the easiest way to compile sendmail is to use the "Build" script: - sh Build + sh ./Build This uses the "uname" command to figure out what architecture you are on and creates a proper Makefile accordingly. It also creates a @@ -52,7 +52,7 @@ read the note below in the OPERATING SYSTEM AND COMPILE QUIRKS section. If you need to look at other include or library directories, use the -I or -L flags on the command line, e.g., - sh Build -I/usr/sww/include -L/usr/sww/lib + sh ./Build -I/usr/sww/include -L/usr/sww/lib It's also possible to create local site configuration in the file site.config.m4 (or another file settable with the -f flag). This @@ -1847,4 +1847,4 @@ util.c Some general purpose routines used by sendmail. version.c The version number and information about this version of sendmail. -(Version $Revision: 1.26 $, last update $Date: 2007/02/04 13:17:35 $ ) +(Version $Revision: 1.27 $, last update $Date: 2008/05/04 18:34:05 $ ) diff --git a/gnu/usr.sbin/sendmail/sendmail/collect.c b/gnu/usr.sbin/sendmail/sendmail/collect.c index ac073ecbe70..939b7e36ef1 100644 --- a/gnu/usr.sbin/sendmail/sendmail/collect.c +++ b/gnu/usr.sbin/sendmail/sendmail/collect.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2006, 2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: collect.c,v 8.280 2006/11/29 00:20:40 ca Exp $") +SM_RCSID("@(#)$Sendmail: collect.c,v 8.282 2008/01/31 18:48:29 ca Exp $") static void eatfrom __P((char *volatile, ENVELOPE *)); static void collect_doheader __P((ENVELOPE *)); @@ -308,6 +308,7 @@ collect(fp, smtpmode, hdrp, e, rsetsize) dbto = smtpmode ? ((int) TimeOuts.to_datablock * 1000) : SM_TIME_FOREVER; sm_io_setinfo(fp, SM_IO_WHAT_TIMEOUT, &dbto); + set_tls_rd_tmo(TimeOuts.to_datablock); c = SM_IO_EOF; inputerr = false; headeronly = hdrp != NULL; diff --git a/gnu/usr.sbin/sendmail/sendmail/conf.c b/gnu/usr.sbin/sendmail/sendmail/conf.c index f84de0e4d48..0199b6a1c65 100644 --- a/gnu/usr.sbin/sendmail/sendmail/conf.c +++ b/gnu/usr.sbin/sendmail/sendmail/conf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2007 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: conf.c,v 8.1128 2007/04/03 21:32:29 ca Exp $") +SM_RCSID("@(#)$Sendmail: conf.c,v 8.1141 2008/04/14 02:09:35 ca Exp $") #include <sm/sendmail.h> #include <sendmail/pathnames.h> @@ -5325,17 +5325,8 @@ sm_syslog(level, id, fmt, va_alist) save_errno = errno; if (id == NULL) - { id = "NOQUEUE"; - idlen = strlen(id) + SyslogPrefixLen; - } - else if (strcmp(id, NOQID) == 0) - { - id = ""; - idlen = SyslogPrefixLen; - } - else - idlen = strlen(id) + SyslogPrefixLen; + idlen = strlen(id) + SyslogPrefixLen; buf = buf0; bufsize = sizeof(buf0); @@ -6033,11 +6024,19 @@ char *OsCompileOptions[] = char *FFRCompileOptions[] = { +#if _FFR_ADDR_TYPE_MODES + /* more info in {addr_type}, requires m4 changes! */ + "_FFR_ADDR_TYPE_MODES", +#endif /* _FFR_ADDR_TYPE_MODES */ #if _FFR_ALLOW_SASLINFO /* DefaultAuthInfo can be specified by user. */ /* DefaultAuthInfo doesn't really work in 8.13 anymore. */ "_FFR_ALLOW_SASLINFO", #endif /* _FFR_ALLOW_SASLINFO */ +#if _FFR_BADRCPT_SHUTDOWN + /* shut down connection (421) if there are too many bad RCPTs */ + "_FFR_BADRCPT_SHUTDOWN", +#endif /* _FFR_BADRCPT_SHUTDOWN */ #if _FFR_BESTMX_BETTER_TRUNCATION /* Better truncation of list of MX records for dns map. */ "_FFR_BESTMX_BETTER_TRUNCATION", @@ -6103,6 +6102,10 @@ char *FFRCompileOptions[] = "_FFR_DPO_CS", #endif /* _FFR_DPO_CS */ +#if _FFR_DPRINTF_MAP + /* dprintf map for logging */ + "_FFR_DPRINTF_MAP", +#endif /* _FFR_DPRINTF_MAP */ #if _FFR_DROP_TRUSTUSER_WARNING /* ** Don't issue this warning: @@ -6174,6 +6177,10 @@ char *FFRCompileOptions[] = /* Ignore extensions offered in response to HELO */ "_FFR_IGNORE_EXT_ON_HELO", #endif /* _FFR_IGNORE_EXT_ON_HELO */ +#if _FFR_LOCAL_DAEMON + /* Local daemon mode (-bl) which only accepts loopback connections */ + "_FFR_LOCAL_DAEMON", +#endif /* _FFR_LOCAL_DAEMON */ #if _FFR_MAXDATASIZE /* ** It is possible that a header is larger than MILTER_CHUNK_SIZE, @@ -6231,6 +6238,10 @@ char *FFRCompileOptions[] = /* Old mime7to8 code, the new is broken for at least one example. */ "_FFR_MIME7TO8_OLD", #endif /* _FFR_MAX_SLEEP_TIME */ +#if _FFR_MORE_MACROS + /* allow more long macro names ("unprintable" characters). */ + "_FFR_MORE_MACROS", +#endif /* _FFR_MORE_MACROS */ #if _FFR_MSG_ACCEPT /* allow to override "Message accepted for delivery" */ "_FFR_MSG_ACCEPT", @@ -6244,6 +6255,10 @@ char *FFRCompileOptions[] = /* Disable PIPELINING, delay client if used. */ "_FFR_NO_PIPE", #endif /* _FFR_NO_PIPE */ +#if _FFR_LDAP_NETWORK_TIMEOUT + /* set LDAP_OPT_NETWORK_TIMEOUT if available (-c) */ + "_FFR_LDAP_NETWORK_TIMEOUT", +#endif /* _FFR_LDAP_NETWORK_TIMEOUT */ #if _FFR_LOG_NTRIES /* log ntries=, from Nik Clayton of FreeBSD */ "_FFR_LOG_NTRIES", @@ -6289,6 +6304,18 @@ char *FFRCompileOptions[] = /* Random shuffle for queue sorting. */ "_FFR_RHS", #endif /* _FFR_RHS */ +#if _FFR_RUNPQG + /* + ** allow -qGqueue_group -qp to work, i.e., + ** restrict a persistent queue runner to a queue group. + */ + + "_FFR_RUNPQG", +#endif /* _FFR_RUNPQG */ +#if _FFR_SESSID + /* session id (for logging) */ + "_FFR_SESSID", +#endif /* _FFR_SESSID */ #if _FFR_SHM_STATUS /* Donated code (unused). */ "_FFR_SHM_STATUS", diff --git a/gnu/usr.sbin/sendmail/sendmail/daemon.c b/gnu/usr.sbin/sendmail/sendmail/daemon.c index afc38d94f9c..bef537b507a 100644 --- a/gnu/usr.sbin/sendmail/sendmail/daemon.c +++ b/gnu/usr.sbin/sendmail/sendmail/daemon.c @@ -14,7 +14,7 @@ #include <sendmail.h> #include "map.h" -SM_RCSID("@(#)$Sendmail: daemon.c,v 8.678 2007/03/08 00:33:40 ca Exp $") +SM_RCSID("@(#)$Sendmail: daemon.c,v 8.680 2008/02/14 00:20:26 ca Exp $") #if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__) # define USE_SOCK_STREAM 1 @@ -1257,7 +1257,8 @@ setupdaemon(daemonaddr) #if NETINET case AF_INET: if (daemonaddr->sin.sin_addr.s_addr == 0) - daemonaddr->sin.sin_addr.s_addr = INADDR_ANY; + daemonaddr->sin.sin_addr.s_addr = + LocalDaemon ? htonl(INADDR_LOOPBACK) : INADDR_ANY; port = daemonaddr->sin.sin_port; break; #endif /* NETINET */ @@ -1265,7 +1266,8 @@ setupdaemon(daemonaddr) #if NETINET6 case AF_INET6: if (IN6_IS_ADDR_UNSPECIFIED(&daemonaddr->sin6.sin6_addr)) - daemonaddr->sin6.sin6_addr = in6addr_any; + daemonaddr->sin6.sin6_addr = + LocalDaemon ? in6addr_loopback : in6addr_any; port = daemonaddr->sin6.sin6_port; break; #endif /* NETINET6 */ @@ -2204,7 +2206,8 @@ makeconnection(host, port, mci, e, enough) #if NETINET case AF_INET: if (clt_addr.sin.sin_addr.s_addr == 0) - clt_addr.sin.sin_addr.s_addr = INADDR_ANY; + clt_addr.sin.sin_addr.s_addr = LocalDaemon ? + htonl(INADDR_LOOPBACK) : INADDR_ANY; else clt_bind = true; if (clt_addr.sin.sin_port != 0) @@ -2215,7 +2218,8 @@ makeconnection(host, port, mci, e, enough) #if NETINET6 case AF_INET6: if (IN6_IS_ADDR_UNSPECIFIED(&clt_addr.sin6.sin6_addr)) - clt_addr.sin6.sin6_addr = in6addr_any; + clt_addr.sin6.sin6_addr = LocalDaemon ? + in6addr_loopback : in6addr_any; else clt_bind = true; socksize = sizeof(struct sockaddr_in6); @@ -3274,7 +3278,7 @@ myhostname(hostbuf, size) if (strchr(hostbuf, '.') == NULL && !getcanonname(hostbuf, size, true, NULL)) { - sm_syslog(LOG_CRIT, NOQID, + sm_syslog(LocalDaemon ? LOG_WARNING : LOG_CRIT, NOQID, "My unqualified host name (%s) unknown; sleeping for retry", hostbuf); message("My unqualified host name (%s) unknown; sleeping for retry", @@ -3282,7 +3286,7 @@ myhostname(hostbuf, size) (void) sleep(60); if (!getcanonname(hostbuf, size, true, NULL)) { - sm_syslog(LOG_ALERT, NOQID, + sm_syslog(LocalDaemon ? LOG_WARNING : LOG_ALERT, NOQID, "unable to qualify my own domain name (%s) -- using short name", hostbuf); message("WARNING: unable to qualify my own domain name (%s) -- using short name", diff --git a/gnu/usr.sbin/sendmail/sendmail/deliver.c b/gnu/usr.sbin/sendmail/sendmail/deliver.c index 1ee9d95f807..396f6262cd4 100644 --- a/gnu/usr.sbin/sendmail/sendmail/deliver.c +++ b/gnu/usr.sbin/sendmail/sendmail/deliver.c @@ -14,7 +14,7 @@ #include <sendmail.h> #include <sm/time.h> -SM_RCSID("@(#)$Sendmail: deliver.c,v 8.1012 2007/03/29 21:20:15 ca Exp $") +SM_RCSID("@(#)$Sendmail: deliver.c,v 8.1015 2007/10/17 21:35:30 ca Exp $") #if HASSETUSERCONTEXT # include <login_cap.h> @@ -495,7 +495,7 @@ sendall(e, mode) time_t now; if (tTd(13, 29)) - sm_dprintf("No deliveries: auto-queuing\n"); + sm_dprintf("No deliveries: auto-queueing\n"); mode = SM_QUEUE; now = curtime(); @@ -3293,6 +3293,8 @@ do_transfer: ok = (*e->e_puthdr)(mci, e->e_header, e, M87F_OUTER); if (ok) ok = (*e->e_putbody)(mci, e, NULL); + if (ok && bitset(MCIF_INLONGLINE, mci->mci_flags)) + ok = putline("", mci); /* ** Ignore an I/O error that was caused by EPIPE. @@ -3404,6 +3406,7 @@ do_transfer: /* No recipients in list and no missing responses? */ if (tobuf[0] == '\0' # if PIPELINING + && bitset(MCIF_PIPELINED, mci->mci_flags) && mci->mci_nextaddr == NULL # endif /* PIPELINING */ ) diff --git a/gnu/usr.sbin/sendmail/sendmail/envelope.c b/gnu/usr.sbin/sendmail/sendmail/envelope.c index 56e32b5da65..33f8c83fbb3 100644 --- a/gnu/usr.sbin/sendmail/sendmail/envelope.c +++ b/gnu/usr.sbin/sendmail/sendmail/envelope.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: envelope.c,v 8.302 2006/11/10 23:12:52 ca Exp $") +SM_RCSID("@(#)$Sendmail: envelope.c,v 8.305 2008/03/31 16:32:13 ca Exp $") /* ** CLRSESSENVELOPE -- clear session oriented data in an envelope @@ -105,9 +105,18 @@ newenvelope(e, parent, rpool) e->e_parent = parent; assign_queueid(e); e->e_ctime = curtime(); +#if _FFR_SESSID + e->e_sessid = e->e_id; +#endif /* _FFR_SESSID */ if (parent != NULL) { e->e_msgpriority = parent->e_msgsize; +#if _FFR_SESSID + if (parent->e_sessid != NULL) + e->e_sessid = sm_rpool_strdup_x(rpool, + parent->e_sessid); +#endif /* _FFR_SESSID */ + if (parent->e_quarmsg == NULL) { e->e_quarmsg = NULL; @@ -127,7 +136,7 @@ newenvelope(e, parent, rpool) if (CurEnv->e_xfp != NULL) (void) sm_io_flush(CurEnv->e_xfp, SM_TIME_DEFAULT); if (sendmode != DM_NOTSET) - e->e_sendmode = sendmode; + set_delivery_mode(sendmode, e); return e; } diff --git a/gnu/usr.sbin/sendmail/sendmail/headers.c b/gnu/usr.sbin/sendmail/sendmail/headers.c index 3e3fcf11f78..928078a5741 100644 --- a/gnu/usr.sbin/sendmail/sendmail/headers.c +++ b/gnu/usr.sbin/sendmail/sendmail/headers.c @@ -14,7 +14,7 @@ #include <sendmail.h> #include <sm/sendmail.h> -SM_RCSID("@(#)$Sendmail: headers.c,v 8.310 2007/02/07 22:44:35 ca Exp $") +SM_RCSID("@(#)$Sendmail: headers.c,v 8.312 2007/06/19 18:52:11 ca Exp $") static HDR *allocheader __P((char *, char *, int, SM_RPOOL_T *, bool)); static size_t fix_mime_header __P((HDR *, ENVELOPE *)); @@ -1865,7 +1865,8 @@ putheader(mci, hdr, e, flags) if (bitset(H_FROM, h->h_flags)) oldstyle = false; - commaize(h, p, oldstyle, mci, e); + commaize(h, p, oldstyle, mci, e, + PXLF_HEADER | PXLF_STRIPMQUOTE); } else { @@ -1977,6 +1978,7 @@ put_vanilla_header(h, v, mci) ** oldstyle -- true if this is an old style header. ** mci -- the connection information. ** e -- the envelope containing the message. +** putflags -- flags for putxline() ** ** Returns: ** true iff header field was written successfully @@ -1986,17 +1988,17 @@ put_vanilla_header(h, v, mci) */ bool -commaize(h, p, oldstyle, mci, e) +commaize(h, p, oldstyle, mci, e, putflags) register HDR *h; register char *p; bool oldstyle; register MCI *mci; register ENVELOPE *e; + int putflags; { register char *obp; int opos, omax, spaces; bool firstone = true; - int putflags = PXLF_HEADER | PXLF_STRIPMQUOTE; char **res; char obuf[MAXLINE + 3]; diff --git a/gnu/usr.sbin/sendmail/sendmail/macro.c b/gnu/usr.sbin/sendmail/sendmail/macro.c index 392e324f314..d46b1c528ed 100644 --- a/gnu/usr.sbin/sendmail/sendmail/macro.c +++ b/gnu/usr.sbin/sendmail/sendmail/macro.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2001, 2003, 2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2001, 2003, 2006, 2007 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: macro.c,v 8.102 2006/12/21 23:06:10 ca Exp $") +SM_RCSID("@(#)$Sendmail: macro.c,v 8.107 2007/08/06 22:29:02 ca Exp $") #include <sm/sendmail.h> #if MAXMACROID != (BITMAPBITS - 1) @@ -21,8 +21,67 @@ SM_RCSID("@(#)$Sendmail: macro.c,v 8.102 2006/12/21 23:06:10 ca Exp $") #endif /* MAXMACROID != (BITMAPBITS - 1) */ static char *MacroName[MAXMACROID + 1]; /* macro id to name table */ -int NextMacroId = 0240; /* codes for long named macros */ + +/* +** Codes for long named macros. +** See also macname(): + * if not ASCII printable, look up the name * + if (n <= 0x20 || n > 0x7f) +** First use 1 to NEXTMACROID_L, then use NEXTMACROID_H to MAXMACROID. +*/ + +#define NEXTMACROID_L 037 +#define NEXTMACROID_H 0240 + +#if _FFR_MORE_MACROS +/* table for next id in non-printable ASCII range: disallow some value */ +static int NextMIdTable[] = +{ + /* 0 nul */ 1, + /* 1 soh */ 2, + /* 2 stx */ 3, + /* 3 etx */ 4, + /* 4 eot */ 5, + /* 5 enq */ 6, + /* 6 ack */ 7, + /* 7 bel */ 8, + /* 8 bs */ 14, + /* 9 ht */ -1, + /* 10 nl */ -1, + /* 11 vt */ -1, + /* 12 np */ -1, + /* 13 cr */ -1, + /* 14 so */ 15, + /* 15 si */ 16, + /* 16 dle */ 17, + /* 17 dc1 */ 18, + /* 18 dc2 */ 19, + /* 19 dc3 */ 20, + /* 20 dc4 */ 21, + /* 21 nak */ 22, + /* 22 syn */ 23, + /* 23 etb */ 24, + /* 24 can */ 25, + /* 25 em */ 26, + /* 26 sub */ 27, + /* 27 esc */ 28, + /* 28 fs */ 29, + /* 29 gs */ 30, + /* 30 rs */ 31, + /* 31 us */ 32, + /* 32 sp */ -1, +}; + +#define NEXTMACROID(mid) ( \ + (mid < NEXTMACROID_L) ? (NextMIdTable[mid]) : \ + ((mid < NEXTMACROID_H) ? NEXTMACROID_H : (mid + 1))) + +int NextMacroId = 1; /* codes for long named macros */ /* see sendmail.h: Special characters in rewriting rules. */ +#else /* _FFR_MORE_MACROS */ +int NextMacroId = 0240; /* codes for long named macros */ +#define NEXTMACROID(mid) ((mid) + 1) +#endif /* _FFR_MORE_MACROS */ /* @@ -603,7 +662,7 @@ macid_parse(p, ep) syserr("Macro/class name ({%s}) too long (%d chars max)", mbuf, (int) (sizeof(mbuf) - 1)); } - else if (mbuf[1] == '\0') + else if (mbuf[1] == '\0' && mbuf[0] >= 0x20) { /* ${x} == $x */ mid = bitidx(mbuf[0]); @@ -627,7 +686,8 @@ macid_parse(p, ep) else { MacroName[NextMacroId] = s->s_name; - s->s_macro = mid = NextMacroId++; + s->s_macro = mid = NextMacroId; + NextMacroId = NEXTMACROID(NextMacroId); } } p++; diff --git a/gnu/usr.sbin/sendmail/sendmail/main.c b/gnu/usr.sbin/sendmail/sendmail/main.c index c3b12a67e6e..069b4f06faa 100644 --- a/gnu/usr.sbin/sendmail/sendmail/main.c +++ b/gnu/usr.sbin/sendmail/sendmail/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2006, 2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -26,7 +26,7 @@ SM_UNUSED(static char copyright[]) = The Regents of the University of California. All rights reserved.\n"; #endif /* ! lint */ -SM_RCSID("@(#)$Sendmail: main.c,v 8.962 2006/12/19 19:47:37 ca Exp $") +SM_RCSID("@(#)$Sendmail: main.c,v 8.967 2008/03/31 16:32:13 ca Exp $") #if NETINET || NETINET6 @@ -302,6 +302,9 @@ main(argc, argv, envp) ExitStat = EX_OK; SubmitMode = SUBMIT_UNKNOWN; +#if _FFR_LOCAL_DAEMON + LocalDaemon = false; +#endif /* _FFR_LOCAL_DAEMON */ #if XDEBUG checkfd012("after openlog"); #endif /* XDEBUG */ @@ -401,6 +404,13 @@ main(argc, argv, envp) OpMode = j; break; +#if _FFR_LOCAL_DAEMON + case MD_LOCAL: + OpMode = MD_DAEMON; + LocalDaemon = true; + break; +#endif /* _FFR_LOCAL_DAEMON */ + case MD_FREEZE: (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "Frozen configurations unsupported\n"); @@ -2362,7 +2372,33 @@ main(argc, argv, envp) if (QueueIntvl > 0) { - (void) runqueue(true, false, queuepersistent, true); +#if _FFR_RUNPQG + if (qgrp != NOQGRP) + { + int rwgflags = RWG_NONE; + + /* + ** To run a specific queue group mark it to + ** be run, select the work group it's in and + ** increment the work counter. + */ + + for (i = 0; i < NumQueue && Queue[i] != NULL; + i++) + Queue[i]->qg_nextrun = (time_t) -1; + Queue[qgrp]->qg_nextrun = 0; + if (Verbose) + rwgflags |= RWG_VERBOSE; + if (queuepersistent) + rwgflags |= RWG_PERSISTENT; + rwgflags |= RWG_FORCE; + (void) run_work_group(Queue[qgrp]->qg_wgrp, + rwgflags); + } + else +#endif /* _FFR_RUNPQG */ + (void) runqueue(true, false, queuepersistent, + true); /* ** If queuepersistent but not in daemon mode then @@ -2517,12 +2553,9 @@ main(argc, argv, envp) macdefine(&BlankEnvelope.e_macro, A_TEMP, '_', authinfo); /* at this point we are in a child: reset state */ - { - SM_RPOOL_T *opool = MainEnvelope.e_rpool; - (void) newenvelope(&MainEnvelope, &MainEnvelope, - sm_rpool_new_x(NULL)); - sm_rpool_free(opool); - } + sm_rpool_free(MainEnvelope.e_rpool); + (void) newenvelope(&MainEnvelope, &MainEnvelope, + sm_rpool_new_x(NULL)); } if (LogLevel > 9) diff --git a/gnu/usr.sbin/sendmail/sendmail/map.c b/gnu/usr.sbin/sendmail/sendmail/map.c index 8b99c6c7473..79161067766 100644 --- a/gnu/usr.sbin/sendmail/sendmail/map.c +++ b/gnu/usr.sbin/sendmail/sendmail/map.c @@ -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) 1992, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1992, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: map.c,v 8.696 2007/04/03 21:33:14 ca Exp $") +SM_RCSID("@(#)$Sendmail: map.c,v 8.699 2007/10/10 00:06:45 ca Exp $") #if LDAPMAP # include <sm/ldap.h> @@ -3567,10 +3567,17 @@ ldapmap_lookup(map, name, av, statp) if (VendorCode == VENDOR_SUN && strcmp(map->map_mname, "aliases.ldap") == 0) { - char answer[MAXNAME + 1]; int rc; +#if defined(GETLDAPALIASBYNAME_VERSION) && (GETLDAPALIASBYNAME_VERSION >= 2) + extern char *__getldapaliasbyname(); + char *answer; + + answer = __getldapaliasbyname(name, &rc); +#else + char answer[MAXNAME + 1]; rc = __getldapaliasbyname(name, answer, sizeof(answer)); +#endif if (rc != 0) { if (tTd(38, 20)) @@ -3587,6 +3594,9 @@ ldapmap_lookup(map, name, av, statp) result = map_rewrite(map, name, strlen(name), NULL); else result = map_rewrite(map, answer, strlen(answer), av); +#if defined(GETLDAPALIASBYNAME_VERSION) && (GETLDAPALIASBYNAME_VERSION >= 2) + free(answer); +#endif return result; } #endif /* defined(SUN_EXTENSIONS) && defined(SUN_SIMPLIFIED_LDAP) && ... */ @@ -3965,17 +3975,16 @@ ldapmap_parseargs(map, args) break; switch (*++p) { - case 'N': - map->map_mflags |= MF_INCLNULL; - map->map_mflags &= ~MF_TRY0NULL; + case 'A': + map->map_mflags |= MF_APPEND; break; - case 'O': - map->map_mflags &= ~MF_TRY1NULL; + case 'a': + map->map_app = ++p; break; - case 'o': - map->map_mflags |= MF_OPTIONAL; + case 'D': + map->map_mflags |= MF_DEFER; break; case 'f': @@ -3986,16 +3995,25 @@ ldapmap_parseargs(map, args) map->map_mflags |= MF_MATCHONLY; break; - case 'A': - map->map_mflags |= MF_APPEND; + case 'N': + map->map_mflags |= MF_INCLNULL; + map->map_mflags &= ~MF_TRY0NULL; + break; + + case 'O': + map->map_mflags &= ~MF_TRY1NULL; + break; + + case 'o': + map->map_mflags |= MF_OPTIONAL; break; case 'q': map->map_mflags |= MF_KEEPQUOTES; break; - case 'a': - map->map_app = ++p; + case 'S': + map->map_spacesub = *++p; break; case 'T': @@ -4006,14 +4024,6 @@ ldapmap_parseargs(map, args) map->map_mflags |= MF_NODEFER; break; - case 'S': - map->map_spacesub = *++p; - break; - - case 'D': - map->map_mflags |= MF_DEFER; - break; - case 'z': if (*++p != '\\') map->map_coldelim = *p; @@ -4036,25 +4046,68 @@ ldapmap_parseargs(map, args) break; /* Start of ldapmap specific args */ - case 'V': - if (*++p != '\\') - lmap->ldap_attrsep = *p; - else - { - switch (*++p) - { - case 'n': - lmap->ldap_attrsep = '\n'; - break; + case '1': + map->map_mflags |= MF_SINGLEMATCH; + break; - case 't': - lmap->ldap_attrsep = '\t'; - break; +# if _FFR_LDAP_SINGLEDN + case '2': + map->map_mflags |= MF_SINGLEDN; + break; +# endif /* _FFR_LDAP_SINGLEDN */ - default: - lmap->ldap_attrsep = '\\'; - } + case 'b': /* search base */ + while (isascii(*++p) && isspace(*p)) + continue; + lmap->ldap_base = p; + break; + +# if _FFR_LDAP_NETWORK_TIMEOUT + case 'c': /* network (connect) timeout */ + while (isascii(*++p) && isspace(*p)) + continue; + lmap->ldap_networktmo.tv_sec = atoi(p); + break; +# endif /* _FFR_LDAP_NETWORK_TIMEOUT */ + + case 'd': /* Dn to bind to server as */ + while (isascii(*++p) && isspace(*p)) + continue; + lmap->ldap_binddn = p; + break; + + case 'H': /* Use LDAP URI */ +# if !USE_LDAP_INIT + syserr("Must compile with -DUSE_LDAP_INIT to use LDAP URIs (-H) in map %s", + map->map_mname); + return false; +# else /* !USE_LDAP_INIT */ + if (lmap->ldap_host != NULL) + { + syserr("Can not specify both an LDAP host and an LDAP URI in map %s", + map->map_mname); + return false; } + while (isascii(*++p) && isspace(*p)) + continue; + lmap->ldap_uri = p; + break; +# endif /* !USE_LDAP_INIT */ + + case 'h': /* ldap host */ + while (isascii(*++p) && isspace(*p)) + continue; + if (lmap->ldap_uri != NULL) + { + syserr("Can not specify both an LDAP host and an LDAP URI in map %s", + map->map_mname); + return false; + } + lmap->ldap_host = p; + break; + + case 'K': + lmap->ldap_multi_args = true; break; case 'k': /* search field */ @@ -4063,22 +4116,69 @@ ldapmap_parseargs(map, args) lmap->ldap_filter = p; break; - case 'v': /* attr to return */ + case 'l': /* time limit */ while (isascii(*++p) && isspace(*p)) continue; - lmap->ldap_attr[0] = p; - lmap->ldap_attr[1] = NULL; + lmap->ldap_timelimit = atoi(p); + lmap->ldap_timeout.tv_sec = lmap->ldap_timelimit; break; - case '1': - map->map_mflags |= MF_SINGLEMATCH; + case 'M': /* Method for binding */ + while (isascii(*++p) && isspace(*p)) + continue; + + if (sm_strncasecmp(p, "LDAP_AUTH_", 10) == 0) + p += 10; + + for (lam = LDAPAuthMethods; + lam != NULL && lam->lam_name != NULL; lam++) + { + if (sm_strncasecmp(p, lam->lam_name, + strlen(lam->lam_name)) == 0) + break; + } + if (lam->lam_name != NULL) + lmap->ldap_method = lam->lam_code; + else + { + /* bad config line */ + if (!bitset(MCF_OPTFILE, + map->map_class->map_cflags)) + { + char *ptr; + + if ((ptr = strchr(p, ' ')) != NULL) + *ptr = '\0'; + syserr("Method for binding must be [none|simple|krbv4] (not %s) in map %s", + p, map->map_mname); + if (ptr != NULL) + *ptr = ' '; + return false; + } + } break; -# if _FFR_LDAP_SINGLEDN - case '2': - map->map_mflags |= MF_SINGLEDN; + case 'n': /* retrieve attribute names only */ + lmap->ldap_attrsonly = LDAPMAP_TRUE; + break; + + /* + ** This is a string that is dependent on the + ** method used defined by 'M'. + */ + + case 'P': /* Secret password for binding */ + while (isascii(*++p) && isspace(*p)) + continue; + lmap->ldap_secret = p; + secretread = false; + break; + + case 'p': /* ldap port */ + while (isascii(*++p) && isspace(*p)) + continue; + lmap->ldap_port = atoi(p); break; -# endif /* _FFR_LDAP_SINGLEDN */ /* args stolen from ldapsearch.c */ case 'R': /* don't auto chase referrals */ @@ -4089,10 +4189,6 @@ ldapmap_parseargs(map, args) # endif /* LDAP_REFERRALS */ break; - case 'n': /* retrieve attribute names only */ - lmap->ldap_attrsonly = LDAPMAP_TRUE; - break; - case 'r': /* alias dereferencing */ while (isascii(*++p) && isspace(*p)) continue; @@ -4163,114 +4259,33 @@ ldapmap_parseargs(map, args) } break; - case 'h': /* ldap host */ - while (isascii(*++p) && isspace(*p)) - continue; - if (lmap->ldap_uri != NULL) - { - syserr("Can not specify both an LDAP host and an LDAP URI in map %s", - map->map_mname); - return false; - } - lmap->ldap_host = p; - break; - - case 'b': /* search base */ - while (isascii(*++p) && isspace(*p)) - continue; - lmap->ldap_base = p; - break; - - case 'p': /* ldap port */ - while (isascii(*++p) && isspace(*p)) - continue; - lmap->ldap_port = atoi(p); - break; - - case 'l': /* time limit */ - while (isascii(*++p) && isspace(*p)) - continue; - lmap->ldap_timelimit = atoi(p); - lmap->ldap_timeout.tv_sec = lmap->ldap_timelimit; - break; - - case 'Z': - while (isascii(*++p) && isspace(*p)) - continue; - lmap->ldap_sizelimit = atoi(p); - break; - - case 'd': /* Dn to bind to server as */ - while (isascii(*++p) && isspace(*p)) - continue; - lmap->ldap_binddn = p; - break; - - case 'M': /* Method for binding */ - while (isascii(*++p) && isspace(*p)) - continue; - - if (sm_strncasecmp(p, "LDAP_AUTH_", 10) == 0) - p += 10; - - for (lam = LDAPAuthMethods; - lam != NULL && lam->lam_name != NULL; lam++) - { - if (sm_strncasecmp(p, lam->lam_name, - strlen(lam->lam_name)) == 0) - break; - } - if (lam->lam_name != NULL) - lmap->ldap_method = lam->lam_code; + case 'V': + if (*++p != '\\') + lmap->ldap_attrsep = *p; else { - /* bad config line */ - if (!bitset(MCF_OPTFILE, - map->map_class->map_cflags)) + switch (*++p) { - char *ptr; + case 'n': + lmap->ldap_attrsep = '\n'; + break; - if ((ptr = strchr(p, ' ')) != NULL) - *ptr = '\0'; - syserr("Method for binding must be [none|simple|krbv4] (not %s) in map %s", - p, map->map_mname); - if (ptr != NULL) - *ptr = ' '; - return false; + case 't': + lmap->ldap_attrsep = '\t'; + break; + + default: + lmap->ldap_attrsep = '\\'; } } - break; - /* - ** This is a string that is dependent on the - ** method used defined above. - */ - - case 'P': /* Secret password for binding */ - while (isascii(*++p) && isspace(*p)) - continue; - lmap->ldap_secret = p; - secretread = false; - break; - - case 'H': /* Use LDAP URI */ -# if !USE_LDAP_INIT - syserr("Must compile with -DUSE_LDAP_INIT to use LDAP URIs (-H) in map %s", - map->map_mname); - return false; -# else /* !USE_LDAP_INIT */ - if (lmap->ldap_host != NULL) - { - syserr("Can not specify both an LDAP host and an LDAP URI in map %s", - map->map_mname); - return false; - } + case 'v': /* attr to return */ while (isascii(*++p) && isspace(*p)) continue; - lmap->ldap_uri = p; + lmap->ldap_attr[0] = p; + lmap->ldap_attr[1] = NULL; break; -# endif /* !USE_LDAP_INIT */ case 'w': /* -w should be for passwd, -P should be for version */ @@ -4297,8 +4312,10 @@ ldapmap_parseargs(map, args) # endif /* LDAP_VERSION_MIN */ break; - case 'K': - lmap->ldap_multi_args = true; + case 'Z': + while (isascii(*++p) && isspace(*p)) + continue; + lmap->ldap_sizelimit = atoi(p); break; default: diff --git a/gnu/usr.sbin/sendmail/sendmail/mci.c b/gnu/usr.sbin/sendmail/sendmail/mci.c index dec84dca129..e3450e45532 100644 --- a/gnu/usr.sbin/sendmail/sendmail/mci.c +++ b/gnu/usr.sbin/sendmail/sendmail/mci.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: mci.c,v 8.218 2006/08/15 23:24:57 ca Exp $") +SM_RCSID("@(#)$Sendmail: mci.c,v 8.221 2007/11/13 23:44:25 gshapiro Exp $") #if NETINET || NETINET6 # include <arpa/inet.h> @@ -1143,16 +1143,27 @@ mci_traverse_persistent(action, pathname) pathname, sm_errstring(errno)); return -1; } - len = sizeof(newpath) - MAXNAMLEN - 3; + + /* + ** Reserve space for trailing '/', at least one + ** character, and '\0' + */ + + len = sizeof(newpath) - 3; if (sm_strlcpy(newpath, pathname, len) >= len) { + int save_errno = errno; + if (tTd(56, 2)) sm_dprintf("mci_traverse: path \"%s\" too long", pathname); + (void) closedir(d); + errno = save_errno; return -1; } newptr = newpath + strlen(newpath); *newptr++ = '/'; + len = sizeof(newpath) - (newptr - newpath); /* ** repeat until no file has been removed @@ -1169,9 +1180,17 @@ mci_traverse_persistent(action, pathname) if (e->d_name[0] == '.') continue; - (void) sm_strlcpy(newptr, e->d_name, - sizeof(newpath) - - (newptr - newpath)); + if (sm_strlcpy(newptr, e->d_name, len) >= len) + { + /* Skip truncated copies */ + if (tTd(56, 4)) + { + *newptr = '\0'; + sm_dprintf("mci_traverse: path \"%s%s\" too long", + newpath, e->d_name); + } + continue; + } if (StopRequest) stop_sendmail(); diff --git a/gnu/usr.sbin/sendmail/sendmail/milter.c b/gnu/usr.sbin/sendmail/sendmail/milter.c index 9755c0dc2ad..4d6d4c7e922 100644 --- a/gnu/usr.sbin/sendmail/sendmail/milter.c +++ b/gnu/usr.sbin/sendmail/sendmail/milter.c @@ -10,7 +10,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: milter.c,v 8.267 2007/02/27 22:21:12 ca Exp $") +SM_RCSID("@(#)$Sendmail: milter.c,v 8.269 2007/06/06 17:26:12 ca Exp $") #if MILTER # include <sm/sendmail.h> @@ -51,7 +51,8 @@ static void milter_quit_filter __P((struct milter *, ENVELOPE *)); static void milter_abort_filter __P((struct milter *, ENVELOPE *)); static void milter_send_macros __P((struct milter *, char **, int, ENVELOPE *)); -static int milter_negotiate __P((struct milter *, ENVELOPE *)); +static int milter_negotiate __P((struct milter *, ENVELOPE *, + milters_T *)); static void milter_per_connection_check __P((ENVELOPE *)); static char *milter_headers __P((struct milter *, ENVELOPE *, char *)); static void milter_addheader __P((struct milter *, char *, ssize_t, @@ -1791,41 +1792,6 @@ milter_reset_df(e) } /* -** MILTER_CAN_DELRCPTS -- can any milter filters delete recipients? -** -** Parameters: -** none -** -** Returns: -** true if any filter deletes recipients, false otherwise -*/ - -bool -milter_can_delrcpts() -{ - bool can = false; - int i; - - if (tTd(64, 10)) - sm_dprintf("milter_can_delrcpts:"); - - for (i = 0; InputFilters[i] != NULL; i++) - { - struct milter *m = InputFilters[i]; - - if (bitset(SMFIF_DELRCPT, m->mf_fflags)) - { - can = true; - break; - } - } - if (tTd(64, 10)) - sm_dprintf("%s\n", can ? "true" : "false"); - - return can; -} - -/* ** MILTER_QUIT_FILTER -- close down a single filter ** ** Parameters: @@ -2406,15 +2372,17 @@ milter_getsymlist(m, buf, rlen, offset) ** Parameters: ** m -- milter filter structure. ** e -- current envelope. +** milters -- milters structure. ** ** Returns: ** 0 on success, -1 otherwise */ static int -milter_negotiate(m, e) +milter_negotiate(m, e, milters) struct milter *m; ENVELOPE *e; + milters_T *milters; { char rcmd; mi_int32 fvers, fflags, pflags; @@ -2583,6 +2551,12 @@ milter_negotiate(m, e) milter_getsymlist(m, response, rlen, MILTER_OPTLEN); } + if (bitset(SMFIF_DELRCPT, m->mf_fflags)) + milters->mis_flags |= MIS_FL_DEL_RCPT; + if (!bitset(SMFIP_NORCPT, m->mf_pflags) && + !bitset(SMFIP_NR_RCPT, m->mf_pflags)) + milters->mis_flags |= MIS_FL_REJ_RCPT; + if (tTd(64, 5)) sm_dprintf("milter_negotiate(%s): received: version %u, fflags 0x%x, pflags 0x%x\n", m->mf_name, m->mf_fvers, m->mf_fflags, m->mf_pflags); @@ -3784,6 +3758,7 @@ milter_replbody(response, rlen, newfilter, e) ** Parameters: ** e -- current envelope. ** state -- return state from response. +** milters -- milters structure. ** ** Returns: ** true iff at least one filter is active @@ -3791,15 +3766,17 @@ milter_replbody(response, rlen, newfilter, e) /* ARGSUSED */ bool -milter_init(e, state) +milter_init(e, state, milters) ENVELOPE *e; char *state; + milters_T *milters; { int i; if (tTd(64, 10)) sm_dprintf("milter_init\n"); + memset(milters, '\0', sizeof(*milters)); *state = SMFIR_CONTINUE; if (InputFilters[0] == NULL) { @@ -3821,7 +3798,7 @@ milter_init(e, state) } if (m->mf_sock < 0 || - milter_negotiate(m, e) < 0 || + milter_negotiate(m, e, milters) < 0 || m->mf_state == SMFS_ERROR) { if (tTd(64, 5)) diff --git a/gnu/usr.sbin/sendmail/sendmail/mime.c b/gnu/usr.sbin/sendmail/sendmail/mime.c index e4ca9166555..2802058467a 100644 --- a/gnu/usr.sbin/sendmail/sendmail/mime.c +++ b/gnu/usr.sbin/sendmail/sendmail/mime.c @@ -14,7 +14,7 @@ #include <sendmail.h> #include <string.h> -SM_RCSID("@(#)$Sendmail: mime.c,v 8.146 2006/08/16 16:52:11 ca Exp $") +SM_RCSID("@(#)$Sendmail: mime.c,v 8.147 2007/09/26 23:29:11 ca Exp $") /* ** MIME support. @@ -525,10 +525,14 @@ mime8to7(mci, header, e, boundaries, flags, level) while (sm_io_fgets(e->e_dfp, SM_TIME_DEFAULT, buf, sizeof(buf)) != NULL) { - bt = mimeboundary(buf, boundaries); - if (bt != MBT_NOTSEP) - break; - if (!putline(buf, mci)) + if (!bitset(MCIF_INLONGLINE, mci->mci_flags)) + { + bt = mimeboundary(buf, boundaries); + if (bt != MBT_NOTSEP) + break; + } + if (!putxline(buf, strlen(buf), mci, + PXLF_MAPFROM|PXLF_NOADDEOL)) goto writeerr; } if (sm_io_eof(e->e_dfp)) diff --git a/gnu/usr.sbin/sendmail/sendmail/parseaddr.c b/gnu/usr.sbin/sendmail/sendmail/parseaddr.c index ac1c2b2b011..54eb1dd3ce4 100644 --- a/gnu/usr.sbin/sendmail/sendmail/parseaddr.c +++ b/gnu/usr.sbin/sendmail/sendmail/parseaddr.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: parseaddr.c,v 8.400 2006/12/21 00:24:06 ca Exp $") +SM_RCSID("@(#)$Sendmail: parseaddr.c,v 8.403 2008/02/08 02:27:35 ca Exp $") #include <sm/sendmail.h> #include "map.h" @@ -217,7 +217,7 @@ parseaddr(addr, a, flags, delim, delimptr, e, isrcpt) if (e->e_sendmode == SM_DEFER) msg = "Deferring message until queue run"; if (tTd(20, 1)) - sm_dprintf("parseaddr: queuing message\n"); + sm_dprintf("parseaddr: queueing message\n"); message(msg); if (e->e_message == NULL && e->e_sendmode != SM_DEFER) e->e_message = sm_rpool_strdup_x(e->e_rpool, msg); @@ -1460,6 +1460,7 @@ rewrite(pvp, ruleset, reclevel, e, maxatom) size_t trsize; char *replac; int endtoken; + bool external; STAB *map; char *mapname; char **key_rvp; @@ -1575,6 +1576,7 @@ rewrite(pvp, ruleset, reclevel, e, maxatom) true); argvect[0] = cbuf; replac = map_lookup(map, cbuf, argvect, &rstat, e); + external = replac != NULL; /* if no replacement, use default */ if (replac == NULL && default_rvp != NULL) @@ -1599,7 +1601,8 @@ rewrite(pvp, ruleset, reclevel, e, maxatom) { /* scan the new replacement */ xpvp = prescan(replac, '\0', pvpbuf, - sizeof(pvpbuf), NULL, NULL, + sizeof(pvpbuf), NULL, + external ? NULL : IntTokenTab, false); if (xpvp == NULL) { @@ -2263,7 +2266,7 @@ cataddr(pvp, evp, buf, sz, spacesub, external) { char *q; - natomtok = (ExtTokenTab[**pvp & 0xff] == ATM); + natomtok = (IntTokenTab[**pvp & 0xff] == ATM); if (oatomtok && natomtok) { *p++ = spacesub; diff --git a/gnu/usr.sbin/sendmail/sendmail/queue.c b/gnu/usr.sbin/sendmail/sendmail/queue.c index 79564723463..f3e91a951a0 100644 --- a/gnu/usr.sbin/sendmail/sendmail/queue.c +++ b/gnu/usr.sbin/sendmail/sendmail/queue.c @@ -14,7 +14,7 @@ #include <sendmail.h> #include <sm/sem.h> -SM_RCSID("@(#)$Sendmail: queue.c,v 8.972 2007/03/29 22:55:17 ca Exp $") +SM_RCSID("@(#)$Sendmail: queue.c,v 8.977 2008/02/15 23:19:58 ca Exp $") #include <dirent.h> @@ -427,7 +427,7 @@ queueup(e, announce, msync) break; if (LogLevel > 0 && (i % 32) == 0) sm_syslog(LOG_ALERT, e->e_id, - "queueup: cannot create %s, uid=%d: %s", + "queueup: cannot create %s, euid=%d: %s", tf, (int) geteuid(), sm_errstring(errno)); } @@ -845,8 +845,8 @@ queueup(e, announce, msync) if (bitset(H_FROM, h->h_flags)) oldstyle = false; - - commaize(h, h->h_value, oldstyle, &mcibuf, e); + commaize(h, h->h_value, oldstyle, &mcibuf, e, + PXLF_HEADER); TrafficLogFile = savetrace; } @@ -2147,6 +2147,14 @@ run_work_group(wgrp, flags) maxrunners = Queue[qgrp]->qg_maxqrun; + /* + ** If no runners are configured for this group but + ** the queue is "forced" then lets use 1 runner. + */ + + if (maxrunners == 0 && bitset(RWG_FORCE, flags)) + maxrunners = 1; + /* No need to have more runners then there are jobs */ if (maxrunners > njobs) maxrunners = njobs; @@ -4506,7 +4514,7 @@ readqf(e, openonly) (void) sm_io_close(qfp, SM_TIME_DEFAULT); return false; } - + #if _FFR_QF_PARANOIA /* Check to make sure key fields were read */ if (e->e_from.q_mailer == NULL) @@ -6588,8 +6596,8 @@ init_sem(owner) if (SemId < 0) { sm_syslog(LOG_ERR, NOQID, - "func=init_sem, sem_key=%ld, sm_sem_start=%d", - (long) SemKey, SemId); + "func=init_sem, sem_key=%ld, sm_sem_start=%d, error=%s", + (long) SemKey, SemId, sm_errstring(-SemId)); return; } #endif /* SM_CONF_SEM */ diff --git a/gnu/usr.sbin/sendmail/sendmail/ratectrl.c b/gnu/usr.sbin/sendmail/sendmail/ratectrl.c index 9dfc5b9d1b3..976a996396c 100644 --- a/gnu/usr.sbin/sendmail/sendmail/ratectrl.c +++ b/gnu/usr.sbin/sendmail/sendmail/ratectrl.c @@ -45,7 +45,7 @@ */ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: ratectrl.c,v 8.11 2006/08/15 23:24:57 ca Exp $") +SM_RCSID("@(#)$Sendmail: ratectrl.c,v 8.12 2008/02/11 22:56:05 ca Exp $") /* ** stuff included - given some warnings (inet_ntoa) @@ -114,7 +114,7 @@ connection_rate_check(hostaddr, e) /* update server connection rate */ totalrate = total_rate(now, e == NULL); #if RATECTL_DEBUG - sm_syslog(LOG_INFO, NOQID, "global connection rate: %d", globalRate); + sm_syslog(LOG_INFO, NOQID, "global connection rate: %d", totalrate); #endif /* RATECTL_DEBUG */ /* update client connection rate */ diff --git a/gnu/usr.sbin/sendmail/sendmail/readcf.c b/gnu/usr.sbin/sendmail/sendmail/readcf.c index ead3f2fcccb..83a00c6d8f7 100644 --- a/gnu/usr.sbin/sendmail/sendmail/readcf.c +++ b/gnu/usr.sbin/sendmail/sendmail/readcf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2006, 2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -14,7 +14,7 @@ #include <sendmail.h> #include <sm/sendmail.h> -SM_RCSID("@(#)$Sendmail: readcf.c,v 8.663 2006/10/05 20:58:59 ca Exp $") +SM_RCSID("@(#)$Sendmail: readcf.c,v 8.666 2008/02/14 17:25:14 ca Exp $") #if NETINET || NETINET6 # include <arpa/inet.h> @@ -2245,6 +2245,16 @@ static struct optioninfo # define O_EIGHT_BIT_ADDR_OK 0xdf { "EightBitAddrOK", O_EIGHT_BIT_ADDR_OK, OI_NONE }, #endif /* _FFR_EIGHT_BIT_ADDR_OK */ +#if _FFR_ADDR_TYPE_MODES +# define O_ADDR_TYPE_MODES 0xe0 + { "AddrTypeModes", O_ADDR_TYPE_MODES, OI_NONE }, +#endif /* _FFR_ADDR_TYPE_MODES */ +#if _FFR_BADRCPT_SHUTDOWN +# define O_RCPTSHUTD 0xe1 + { "BadRcptShutdown", O_RCPTSHUTD, OI_SAFE }, +# define O_RCPTSHUTDG 0xe2 + { "BadRcptShutdownGood", O_RCPTSHUTDG, OI_SAFE }, +#endif /* _FFR_BADRCPT_SHUTDOWN */ { NULL, '\0', OI_NONE } }; @@ -3807,6 +3817,22 @@ setoption(opt, val, safe, sticky, e) break; #endif /* _FFR_EIGHT_BIT_ADDR_OK */ +#if _FFR_ADDR_TYPE_MODES + case O_ADDR_TYPE_MODES: + AddrTypeModes = atobool(val); + break; +#endif /* _FFR_ADDR_TYPE_MODES */ + +#if _FFR_BADRCPT_SHUTDOWN + case O_RCPTSHUTD: + BadRcptShutdown = atoi(val); + break; + + case O_RCPTSHUTDG: + BadRcptShutdownGood = atoi(val); + break; +#endif /* _FFR_BADRCPT_SHUTDOWN */ + default: if (tTd(37, 1)) { diff --git a/gnu/usr.sbin/sendmail/sendmail/recipient.c b/gnu/usr.sbin/sendmail/sendmail/recipient.c index 014fc471ceb..fb6592b2b25 100644 --- a/gnu/usr.sbin/sendmail/sendmail/recipient.c +++ b/gnu/usr.sbin/sendmail/sendmail/recipient.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: recipient.c,v 8.348 2007/03/19 21:33:09 ca Exp $") +SM_RCSID("@(#)$Sendmail: recipient.c,v 8.349 2007/07/10 17:01:22 ca Exp $") static void includetimeout __P((int)); static ADDRESS *self_reference __P((ADDRESS *)); @@ -377,6 +377,12 @@ removefromlist(list, sendq, e) { (void) sm_strlcpy(bufp, denlstring(list, false, true), i); +#if _FFR_ADDR_TYPE_MODES + if (AddrTypeModes) + macdefine(&e->e_macro, A_PERM, macid("{addr_type}"), + "e r d"); + else +#endif /* _FFR_ADDR_TYPE_MODES */ macdefine(&e->e_macro, A_PERM, macid("{addr_type}"), "e r"); for (p = bufp; *p != '\0'; ) { diff --git a/gnu/usr.sbin/sendmail/sendmail/sendmail.8 b/gnu/usr.sbin/sendmail/sendmail/sendmail.8 index b22f7cb65c2..a2b06e39a33 100644 --- a/gnu/usr.sbin/sendmail/sendmail/sendmail.8 +++ b/gnu/usr.sbin/sendmail/sendmail/sendmail.8 @@ -9,9 +9,9 @@ .\" the sendmail distribution. .\" .\" -.\" $Sendmail: sendmail.8,v 8.57 2003/12/01 17:02:41 ca Exp $ +.\" $Sendmail: sendmail.8,v 8.58 2007/08/02 05:42:33 ca Exp $ .\" -.Dd December 1, 2003 +.Dd August 2, 2007 .Dt SENDMAIL 8 .Os .Sh NAME diff --git a/gnu/usr.sbin/sendmail/sendmail/sendmail.h b/gnu/usr.sbin/sendmail/sendmail/sendmail.h index 2667bb6e2e9..cfa4a51c426 100644 --- a/gnu/usr.sbin/sendmail/sendmail/sendmail.h +++ b/gnu/usr.sbin/sendmail/sendmail/sendmail.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -52,7 +52,7 @@ #ifdef _DEFINE # ifndef lint -SM_UNUSED(static char SmailId[]) = "@(#)$Sendmail: sendmail.h,v 8.1042 2007/02/27 22:21:13 ca Exp $"; +SM_UNUSED(static char SmailId[]) = "@(#)$Sendmail: sendmail.h,v 8.1059 2008/02/15 23:19:58 ca Exp $"; # endif /* ! lint */ #endif /* _DEFINE */ @@ -324,7 +324,8 @@ typedef struct address ADDRESS; (s) == QS_RETRY) #define QS_IS_ATTEMPTED(s) ((s) == QS_QUEUEUP || \ (s) == QS_RETRY || \ - (s) == QS_SENT) + (s) == QS_SENT || \ + (s) == QS_DISCARDED) #define QS_IS_DEAD(s) ((s) >= QS_DONTSEND) @@ -728,6 +729,7 @@ MCI #if _FFR_IGNORE_EXT_ON_HELO # define MCIF_HELO 0x00800000 /* we used HELO: ignore extensions */ #endif /* _FFR_IGNORE_EXT_ON_HELO */ +#define MCIF_INLONGLINE 0x01000000 /* in the middle of a long line */ #define MCIF_ONLY_EHLO 0x10000000 /* use only EHLO in smtpinit */ /* states */ @@ -824,7 +826,7 @@ extern struct hdrinfo HdrInfo[]; /* functions */ extern void addheader __P((char *, char *, int, ENVELOPE *, bool)); extern unsigned long chompheader __P((char *, int, HDR **, ENVELOPE *)); -extern bool commaize __P((HDR *, char *, bool, MCI *, ENVELOPE *)); +extern bool commaize __P((HDR *, char *, bool, MCI *, ENVELOPE *, int)); extern HDR *copyheader __P((HDR *, SM_RPOOL_T *)); extern void eatheader __P((ENVELOPE *, bool, bool)); extern char *hvalue __P((char *, HDR *)); @@ -894,6 +896,9 @@ struct envelope char *e_bodytype; /* type of message body */ SM_FILE_T *e_dfp; /* data file */ char *e_id; /* code for this entry in queue */ +#if _FFR_SESSID + char *e_sessid; /* session ID for this envelope */ +#endif /* _FFR_SESSID */ int e_qgrp; /* queue group (index into queues) */ int e_qdir; /* index into queue directories */ int e_dfqgrp; /* data file queue group index */ @@ -1546,6 +1551,7 @@ extern void stabapply __P((void (*)(STAB *, int), int)); #define MD_ARPAFTP 'a' /* obsolete ARPANET mode (Grey Book) */ #define MD_DAEMON 'd' /* run as a daemon */ #define MD_FGDAEMON 'D' /* run daemon in foreground */ +#define MD_LOCAL 'l' /* like daemon, but localhost only */ #define MD_VERIFY 'v' /* verify: don't collect or deliver */ #define MD_TEST 't' /* test mode: resolve addrs only */ #define MD_INITALIAS 'i' /* initialize alias database */ @@ -1556,6 +1562,12 @@ extern void stabapply __P((void (*)(STAB *, int), int)); #define MD_PURGESTAT 'H' /* purge persistent host stat info */ #define MD_QUEUERUN 'q' /* queue run */ +#if _FFR_LOCAL_DAEMON +EXTERN bool LocalDaemon; +#else /* _FFR_LOCAL_DAEMON */ +# define LocalDaemon false +#endif /* _FFR_LOCAL_DAEMON */ + /* Note: see also include/sendmail/pathnames.h: GET_CLIENT_CF */ /* values for e_sendmode -- send modes */ @@ -1725,6 +1737,17 @@ struct milter #endif /* _FFR_MILTER_CHECK */ }; +struct milters +{ + mi_int32 mis_flags; /* filter flags */ +}; +typedef struct milters milters_T; + +#define MIS_FL_NONE 0x00000000 /* no requirements... */ +#define MIS_FL_DEL_RCPT 0x00000001 /* can delete rcpt */ +#define MIS_FL_REJ_RCPT 0x00000002 /* can reject rcpt */ + + /* MTA flags */ # define SMF_REJECT 'R' /* Reject connection on filter fail */ # define SMF_TEMPFAIL 'T' /* tempfail connection on failure */ @@ -2082,10 +2105,7 @@ extern unsigned char tTdvect[100]; /* trace vector */ ** The "no queue id" queue id for sm_syslog */ -#define NOQID "*~*" - -/* use id or NOQID (to avoid NOQUEUE in logfile) */ -#define E_ID(id) ((id) == NULL ? NOQID : (id)) +#define NOQID "" #define CURHOSTNAME (CurHostName == NULL ? "local" : CurHostName) @@ -2161,6 +2181,9 @@ extern unsigned char tTdvect[100]; /* trace vector */ ** Global variables. */ +#if _FFR_ADDR_TYPE_MODES +EXTERN bool AddrTypeModes; /* addr_type: extra "mode" information */ +#endif /* _FFR_ADDR_TYPE_MODES */ EXTERN bool AllowBogusHELO; /* allow syntax errors on HELO command */ EXTERN bool CheckAliases; /* parse addresses during newaliases */ #if _FFR_QUEUE_RUN_PARANOIA @@ -2213,6 +2236,10 @@ EXTERN char InetMode; /* default network for daemon mode */ EXTERN char OpMode; /* operation mode, see below */ EXTERN char SpaceSub; /* substitution for <lwsp> */ EXTERN int BadRcptThrottle; /* Throttle rejected RCPTs per SMTP message */ +#if _FFR_BADRCPT_SHUTDOWN +EXTERN int BadRcptShutdown; /* Shutdown connection for rejected RCPTs */ +EXTERN int BadRcptShutdownGood; /* above even when there are good RCPTs */ +#endif /* _FFR_BADRCPT_SHUTDOWN */ EXTERN int CheckpointInterval; /* queue file checkpoint interval */ EXTERN int ConfigLevel; /* config file level */ EXTERN int ConnRateThrottle; /* throttle for SMTP connection rate */ @@ -2435,8 +2462,7 @@ extern int opencontrolsocket __P((void)); extern void milter_config __P((char *, struct milter **, int)); extern void milter_setup __P((char *)); extern void milter_set_option __P((char *, char *, bool)); -extern bool milter_can_delrcpts __P((void)); -extern bool milter_init __P((ENVELOPE *, char *)); +extern bool milter_init __P((ENVELOPE *, char *, milters_T *)); extern void milter_quit __P((ENVELOPE *)); extern void milter_abort __P((ENVELOPE *)); extern char *milter_connect __P((char *, SOCKADDR, ENVELOPE *, char *)); @@ -2575,6 +2601,11 @@ extern void setoption __P((int, char *, bool, bool, ENVELOPE *)); extern sigfunc_t setsignal __P((int, sigfunc_t)); extern void sm_setuserenv __P((const char *, const char *)); extern void settime __P((ENVELOPE *)); +#if STARTTLS +extern void set_tls_rd_tmo __P((int)); +#else /* STARTTLS */ +#define set_tls_rd_tmo(rd_tmo) +#endif /* STARTTLS */ extern char *sfgets __P((char *, int, SM_FILE_T *, time_t, char *)); extern char *shortenstring __P((const char *, size_t)); extern char *shorten_hostname __P((char [])); diff --git a/gnu/usr.sbin/sendmail/sendmail/sfsasl.c b/gnu/usr.sbin/sendmail/sendmail/sfsasl.c index 5db1a5eef26..32cd983c8a9 100644 --- a/gnu/usr.sbin/sendmail/sendmail/sfsasl.c +++ b/gnu/usr.sbin/sendmail/sendmail/sfsasl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2006, 2008 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: sfsasl.c,v 8.115 2006/04/18 21:34:07 ca Exp $") +SM_RCSID("@(#)$Sendmail: sfsasl.c,v 8.117 2008/01/31 18:48:29 ca Exp $") #include <stdlib.h> #include <sendmail.h> #include <sm/time.h> @@ -675,6 +675,26 @@ tls_retry(ssl, rfd, wfd, tlsstart, timeout, err, where) #endif /* ETIMEDOUT */ /* +** SET_TLS_RD_TMO -- read secured information for the caller +** +** Parameters: +** rd_tmo -- read timeout +** +** Results: +** none +** This is a hack: there is no way to pass it in +*/ + +static int tls_rd_tmo = -1; + +void +set_tls_rd_tmo(rd_tmo) + int rd_tmo; +{ + tls_rd_tmo = rd_tmo; +} + +/* ** TLS_READ -- read secured information for the caller ** ** Parameters: @@ -725,7 +745,9 @@ tls_read(fp, buf, size) rfd = SSL_get_rfd(so->con); wfd = SSL_get_wfd(so->con); try = tls_retry(so->con, rfd, wfd, tlsstart, - TimeOuts.to_datablock, ssl_err, "read"); + (tls_rd_tmo < 0) ? TimeOuts.to_datablock + : tls_rd_tmo, + ssl_err, "read"); if (try > 0) goto retry; errno = SM_ERR_TIMEOUT; diff --git a/gnu/usr.sbin/sendmail/sendmail/sm_resolve.c b/gnu/usr.sbin/sendmail/sendmail/sm_resolve.c index a26cea2e4fd..27a06bac2f8 100644 --- a/gnu/usr.sbin/sendmail/sendmail/sm_resolve.c +++ b/gnu/usr.sbin/sendmail/sendmail/sm_resolve.c @@ -46,7 +46,7 @@ # if NAMED_BIND # include "sm_resolve.h" -SM_RCSID("$Sendmail: sm_resolve.c,v 8.34 2006/08/15 23:24:58 ca Exp $") +SM_RCSID("$Sendmail: sm_resolve.c,v 8.36 2008/02/11 23:04:16 ca Exp $") static struct stot { @@ -168,6 +168,7 @@ parse_dns_reply(data, len) int len; { unsigned char *p; + unsigned short ans_cnt, ui; int status; size_t l; char host[MAXHOSTNAMELEN]; @@ -196,11 +197,15 @@ parse_dns_reply(data, len) dns_free_data(r); return NULL; } + + ans_cnt = ntohs((unsigned short) r->dns_r_h.ancount); + p += status; GETSHORT(r->dns_r_q.dns_q_type, p); GETSHORT(r->dns_r_q.dns_q_class, p); rr = &r->dns_r_head; - while (p < data + len) + ui = 0; + while (p < data + len && ui < ans_cnt) { int type, class, ttl, size, txtlen; @@ -210,6 +215,7 @@ parse_dns_reply(data, len) dns_free_data(r); return NULL; } + ++ui; p += status; GETSHORT(type, p); GETSHORT(class, p); diff --git a/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c b/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c index 66c57bc7f12..01873096583 100644 --- a/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c +++ b/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -17,7 +17,7 @@ # include <libmilter/mfdef.h> #endif /* MILTER */ -SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.960 2007/02/07 20:18:47 ca Exp $") +SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.975 2008/03/31 16:32:13 ca Exp $") #include <sm/time.h> #include <sm/fdset.h> @@ -349,14 +349,18 @@ static SM_DEBUG_T DebugLeakSmtp = SM_DEBUG_INITIALIZER("leak_smtp", typedef struct { - bool sm_gotmail; /* mail command received */ - unsigned int sm_nrcpts; /* number of successful RCPT commands */ - bool sm_discard; + bool sm_gotmail; /* mail command received */ + unsigned int sm_nrcpts; /* number of successful RCPT commands */ + bool sm_discard; #if MILTER - bool sm_milterize; - bool sm_milterlist; /* any filters in the list? */ + bool sm_milterize; + bool sm_milterlist; /* any filters in the list? */ + milters_T sm_milters; + + /* e_nrcpts from envelope before recipient() call */ + unsigned int sm_e_nrcpts_orig; #endif /* MILTER */ - char *sm_quarmsg; /* carry quarantining across messages */ + char *sm_quarmsg; /* carry quarantining across messages */ } SMTP_T; static bool smtp_data __P((SMTP_T *, ENVELOPE *)); @@ -633,6 +637,9 @@ smtp(nullserver, d_flags, e) # define p_addr_st NULL #endif /* MILTER */ size_t inplen; +#if _FFR_BADRCPT_SHUTDOWN + int n_badrcpts_adj; +#endif /* _FFR_BADRCPT_SHUTDOWN */ SevenBitInput_Saved = SevenBitInput; smtp.sm_nrcpts = 0; @@ -899,6 +906,8 @@ smtp(nullserver, d_flags, e) #endif /* SASL */ #if STARTTLS + + set_tls_rd_tmo(TimeOuts.to_nextcommand); #endif /* STARTTLS */ #if MILTER @@ -907,7 +916,7 @@ smtp(nullserver, d_flags, e) char state; /* initialize mail filter connection */ - smtp.sm_milterlist = milter_init(e, &state); + smtp.sm_milterlist = milter_init(e, &state, &smtp.sm_milters); switch (state) { case SMFIR_REJECT: @@ -938,6 +947,7 @@ smtp(nullserver, d_flags, e) /* arrange to ignore send list */ e->e_sendqueue = NULL; + lognullconnection = false; goto doquit; } } @@ -1050,10 +1060,10 @@ smtp(nullserver, d_flags, e) if (select(fd + 1, FDSET_CAST &readfds, NULL, NULL, &timeout) > 0 && FD_ISSET(fd, &readfds) && - (eoftest = sm_io_getc(InChannel, SM_TIME_DEFAULT)) + (eoftest = sm_io_getc(InChannel, SM_TIME_DEFAULT)) != SM_IO_EOF) { - sm_io_ungetc(InChannel, SM_TIME_DEFAULT, + sm_io_ungetc(InChannel, SM_TIME_DEFAULT, eoftest); gettimeofday(&ep, NULL); timersub(&ep, &bp, &tp); @@ -1285,7 +1295,7 @@ smtp(nullserver, d_flags, e) { authenticating = SASL_NOT_AUTH; - /* rfc 2254 4. */ + /* RFC 2554 4. */ message("501 5.0.0 AUTH aborted"); RESET_SASLCONN; continue; @@ -1304,7 +1314,7 @@ smtp(nullserver, d_flags, e) { authenticating = SASL_NOT_AUTH; - /* rfc 2254 4. */ + /* RFC 2554 4. */ message("501 5.5.4 cannot decode AUTH parameter %s", inp); # if SASL >= 20000 @@ -1658,7 +1668,21 @@ smtp(nullserver, d_flags, e) break; } - if (ismore) + /* + ** RFC 2554 4. + ** Unlike a zero-length client answer to a + ** 334 reply, a zero- length initial response + ** is sent as a single equals sign ("="). + */ + + if (ismore && *q == '=' && *(q + 1) == '\0') + { + /* will be free()d, don't use in=""; */ + in = xalloc(1); + *in = '\0'; + inlen = 0; + } + else if (ismore) { /* could this be shorter? XXX */ # if SASL >= 20000 @@ -2503,7 +2527,38 @@ smtp(nullserver, d_flags, e) (void) memset(&addr_st, '\0', sizeof(addr_st)); a = NULL; milter_rcpt_added = false; + smtp.sm_e_nrcpts_orig = e->e_nrcpts; #endif +#if _FFR_BADRCPT_SHUTDOWN + /* + ** hack to deal with hack, see below: + ** n_badrcpts is increased is limit is reached. + */ + + n_badrcpts_adj = (BadRcptThrottle > 0 && + n_badrcpts > BadRcptThrottle && + LogLevel > 5) + ? n_badrcpts - 1 : n_badrcpts; + if (BadRcptShutdown > 0 && + n_badrcpts_adj >= BadRcptShutdown && + (BadRcptShutdownGood == 0 || + smtp.sm_nrcpts == 0 || + (n_badrcpts_adj * 100 / + (smtp.sm_nrcpts + n_badrcpts) >= + BadRcptShutdownGood))) + { + if (LogLevel > 5) + sm_syslog(LOG_INFO, e->e_id, + "%s: Possible SMTP RCPT flood, shutting down connection.", + CurSmtpClient); + message("421 4.7.0 %s Too many bad recipients; closing connection", + MyHostName); + + /* arrange to ignore any current send list */ + e->e_sendqueue = NULL; + goto doquit; + } +#endif /* _FFR_BADRCPT_SHUTDOWN */ if (BadRcptThrottle > 0 && n_badrcpts >= BadRcptThrottle) { @@ -2558,13 +2613,18 @@ smtp(nullserver, d_flags, e) #if MILTER /* ** Do not expand recipients at RCPT time (in the call - ** to recipient()). If they are expanded, it - ** is impossible for removefromlist() to figure - ** out the expanded members of the original - ** recipient and mark them as QS_DONTSEND. + ** to recipient()) if a milter can delete or reject + ** a RCPT. If they are expanded, it is impossible + ** for removefromlist() to figure out the expanded + ** members of the original recipient and mark them + ** as QS_DONTSEND. */ - e->e_flags |= EF_VRFYONLY; + if (!(smtp.sm_milterlist && smtp.sm_milterize && + !bitset(EF_DISCARD, e->e_flags)) && + (smtp.sm_milters.mis_flags & + (MIS_FL_DEL_RCPT|MIS_FL_REJ_RCPT)) != 0) + e->e_flags |= EF_VRFYONLY; milter_cmd_done = false; milter_cmd_safe = false; #endif /* MILTER */ @@ -2799,6 +2859,8 @@ smtp(nullserver, d_flags, e) { (void) removefromlist(addr, &e->e_sendqueue, e); milter_cmd_fail = false; + if (smtp.sm_e_nrcpts_orig < e->e_nrcpts) + e->e_nrcpts = smtp.sm_e_nrcpts_orig; } #endif /* MILTER */ } @@ -3557,8 +3619,19 @@ smtp_data(smtp, e) if (aborting) { + ADDRESS *q; + /* Log who the mail would have gone to */ logundelrcpts(e, e->e_message, 8, false); + + /* + ** If something above refused the message, we still haven't + ** accepted responsibility for it. Don't send DSNs. + */ + + for (q = e->e_sendqueue; q != NULL; q = q->q_next) + q->q_flags &= ~Q_PINGFLAGS; + flush_errors(true); buffer_errors(); goto abortmessage; @@ -3738,17 +3811,10 @@ smtp_data(smtp, e) dropenvelope(ee, true, false); } } - sm_rpool_free(e->e_rpool); - - /* - ** At this point, e == &MainEnvelope, but if we did splitting, - ** then CurEnv may point to an envelope structure that was just - ** freed with the rpool. So reset CurEnv *before* calling - ** newenvelope. - */ CurEnv = e; features = e->e_features; + sm_rpool_free(e->e_rpool); newenvelope(e, e, sm_rpool_new_x(NULL)); e->e_flags = BlankEnvelope.e_flags; e->e_features = features; @@ -4026,8 +4092,7 @@ reset_mail_esmtp_args(e) macdefine(&e->e_macro, A_PERM, macid("{dsn_envid}"), NULL); /* "ret" */ - e->e_flags &= EF_RET_PARAM; - e->e_flags &= EF_NO_BODY_RETN; + e->e_flags &= ~(EF_RET_PARAM|EF_NO_BODY_RETN); macdefine(&e->e_macro, A_TEMP, macid("{dsn_ret}"), NULL); #if SASL diff --git a/gnu/usr.sbin/sendmail/sendmail/usersmtp.c b/gnu/usr.sbin/sendmail/sendmail/usersmtp.c index 514e8417dd7..14a78b253f6 100644 --- a/gnu/usr.sbin/sendmail/sendmail/usersmtp.c +++ b/gnu/usr.sbin/sendmail/sendmail/usersmtp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2006, 2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: usersmtp.c,v 8.469 2006/12/13 20:11:15 ca Exp $") +SM_RCSID("@(#)$Sendmail: usersmtp.c,v 8.472 2008/01/31 18:48:29 ca Exp $") #include <sysexits.h> @@ -2703,8 +2703,9 @@ smtpdata(m, mci, e, ctladdr, xstart) } /* terminate the message */ - if (sm_io_fprintf(mci->mci_out, SM_TIME_DEFAULT, ".%s", m->m_eol) == - SM_IO_EOF) + if (sm_io_fprintf(mci->mci_out, SM_TIME_DEFAULT, "%s.%s", + bitset(MCIF_INLONGLINE, mci->mci_flags) ? m->m_eol : "", + m->m_eol) == SM_IO_EOF) goto writeerr; if (TrafficLogFile != NULL) (void) sm_io_fprintf(TrafficLogFile, SM_TIME_DEFAULT, @@ -3076,6 +3077,7 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype) */ bufp = SmtpReplyBuffer; + set_tls_rd_tmo(timeout); for (;;) { register char *p; diff --git a/gnu/usr.sbin/sendmail/sendmail/util.c b/gnu/usr.sbin/sendmail/sendmail/util.c index 9964d36a101..f8fd91df25f 100644 --- a/gnu/usr.sbin/sendmail/sendmail/util.c +++ b/gnu/usr.sbin/sendmail/sendmail/util.c @@ -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 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Sendmail: util.c,v 8.410 2006/12/18 18:36:44 ca Exp $") +SM_RCSID("@(#)$Sendmail: util.c,v 8.414 2007/11/02 17:30:38 ca Exp $") #include <sm/sendmail.h> #include <sysexits.h> @@ -1154,7 +1154,8 @@ putxline(l, len, mci, pxflags) /* output last part */ if (l[0] == '.' && slop == 0 && - bitnset(M_XDOT, mci->mci_mailer->m_flags)) + bitnset(M_XDOT, mci->mci_mailer->m_flags) && + !bitset(MCIF_INLONGLINE, mci->mci_flags)) { if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT, '.') == SM_IO_EOF) @@ -1169,7 +1170,8 @@ putxline(l, len, mci, pxflags) else if (l[0] == 'F' && slop == 0 && bitset(PXLF_MAPFROM, pxflags) && strncmp(l, "From ", 5) == 0 && - bitnset(M_ESCFROM, mci->mci_mailer->m_flags)) + bitnset(M_ESCFROM, mci->mci_mailer->m_flags) && + !bitset(MCIF_INLONGLINE, mci->mci_flags)) { if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT, '>') == SM_IO_EOF) @@ -1188,13 +1190,19 @@ putxline(l, len, mci, pxflags) if (TrafficLogFile != NULL) (void) sm_io_putc(TrafficLogFile, SM_TIME_DEFAULT, '\n'); - if ((!bitset(PXLF_NOADDEOL, pxflags) || !noeol) && - sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT, - mci->mci_mailer->m_eol) == SM_IO_EOF) + if ((!bitset(PXLF_NOADDEOL, pxflags) || !noeol)) { - dead = true; - break; + mci->mci_flags &= ~MCIF_INLONGLINE; + if (sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT, + mci->mci_mailer->m_eol) == SM_IO_EOF) + { + dead = true; + break; + } } + else + mci->mci_flags |= MCIF_INLONGLINE; + if (l < end && *l == '\n') { if (*++l != ' ' && *l != '\t' && *l != '\0' && @@ -2813,7 +2821,15 @@ count_open_connections(hostaddr) if (hostaddr == NULL) return 0; - n = 0; + + /* + ** This code gets called before proc_list_add() gets called, + ** so we (the daemon child for this connection) have not yet + ** counted ourselves. Hence initialize the counter to 1 + ** instead of 0 to compensate. + */ + + n = 1; for (i = 0; i < ProcListSize; i++) { if (ProcListVec[i].proc_pid == NO_PID) diff --git a/gnu/usr.sbin/sendmail/sendmail/version.c b/gnu/usr.sbin/sendmail/sendmail/version.c index 5c6e8f53104..5ca8475cfc9 100644 --- a/gnu/usr.sbin/sendmail/sendmail/version.c +++ b/gnu/usr.sbin/sendmail/sendmail/version.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2007 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2008 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,6 +13,6 @@ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: version.c,v 8.191 2007/04/03 21:21:18 ca Exp $") +SM_RCSID("@(#)$Sendmail: version.c,v 8.208 2008/04/17 17:04:30 ca Exp $") -char Version[] = "8.14.1"; +char Version[] = "8.14.3"; diff --git a/gnu/usr.sbin/sendmail/smrsh/README b/gnu/usr.sbin/sendmail/smrsh/README index ffcc502584d..437b51312eb 100644 --- a/gnu/usr.sbin/sendmail/smrsh/README +++ b/gnu/usr.sbin/sendmail/smrsh/README @@ -24,7 +24,7 @@ Unix C compilers. smrsh should build on most systems with the enclosed Build script: - host.domain% sh Build + host.domain% sh ./Build To compile smrsh.c by hand, use the following command: @@ -36,13 +36,13 @@ compiler, you should compile with the -Bstatic option. host.domain% cc -Bstatic -o smrsh smrsh.c or - host.domain% sh Build LDOPTS=-Bstatic + host.domain% sh ./Build LDOPTS=-Bstatic With gcc, the GNU C compiler, use the -static option. host.domain% cc -static -o smrsh smrsh.c or - host.domain% sh Build LDOPTS=-static + host.domain% sh ./Build LDOPTS=-static The following C defines can be set defined to change the search path and the bin directory used by smrsh. @@ -58,7 +58,7 @@ conf_smrsh_ENVDEF. As root, install smrsh in /usr/libexec. Using the Build script: - host.domain# sh Build install + host.domain# sh ./Build install For manual installation: install smrsh in the /usr/libexec directory, with mode 511. @@ -163,4 +163,4 @@ a typical system follows: host.domain# /usr/sbin/sendmail -bd -q30m -$Revision: 1.5 $, Last updated $Date: 2003/09/17 17:31:41 $ +$Revision: 1.6 $, Last updated $Date: 2008/05/04 18:34:05 $ diff --git a/gnu/usr.sbin/sendmail/vacation/vacation.c b/gnu/usr.sbin/sendmail/vacation/vacation.c index 8486022309c..9a603e92342 100644 --- a/gnu/usr.sbin/sendmail/vacation/vacation.c +++ b/gnu/usr.sbin/sendmail/vacation/vacation.c @@ -20,7 +20,7 @@ SM_IDSTR(copyright, The Regents of the University of California. All rights reserved.\n\ Copyright (c) 1983 Eric P. Allman. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Sendmail: vacation.c,v 8.143 2006/12/19 19:00:43 ca Exp $") +SM_IDSTR(id, "@(#)$Sendmail: vacation.c,v 8.144 2007/05/11 18:50:36 ca Exp $") #include <ctype.h> @@ -46,7 +46,7 @@ uid_t RealUid; gid_t RealGid; char *RealUserName; uid_t RunAsUid; -uid_t RunAsGid; +gid_t RunAsGid; char *RunAsUserName; int Verbose = 2; bool DontInitGroups = false; |