[exim-cvs] cvs commit: exim/exim-src/OS Makefile-Base os.h-L…

Top Page
Delete this message
Reply to this message
Author: Tom Kistner
Date:  
To: exim-cvs
Subject: [exim-cvs] cvs commit: exim/exim-src/OS Makefile-Base os.h-Linux exim/exim-src/scripts MakeLinks exim/exim-src/src acl.c config.h.defaults dk.c dk.h dkim-exim.c dkim-exim.h dkim.c dkim.h drtables.c
tom 2009/02/24 15:57:56 GMT

  Modified files:        (Branch: DEVEL_PDKIM)
    exim-src/OS          Makefile-Base os.h-Linux 
    exim-src/scripts     MakeLinks 
    exim-src/src         acl.c config.h.defaults drtables.c exim.c 
                         exim.h expand.c functions.h globals.c 
                         globals.h receive.c smtp_in.c spool_in.c 
                         transport.c 
    exim-src/src/lookups dkim.c 
    exim-src/src/pdkim   pdkim.c pdkim.h 
    exim-src/src/transports smtp.c smtp.h 
  Added files:           (Branch: DEVEL_PDKIM)
    exim-src/src         dkim.c dkim.h 
  Removed files:         (Branch: DEVEL_PDKIM)
    exim-src/src         dk.c dk.h dkim-exim.c dkim-exim.h 
  Log:
  wip


  Revision  Changes    Path
  1.16.2.2  +3 -4      exim/exim-src/OS/Makefile-Base
  1.7.2.1   +4 -4      exim/exim-src/OS/os.h-Linux
  1.14.2.2  +2 -4      exim/exim-src/scripts/MakeLinks
  1.82.2.1  +5 -199    exim/exim-src/src/acl.c
  1.16.2.1  +0 -2      exim/exim-src/src/config.h.defaults
  1.12.2.1  +0 -440    exim/exim-src/src/dk.c (dead)
  1.3.2.1   +0 -51     exim/exim-src/src/dk.h (dead)
  1.4.2.1   +0 -510    exim/exim-src/src/dkim-exim.c (dead)
  1.1.2.1   +0 -35     exim/exim-src/src/dkim-exim.h (dead)
  1.1.2.1   +159 -0    exim/exim-src/src/dkim.c (new)
  1.1.2.1   +16 -0     exim/exim-src/src/dkim.h (new)
  1.9.2.1   +2 -2      exim/exim-src/src/drtables.c
  1.61.2.1  +3 -6      exim/exim-src/src/exim.c
  1.24.2.1  +2 -5      exim/exim-src/src/exim.h
  1.97.2.1  +1 -62     exim/exim-src/src/expand.c
  1.43.2.1  +1 -1      exim/exim-src/src/functions.h
  1.81.2.1  +1 -7      exim/exim-src/src/globals.c
  1.62.2.1  +1 -7      exim/exim-src/src/globals.h
  1.1.2.1   +1 -1      exim/exim-src/src/lookups/dkim.c
  1.1.2.2   +10 -3     exim/exim-src/src/pdkim/pdkim.c
  1.1.2.2   +5 -3      exim/exim-src/src/pdkim/pdkim.h
  1.45.2.1  +17 -57    exim/exim-src/src/receive.c
  1.63.2.1  +1 -4      exim/exim-src/src/smtp_in.c
  1.23.2.1  +1 -5      exim/exim-src/src/spool_in.c
  1.23.2.1  +4 -60     exim/exim-src/src/transport.c
  1.41.2.1  +18 -38    exim/exim-src/src/transports/smtp.c
  1.14.2.1  +1 -7      exim/exim-src/src/transports/smtp.h


  Index: Makefile-Base
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/OS/Makefile-Base,v
  retrieving revision 1.16.2.1
  retrieving revision 1.16.2.2
  diff -u -r1.16.2.1 -r1.16.2.2
  --- Makefile-Base    24 Feb 2009 13:13:46 -0000    1.16.2.1
  +++ Makefile-Base    24 Feb 2009 15:57:55 -0000    1.16.2.2
  @@ -1,4 +1,4 @@
  -# $Cambridge: exim/exim-src/OS/Makefile-Base,v 1.16.2.1 2009/02/24 13:13:46 tom Exp $
  +# $Cambridge: exim/exim-src/OS/Makefile-Base,v 1.16.2.2 2009/02/24 15:57:55 tom Exp $


# This file is the basis of the main makefile for Exim and friends. The
# makefile at the top level arranges to build the main makefile by calling
@@ -300,14 +300,14 @@

OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
OBJ_WITH_OLD_DEMIME = demime.o
-OBJ_EXPERIMENTAL = bmi_spam.o spf.o srs.o dk.o dcc.o
+OBJ_EXPERIMENTAL = bmi_spam.o spf.o srs.o dcc.o

# Targets for final binaries; the main one has a build number which is
# updated each time. We don't bother with that for the auxiliaries.

   OBJ_EXIM = acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
           directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
  -        filtertest.o globals.o \
  +        filtertest.o globals.o dkim.o \
           header.o host.o ip.o log.o lss.o match.o moan.o \
           os.o parse.o queue.o \
           rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
  @@ -578,7 +578,7 @@
   transport.o:     $(HDRS) transport.c
   tree.o:          $(HDRS) tree.c
   verify.o:        $(HDRS) verify.c
  -
  +dkim.o:          $(HDRS) dkim.c


# Dependencies for WITH_CONTENT_SCAN modules

  @@ -599,7 +599,6 @@
   bmi_spam.o:      $(HDRS) bmi_spam.c
   spf.o:           $(HDRS) spf.h spf.c
   srs.o:           $(HDRS) srs.h srs.c
  -dk.o:            $(HDRS) dk.h dk.c
   dcc.o:           $(HDRS) dcc.h dcc.c


# The module containing tables of available lookups, routers, auths, and

  Index: os.h-Linux
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/OS/os.h-Linux,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- os.h-Linux    4 Oct 2007 13:28:06 -0000    1.7
  +++ os.h-Linux    24 Feb 2009 15:57:55 -0000    1.7.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/OS/os.h-Linux,v 1.7 2007/10/04 13:28:06 tom Exp $ */
  +/* $Cambridge: exim/exim-src/OS/os.h-Linux,v 1.7.2.1 2009/02/24 15:57:55 tom Exp $ */


/* Exim: OS-specific C header file for Linux */

@@ -10,10 +10,10 @@
#define NO_IP_VAR_H
#define SIG_IGN_WORKS

-/* When using the experimental Domainkeys/DKIM extensions, setting
-HAVE_LINUX_SENDFILE can increase performance on outgoing mail a bit.
-Note: With older glibc versions this setting will conflict with the
-_FILE_OFFSET_BITS=64 setting defined as part of the Linux CFLAGS. */
+/* When using the DKIM, setting HAVE_LINUX_SENDFILE can increase
+performance on outgoing mail a bit. Note: With older glibc versions
+this setting will conflict with the _FILE_OFFSET_BITS=64 setting
+defined as part of the Linux CFLAGS. */

/* #define HAVE_LINUX_SENDFILE */


  Index: MakeLinks
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/scripts/MakeLinks,v
  retrieving revision 1.14.2.1
  retrieving revision 1.14.2.2
  diff -u -r1.14.2.1 -r1.14.2.2
  --- MakeLinks    24 Feb 2009 13:13:47 -0000    1.14.2.1
  +++ MakeLinks    24 Feb 2009 15:57:55 -0000    1.14.2.2
  @@ -1,5 +1,5 @@
   #!/bin/sh
  -# $Cambridge: exim/exim-src/scripts/MakeLinks,v 1.14.2.1 2009/02/24 13:13:47 tom Exp $
  +# $Cambridge: exim/exim-src/scripts/MakeLinks,v 1.14.2.2 2009/02/24 15:57:55 tom Exp $


   # Script to build links for all the exim source files from the system-
   # specific build directory. It should be run from within that directory.
  @@ -279,6 +279,8 @@
   ln -s ../src/tree.c            tree.c
   ln -s ../src/verify.c          verify.c
   ln -s ../src/version.c         version.c
  +ln -s ../src/dkim.c            dkim.c
  +ln -s ../src/dkim.h            dkim.h


   # WITH_CONTENT_SCAN
   ln -s ../src/spam.c            spam.c
  @@ -300,10 +302,6 @@
   ln -s ../src/spf.h             spf.h
   ln -s ../src/srs.c             srs.c
   ln -s ../src/srs.h             srs.h
  -ln -s ../src/dk.c              dk.c
  -ln -s ../src/dk.h              dk.h
  -ln -s ../src/dkim-exim.c       dkim-exim.c
  -ln -s ../src/dkim-exim.h       dkim-exim.h
   ln -s ../src/dcc.c             dcc.c
   ln -s ../src/dcc.h             dcc.h





  Index: acl.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/acl.c,v
  retrieving revision 1.82
  retrieving revision 1.82.2.1
  diff -u -r1.82 -r1.82.2.1
  --- acl.c    12 Feb 2008 12:52:51 -0000    1.82
  +++ acl.c    24 Feb 2009 15:57:55 -0000    1.82.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/acl.c,v 1.82 2008/02/12 12:52:51 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/acl.c,v 1.82.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -65,14 +65,6 @@
   #ifdef WITH_OLD_DEMIME
          ACLC_DEMIME,
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -       ACLC_DK_DOMAIN_SOURCE,
  -       ACLC_DK_POLICY,
  -       ACLC_DK_SENDER_DOMAINS,
  -       ACLC_DK_SENDER_LOCAL_PARTS,
  -       ACLC_DK_SENDERS,
  -       ACLC_DK_STATUS,
  -#endif
          ACLC_DNSLISTS,
          ACLC_DOMAINS,
          ACLC_ENCRYPTED,
  @@ -131,14 +123,6 @@
   #ifdef WITH_OLD_DEMIME
     US"demime",
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -  US"dk_domain_source",
  -  US"dk_policy",
  -  US"dk_sender_domains",
  -  US"dk_sender_local_parts",
  -  US"dk_senders",
  -  US"dk_status",
  -#endif
     US"dnslists",
     US"domains",
     US"encrypted",
  @@ -179,10 +163,7 @@
     #ifdef EXPERIMENTAL_BRIGHTMAIL
     CONTROL_BMI_RUN,
     #endif
  -  #ifdef EXPERIMENTAL_DOMAINKEYS
  -  CONTROL_DK_VERIFY,
  -  #endif
  -  #ifdef EXPERIMENTAL_DKIM
  +  #ifndef DISABLE_DKIM
     CONTROL_DKIM_VERIFY,
     #endif
     CONTROL_ERROR,
  @@ -215,10 +196,7 @@
     #ifdef EXPERIMENTAL_BRIGHTMAIL
     US"bmi_run",
     #endif
  -  #ifdef EXPERIMENTAL_DOMAINKEYS
  -  US"dk_verify",
  -  #endif
  -  #ifdef EXPERIMENTAL_DKIM
  +  #ifndef DISABLE_DKIM
     US"dkim_verify",
     #endif
     US"error",
  @@ -265,14 +243,6 @@
   #ifdef WITH_OLD_DEMIME
     TRUE,    /* demime */
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -  TRUE,    /* dk_domain_source */
  -  TRUE,    /* dk_policy */
  -  TRUE,    /* dk_sender_domains */
  -  TRUE,    /* dk_sender_local_parts */
  -  TRUE,    /* dk_senders */
  -  TRUE,    /* dk_status */
  -#endif
     TRUE,    /* dnslists */
     FALSE,   /* domains */
     FALSE,   /* encrypted */
  @@ -329,14 +299,6 @@
   #ifdef WITH_OLD_DEMIME
     FALSE,   /* demime */
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -  FALSE,   /* dk_domain_source */
  -  FALSE,   /* dk_policy */
  -  FALSE,   /* dk_sender_domains */
  -  FALSE,   /* dk_sender_local_parts */
  -  FALSE,   /* dk_senders */
  -  FALSE,   /* dk_status */
  -#endif
     FALSE,   /* dnslists */
     FALSE,   /* domains */
     FALSE,   /* encrypted */
  @@ -426,56 +388,6 @@
     ~((1<<ACL_WHERE_DATA)|(1<<ACL_WHERE_NOTSMTP)),   /* demime */
     #endif


  -  #ifdef EXPERIMENTAL_DOMAINKEYS
  -  (1<<ACL_WHERE_AUTH)|                             /* dk_domain_source */
  -    (1<<ACL_WHERE_CONNECT)|(1<<ACL_WHERE_HELO)|
  -    (1<<ACL_WHERE_RCPT)|(1<<ACL_WHERE_PREDATA)|
  -    (1<<ACL_WHERE_ETRN)|(1<<ACL_WHERE_EXPN)|
  -    (1<<ACL_WHERE_MAILAUTH)|(1<<ACL_WHERE_QUIT)|
  -    (1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_STARTTLS)|
  -    (1<<ACL_WHERE_VRFY)|(1<<ACL_WHERE_NOTSMTP_START),
  -
  -  (1<<ACL_WHERE_AUTH)|                             /* dk_policy */
  -    (1<<ACL_WHERE_CONNECT)|(1<<ACL_WHERE_HELO)|
  -    (1<<ACL_WHERE_RCPT)|(1<<ACL_WHERE_PREDATA)|
  -    (1<<ACL_WHERE_ETRN)|(1<<ACL_WHERE_EXPN)|
  -    (1<<ACL_WHERE_MAILAUTH)|(1<<ACL_WHERE_QUIT)|
  -    (1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_STARTTLS)|
  -    (1<<ACL_WHERE_VRFY)|(1<<ACL_WHERE_NOTSMTP_START),
  -
  -  (1<<ACL_WHERE_AUTH)|                             /* dk_sender_domains */
  -    (1<<ACL_WHERE_CONNECT)|(1<<ACL_WHERE_HELO)|
  -    (1<<ACL_WHERE_RCPT)|(1<<ACL_WHERE_PREDATA)|
  -    (1<<ACL_WHERE_ETRN)|(1<<ACL_WHERE_EXPN)|
  -    (1<<ACL_WHERE_MAILAUTH)|(1<<ACL_WHERE_QUIT)|
  -    (1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_STARTTLS)|
  -    (1<<ACL_WHERE_VRFY)|(1<<ACL_WHERE_NOTSMTP_START),
  -
  -  (1<<ACL_WHERE_AUTH)|                             /* dk_sender_local_parts */
  -    (1<<ACL_WHERE_CONNECT)|(1<<ACL_WHERE_HELO)|
  -    (1<<ACL_WHERE_RCPT)|(1<<ACL_WHERE_PREDATA)|
  -    (1<<ACL_WHERE_ETRN)|(1<<ACL_WHERE_EXPN)|
  -    (1<<ACL_WHERE_MAILAUTH)|(1<<ACL_WHERE_QUIT)|
  -    (1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_STARTTLS)|
  -    (1<<ACL_WHERE_VRFY)|(1<<ACL_WHERE_NOTSMTP_START),
  -
  -  (1<<ACL_WHERE_AUTH)|                             /* dk_senders */
  -    (1<<ACL_WHERE_CONNECT)|(1<<ACL_WHERE_HELO)|
  -    (1<<ACL_WHERE_RCPT)|(1<<ACL_WHERE_PREDATA)|
  -    (1<<ACL_WHERE_ETRN)|(1<<ACL_WHERE_EXPN)|
  -    (1<<ACL_WHERE_MAILAUTH)|(1<<ACL_WHERE_QUIT)|
  -    (1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_STARTTLS)|
  -    (1<<ACL_WHERE_VRFY)|(1<<ACL_WHERE_NOTSMTP_START),
  -
  -  (1<<ACL_WHERE_AUTH)|                             /* dk_status */
  -    (1<<ACL_WHERE_CONNECT)|(1<<ACL_WHERE_HELO)|
  -    (1<<ACL_WHERE_RCPT)|(1<<ACL_WHERE_PREDATA)|
  -    (1<<ACL_WHERE_ETRN)|(1<<ACL_WHERE_EXPN)|
  -    (1<<ACL_WHERE_MAILAUTH)|(1<<ACL_WHERE_QUIT)|
  -    (1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_STARTTLS)|
  -    (1<<ACL_WHERE_VRFY)|(1<<ACL_WHERE_NOTSMTP_START),
  -  #endif
  -
     (1<<ACL_WHERE_NOTSMTP)|                          /* dnslists */
       (1<<ACL_WHERE_NOTSMTP_START),


  @@ -580,12 +492,7 @@
     0,                                               /* bmi_run */
     #endif


  -  #ifdef EXPERIMENTAL_DOMAINKEYS
  -  (1<<ACL_WHERE_DATA)|(1<<ACL_WHERE_NOTSMTP)|      /* dk_verify */
  -    (1<<ACL_WHERE_NOTSMTP_START),
  -  #endif
  -
  -  #ifdef EXPERIMENTAL_DKIM
  +  #ifndef DISABLE_DKIM
     (1<<ACL_WHERE_DATA)|(1<<ACL_WHERE_NOTSMTP)|      /* dkim_verify */
       (1<<ACL_WHERE_NOTSMTP_START),
     #endif
  @@ -666,10 +573,7 @@
   #ifdef EXPERIMENTAL_BRIGHTMAIL
     { US"bmi_run",                 CONTROL_BMI_RUN, FALSE },
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -  { US"dk_verify",               CONTROL_DK_VERIFY, FALSE },
  -#endif
  -#ifdef EXPERIMENTAL_DKIM
  +#ifndef DISABLE_DKIM
     { US"dkim_verify",             CONTROL_DKIM_VERIFY, FALSE },
   #endif
     { US"caseful_local_part",      CONTROL_CASEFUL_LOCAL_PART, FALSE },
  @@ -2650,13 +2554,7 @@
         break;
         #endif


  -      #ifdef EXPERIMENTAL_DOMAINKEYS
  -      case CONTROL_DK_VERIFY:
  -      dk_do_verify = 1;
  -      break;
  -      #endif
  -
  -      #ifdef EXPERIMENTAL_DKIM
  +      #ifndef DISABLE_DKIM
         case CONTROL_DKIM_VERIFY:
         dkim_do_verify = 1;
         break;
  @@ -2862,98 +2760,6 @@
       break;
       #endif


  -    #ifdef EXPERIMENTAL_DOMAINKEYS
  -    case ACLC_DK_DOMAIN_SOURCE:
  -    if (dk_verify_block == NULL) { rc = FAIL; break; };
  -    /* check header source of domain against given string */
  -    switch (dk_verify_block->address_source) {
  -      case DK_EXIM_ADDRESS_FROM_FROM:
  -        rc = match_isinlist(US"from", &arg, 0, NULL,
  -                            NULL, MCL_STRING, TRUE, NULL);
  -      break;
  -      case DK_EXIM_ADDRESS_FROM_SENDER:
  -        rc = match_isinlist(US"sender", &arg, 0, NULL,
  -                            NULL, MCL_STRING, TRUE, NULL);
  -      break;
  -      case DK_EXIM_ADDRESS_NONE:
  -        rc = match_isinlist(US"none", &arg, 0, NULL,
  -                            NULL, MCL_STRING, TRUE, NULL);
  -      break;
  -      }
  -    break;
  -
  -    case ACLC_DK_POLICY:
  -    if (dk_verify_block == NULL) { rc = FAIL; break; };
  -    /* check policy against given string, default FAIL */
  -    rc = FAIL;
  -    if (dk_verify_block->signsall)
  -      rc = match_isinlist(US"signsall", &arg, 0, NULL,
  -                          NULL, MCL_STRING, TRUE, NULL);
  -    if (dk_verify_block->testing)
  -      rc = match_isinlist(US"testing", &arg, 0, NULL,
  -                          NULL, MCL_STRING, TRUE, NULL);
  -    break;
  -
  -    case ACLC_DK_SENDER_DOMAINS:
  -    if (dk_verify_block == NULL) { rc = FAIL; break; };
  -    if (dk_verify_block->domain != NULL)
  -      rc = match_isinlist(dk_verify_block->domain, &arg, 0, &domainlist_anchor,
  -                          NULL, MCL_DOMAIN, TRUE, NULL);
  -    else rc = FAIL;
  -    break;
  -
  -    case ACLC_DK_SENDER_LOCAL_PARTS:
  -    if (dk_verify_block == NULL) { rc = FAIL; break; };
  -    if (dk_verify_block->local_part != NULL)
  -      rc = match_isinlist(dk_verify_block->local_part, &arg, 0, &localpartlist_anchor,
  -                          NULL, MCL_LOCALPART, TRUE, NULL);
  -    else rc = FAIL;
  -    break;
  -
  -    case ACLC_DK_SENDERS:
  -    if (dk_verify_block == NULL) { rc = FAIL; break; };
  -    if (dk_verify_block->address != NULL)
  -      rc = match_address_list(dk_verify_block->address, TRUE, TRUE, &arg, NULL, -1, 0, NULL);
  -    else rc = FAIL;
  -    break;
  -
  -    case ACLC_DK_STATUS:
  -    if (dk_verify_block == NULL) { rc = FAIL; break; };
  -    if (dk_verify_block->result > 0) {
  -      switch(dk_verify_block->result) {
  -        case DK_EXIM_RESULT_BAD_FORMAT:
  -          rc = match_isinlist(US"bad format", &arg, 0, NULL,
  -                              NULL, MCL_STRING, TRUE, NULL);
  -        break;
  -        case DK_EXIM_RESULT_NO_KEY:
  -          rc = match_isinlist(US"no key", &arg, 0, NULL,
  -                              NULL, MCL_STRING, TRUE, NULL);
  -        break;
  -        case DK_EXIM_RESULT_NO_SIGNATURE:
  -          rc = match_isinlist(US"no signature", &arg, 0, NULL,
  -                              NULL, MCL_STRING, TRUE, NULL);
  -        break;
  -        case DK_EXIM_RESULT_REVOKED:
  -          rc = match_isinlist(US"revoked", &arg, 0, NULL,
  -                              NULL, MCL_STRING, TRUE, NULL);
  -        break;
  -        case DK_EXIM_RESULT_NON_PARTICIPANT:
  -          rc = match_isinlist(US"non-participant", &arg, 0, NULL,
  -                              NULL, MCL_STRING, TRUE, NULL);
  -        break;
  -        case DK_EXIM_RESULT_GOOD:
  -          rc = match_isinlist(US"good", &arg, 0, NULL,
  -                              NULL, MCL_STRING, TRUE, NULL);
  -        break;
  -        case DK_EXIM_RESULT_BAD:
  -          rc = match_isinlist(US"bad", &arg, 0, NULL,
  -                              NULL, MCL_STRING, TRUE, NULL);
  -        break;
  -        }
  -      }
  -    break;
  -    #endif
  -
       case ACLC_DNSLISTS:
       rc = verify_check_dnsbl(&arg);
       break;


  Index: config.h.defaults
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/config.h.defaults,v
  retrieving revision 1.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  --- config.h.defaults    17 Jan 2008 13:03:35 -0000    1.16
  +++ config.h.defaults    24 Feb 2009 15:57:55 -0000    1.16.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/config.h.defaults,v 1.16 2008/01/17 13:03:35 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/config.h.defaults,v 1.16.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -150,8 +150,6 @@
   /* EXPERIMENTAL features */
   #define EXPERIMENTAL_SPF
   #define EXPERIMENTAL_SRS
  -#define EXPERIMENTAL_DOMAINKEYS
  -#define EXPERIMENTAL_DKIM
   #define EXPERIMENTAL_BRIGHTMAIL
   #define EXPERIMENTAL_DCC



  Index: drtables.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/drtables.c,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- drtables.c    28 Sep 2007 12:21:57 -0000    1.9
  +++ drtables.c    24 Feb 2009 15:57:55 -0000    1.9.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/drtables.c,v 1.9 2007/09/28 12:21:57 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/drtables.c,v 1.9.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -105,7 +105,7 @@
   #include "lookups/whoson.h"
   #endif


-#ifdef EXPERIMENTAL_DKIM
+#ifndef DISABLE_DKIM
#include "lookups/dkim.h"
#endif

  @@ -181,7 +181,7 @@
     {
     US"dkim",                      /* lookup name */
     lookup_querystyle,             /* query style */
  -#ifdef EXPERIMENTAL_DKIM
  +#ifndef DISABLE_DKIM
     dkim_open,                     /* open function */
     NULL,                          /* check function */
     dkim_find,                     /* find function */


  Index: exim.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/exim.c,v
  retrieving revision 1.61
  retrieving revision 1.61.2.1
  diff -u -r1.61 -r1.61.2.1
  --- exim.c    12 Oct 2008 09:58:13 -0000    1.61
  +++ exim.c    24 Feb 2009 15:57:55 -0000    1.61.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/exim.c,v 1.61 2008/10/12 09:58:13 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/exim.c,v 1.61.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -905,6 +905,9 @@
   #ifdef WITH_CONTENT_SCAN
     fprintf(f, " Content_Scanning");
   #endif
  +#ifndef DISABLE_DKIM
  +  fprintf(f, " DKIM");
  +#endif
   #ifdef WITH_OLD_DEMIME
     fprintf(f, " Old_Demime");
   #endif
  @@ -917,12 +920,6 @@
   #ifdef EXPERIMENTAL_BRIGHTMAIL
     fprintf(f, " Experimental_Brightmail");
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -  fprintf(f, " Experimental_DomainKeys");
  -#endif
  -#ifdef EXPERIMENTAL_DKIM
  -  fprintf(f, " Experimental_DKIM");
  -#endif
   #ifdef EXPERIMENTAL_DCC
     fprintf(f, " Experimental_DCC");
   #endif


  Index: exim.h
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/exim.h,v
  retrieving revision 1.24
  retrieving revision 1.24.2.1
  diff -u -r1.24 -r1.24.2.1
  --- exim.h    16 Jan 2008 13:44:45 -0000    1.24
  +++ exim.h    24 Feb 2009 15:57:55 -0000    1.24.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/exim.h,v 1.24 2008/01/16 13:44:45 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/exim.h,v 1.24.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -446,11 +446,8 @@
   #ifdef EXPERIMENTAL_SRS
   #include "srs.h"
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -#include "dk.h"
  -#endif
  -#ifdef EXPERIMENTAL_DKIM
  -#include "dkim-exim.h"
  +#ifndef DISABLE_DKIM
  +#include "dkim.h"
   #endif


/* The following stuff must follow the inclusion of config.h because it

  Index: expand.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/expand.c,v
  retrieving revision 1.97
  retrieving revision 1.97.2.1
  diff -u -r1.97 -r1.97.2.1
  --- expand.c    12 Dec 2008 14:51:47 -0000    1.97
  +++ expand.c    24 Feb 2009 15:57:55 -0000    1.97.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/expand.c,v 1.97 2008/12/12 14:51:47 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/expand.c,v 1.97.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -364,9 +364,6 @@
     vtype_load_avg,       /* value not used; result is int from os_getloadavg */
     vtype_pspace,         /* partition space; value is T/F for spool/log */
     vtype_pinodes         /* partition inodes; value is T/F for spool/log */
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  - ,vtype_dk_verify       /* Serve request out of DomainKeys verification structure */
  -#endif
     };


   /* This table must be kept in alphabetical order. */
  @@ -404,20 +401,7 @@
     { "demime_errorlevel",   vtype_int,         &demime_errorlevel },
     { "demime_reason",       vtype_stringptr,   &demime_reason },
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -  { "dk_domain",           vtype_stringptr,   &dk_signing_domain },
  -  { "dk_is_signed",        vtype_dk_verify,   NULL },
  -  { "dk_result",           vtype_dk_verify,   NULL },
  -  { "dk_selector",         vtype_stringptr,   &dk_signing_selector },
  -  { "dk_sender",           vtype_dk_verify,   NULL },
  -  { "dk_sender_domain",    vtype_dk_verify,   NULL },
  -  { "dk_sender_local_part",vtype_dk_verify,   NULL },
  -  { "dk_sender_source",    vtype_dk_verify,   NULL },
  -  { "dk_signsall",         vtype_dk_verify,   NULL },
  -  { "dk_status",           vtype_dk_verify,   NULL },
  -  { "dk_testing",          vtype_dk_verify,   NULL },
  -#endif
  -#ifdef EXPERIMENTAL_DKIM
  +#ifndef DISABLE_DKIM
     { "dkim_domain",         vtype_stringptr,   &dkim_signing_domain },
     { "dkim_selector",       vtype_stringptr,   &dkim_signing_selector },
   #endif
  @@ -1382,51 +1366,6 @@


     switch (var_table[middle].type)
       {
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -
  -    case vtype_dk_verify:
  -    if (dk_verify_block == NULL) return US"";
  -    s = NULL;
  -    if (Ustrcmp(var_table[middle].name, "dk_result") == 0)
  -      s = dk_verify_block->result_string;
  -    if (Ustrcmp(var_table[middle].name, "dk_sender") == 0)
  -      s = dk_verify_block->address;
  -    if (Ustrcmp(var_table[middle].name, "dk_sender_domain") == 0)
  -      s = dk_verify_block->domain;
  -    if (Ustrcmp(var_table[middle].name, "dk_sender_local_part") == 0)
  -      s = dk_verify_block->local_part;
  -
  -    if (Ustrcmp(var_table[middle].name, "dk_sender_source") == 0)
  -      switch(dk_verify_block->address_source) {
  -        case DK_EXIM_ADDRESS_NONE: s = US"0"; break;
  -        case DK_EXIM_ADDRESS_FROM_FROM: s = US"from"; break;
  -        case DK_EXIM_ADDRESS_FROM_SENDER: s = US"sender"; break;
  -      }
  -
  -    if (Ustrcmp(var_table[middle].name, "dk_status") == 0)
  -      switch(dk_verify_block->result) {
  -        case DK_EXIM_RESULT_ERR: s = US"error"; break;
  -        case DK_EXIM_RESULT_BAD_FORMAT: s = US"bad format"; break;
  -        case DK_EXIM_RESULT_NO_KEY: s = US"no key"; break;
  -        case DK_EXIM_RESULT_NO_SIGNATURE: s = US"no signature"; break;
  -        case DK_EXIM_RESULT_REVOKED: s = US"revoked"; break;
  -        case DK_EXIM_RESULT_NON_PARTICIPANT: s = US"non-participant"; break;
  -        case DK_EXIM_RESULT_GOOD: s = US"good"; break;
  -        case DK_EXIM_RESULT_BAD: s = US"bad"; break;
  -      }
  -
  -    if (Ustrcmp(var_table[middle].name, "dk_signsall") == 0)
  -      s = (dk_verify_block->signsall)? US"1" : US"0";
  -
  -    if (Ustrcmp(var_table[middle].name, "dk_testing") == 0)
  -      s = (dk_verify_block->testing)? US"1" : US"0";
  -
  -    if (Ustrcmp(var_table[middle].name, "dk_is_signed") == 0)
  -      s = (dk_verify_block->is_signed)? US"1" : US"0";
  -
  -    return (s == NULL)? US"" : s;
  -#endif
  -
       case vtype_filter_int:
       if (!filter_running) return NULL;
       /* Fall through */


  Index: functions.h
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/functions.h,v
  retrieving revision 1.43
  retrieving revision 1.43.2.1
  diff -u -r1.43 -r1.43.2.1
  --- functions.h    18 Dec 2008 13:13:54 -0000    1.43
  +++ functions.h    24 Feb 2009 15:57:55 -0000    1.43.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/functions.h,v 1.43 2008/12/18 13:13:54 michael Exp $ */
  +/* $Cambridge: exim/exim-src/src/functions.h,v 1.43.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -83,7 +83,7 @@
   extern int     demime(uschar **);
   #endif
   extern BOOL    directory_make(uschar *, uschar *, int, BOOL);
  -#if (defined EXPERIMENTAL_DOMAINKEYS) || (defined EXPERIMENTAL_DKIM)
  +#ifndef DISABLE_DKIM
   extern BOOL    dkim_transport_write_message(address_item *, int, int,
                      int, uschar *, uschar *, uschar *, uschar *, rewrite_rule *,
                      int, uschar *, uschar *, uschar *, uschar *, uschar *, uschar *,


  Index: globals.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/globals.c,v
  retrieving revision 1.81
  retrieving revision 1.81.2.1
  diff -u -r1.81 -r1.81.2.1
  --- globals.c    12 Feb 2008 12:52:51 -0000    1.81
  +++ globals.c    24 Feb 2009 15:57:55 -0000    1.81.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/globals.c,v 1.81 2008/02/12 12:52:51 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/globals.c,v 1.81.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -526,13 +526,7 @@
   BOOL    disable_ipv6           = FALSE;
   BOOL    disable_logging        = FALSE;


  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -uschar *dk_signing_domain      = NULL;
  -uschar *dk_signing_selector    = NULL;
  -int     dk_do_verify           = 0;
  -#endif
  -
  -#ifdef EXPERIMENTAL_DKIM
  +#ifndef DISABLE_DKIM
   uschar *dkim_signing_domain      = NULL;
   uschar *dkim_signing_selector    = NULL;
   int     dkim_do_verify           = 0;


  Index: globals.h
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/globals.h,v
  retrieving revision 1.62
  retrieving revision 1.62.2.1
  diff -u -r1.62 -r1.62.2.1
  --- globals.h    12 Feb 2008 12:52:51 -0000    1.62
  +++ globals.h    24 Feb 2009 15:57:55 -0000    1.62.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/globals.h,v 1.62 2008/02/12 12:52:51 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/globals.h,v 1.62.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -295,13 +295,7 @@
   extern BOOL    disable_ipv6;           /* Don't do any IPv6 things */
   extern BOOL    disable_logging;        /* Disables log writing when TRUE */


  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -extern uschar *dk_signing_domain;      /* Domain used for signing a message. */
  -extern uschar *dk_signing_selector;    /* Selector used for signing a message. */
  -extern int     dk_do_verify;           /* DK verification switch. Set with ACL control statement. */
  -#endif
  -
  -#ifdef EXPERIMENTAL_DKIM
  +#ifndef DISABLE_DKIM
   extern uschar *dkim_signing_domain;      /* Domain used for signing a message. */
   extern uschar *dkim_signing_selector;    /* Selector used for signing a message. */
   extern int     dkim_do_verify;           /* DKIM verification switch. Set with ACL control statement. */


  Index: receive.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/receive.c,v
  retrieving revision 1.45
  retrieving revision 1.45.2.1
  diff -u -r1.45 -r1.45.2.1
  --- receive.c    2 Jan 2009 17:12:03 -0000    1.45
  +++ receive.c    24 Feb 2009 15:57:55 -0000    1.45.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/receive.c,v 1.45 2009/01/02 17:12:03 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/receive.c,v 1.45.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -11,38 +11,6 @@


#include "exim.h"

  -#if (defined EXPERIMENTAL_DOMAINKEYS) && (defined EXPERIMENTAL_DKIM)
  -
  -#warning Chaining Domainkeys via DKIM receive functions
  -#define RECEIVE_GETC dkim_receive_getc
  -#define RECEIVE_UNGETC dkim_receive_ungetc
  -
  -#else
  -
  -#if (defined EXPERIMENTAL_DOMAINKEYS) || (defined EXPERIMENTAL_DKIM)
  -
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -#warning Using Domainkeys receive functions
  -#define RECEIVE_GETC dk_receive_getc
  -#define RECEIVE_UNGETC dk_receive_ungetc
  -#endif
  -#ifdef EXPERIMENTAL_DKIM
  -#warning Using DKIM receive functions
  -#define RECEIVE_GETC dkim_receive_getc
  -#define RECEIVE_UNGETC dkim_receive_ungetc
  -#endif
  -
  -#else
  -
  -/* Normal operation */
  -#define RECEIVE_GETC receive_getc
  -#define RECEIVE_UNGETC receive_ungetc
  -
  -#endif
  -
  -#endif
  -
  -
   #ifdef EXPERIMENTAL_DCC
   extern int dcc_ok;
   #endif
  @@ -600,7 +568,7 @@
     {
     register int last_ch = '\n';


  -  for (; (ch = (RECEIVE_GETC)()) != EOF; last_ch = ch)
  +  for (; (ch = (receive_getc)()) != EOF; last_ch = ch)
       {
       if (ch == 0) body_zerocount++;
       if (last_ch == '\r' && ch != '\n')
  @@ -642,7 +610,7 @@


ch_state = 1;

  -while ((ch = (RECEIVE_GETC)()) != EOF)
  +while ((ch = (receive_getc)()) != EOF)
     {
     if (ch == 0) body_zerocount++;
     switch (ch_state)
  @@ -758,7 +726,7 @@
   register int ch;
   register int linelength = 0;


  -while ((ch = (RECEIVE_GETC)()) != EOF)
  +while ((ch = (receive_getc)()) != EOF)
     {
     if (ch == 0) body_zerocount++;
     switch (ch_state)
  @@ -1416,14 +1384,9 @@
   message_linecount = body_linecount = body_zerocount =
     max_received_linelength = 0;


-#ifdef EXPERIMENTAL_DOMAINKEYS
-/* Call into DK to set up the context. Check if DK is to be run are carried out
- inside dk_exim_verify_init(). */
-dk_exim_verify_init();
-#endif
-#ifdef EXPERIMENTAL_DKIM
+#ifndef DISABLE_DKIM
/* Call into DKIM to set up the context. Check if DKIM is to be run are carried out
- inside dk_exim_verify_init(). */
+ inside dkim_exim_verify_init(). */
dkim_exim_verify_init();
#endif

@@ -1476,7 +1439,7 @@

   for (;;)
     {
  -  int ch = (RECEIVE_GETC)();
  +  int ch = (receive_getc)();


     /* If we hit EOF on a SMTP connection, it's an error, since incoming
     SMTP must have a correct "." terminator. */
  @@ -1540,7 +1503,7 @@
     if (ch == '\n')
       {
       if (first_line_ended_crlf == TRUE_UNSET) first_line_ended_crlf = FALSE;
  -      else if (first_line_ended_crlf) RECEIVE_UNGETC(' ');
  +      else if (first_line_ended_crlf) receive_ungetc(' ');
       goto EOL;
       }


@@ -1555,13 +1518,13 @@

     if (ptr == 0 && ch == '.' && (smtp_input || dot_ends))
       {
  -    ch = (RECEIVE_GETC)();
  +    ch = (receive_getc)();
       if (ch == '\r')
         {
  -      ch = (RECEIVE_GETC)();
  +      ch = (receive_getc)();
         if (ch != '\n')
           {
  -        RECEIVE_UNGETC(ch);
  +        receive_ungetc(ch);
           ch = '\r';              /* Revert to CR */
           }
         }
  @@ -1589,7 +1552,7 @@


     if (ch == '\r')
       {
  -    ch = (RECEIVE_GETC)();
  +    ch = (receive_getc)();
       if (ch == '\n')
         {
         if (first_line_ended_crlf == TRUE_UNSET) first_line_ended_crlf = TRUE;
  @@ -1599,7 +1562,7 @@
       /* Otherwise, put back the character after CR, and turn the bare CR
       into LF SP. */


  -    ch = (RECEIVE_UNGETC)(ch);
  +    ch = (receive_ungetc)(ch);
       next->text[ptr++] = '\n';
       message_size++;
       ch = ' ';
  @@ -1684,14 +1647,14 @@


     if (ch != EOF)
       {
  -    int nextch = (RECEIVE_GETC)();
  +    int nextch = (receive_getc)();
       if (nextch == ' ' || nextch == '\t')
         {
         next->text[ptr++] = nextch;
         message_size++;
         continue;                      /* Iterate the loop */
         }
  -    else if (nextch != EOF) (RECEIVE_UNGETC)(nextch);   /* For next time */
  +    else if (nextch != EOF) (receive_ungetc)(nextch);   /* For next time */
       else ch = EOF;                   /* Cause main loop to exit at end */
       }


  @@ -3007,10 +2970,7 @@
     if (smtp_input && !smtp_batched_input)
       {


  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -    dk_exim_verify_finish();
  -#endif
  -#ifdef EXPERIMENTAL_DKIM
  +#ifndef DISABLE_DKIM
       dkim_exim_verify_finish();
   #endif


@@ -3554,8 +3514,8 @@

     if (select(fileno(smtp_in) + 1, &select_check, NULL, NULL, &tv) != 0)
       {
  -    int c = (RECEIVE_GETC)();
  -    if (c != EOF) (RECEIVE_UNGETC)(c); else
  +    int c = (receive_getc)();
  +    if (c != EOF) (receive_ungetc)(c); else
         {
         uschar *msg = US"SMTP connection lost after final dot";
         smtp_reply = US"";    /* No attempt to send a response */


  Index: smtp_in.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/smtp_in.c,v
  retrieving revision 1.63
  retrieving revision 1.63.2.1
  diff -u -r1.63 -r1.63.2.1
  --- smtp_in.c    29 Sep 2008 11:41:07 -0000    1.63
  +++ smtp_in.c    24 Feb 2009 15:57:55 -0000    1.63.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.63 2008/09/29 11:41:07 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.63.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1037,10 +1037,7 @@
   bmi_run = 0;
   bmi_verdicts = NULL;
   #endif
  -#ifdef EXPERIMENTAL_DOMAINKEYS
  -dk_do_verify = 0;
  -#endif
  -#ifdef EXPERIMENTAL_DKIM
  +#ifndef DISABLE_DKIM
   dkim_do_verify = 0;
   #endif
   #ifdef EXPERIMENTAL_SPF


  Index: spool_in.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/spool_in.c,v
  retrieving revision 1.23
  retrieving revision 1.23.2.1
  diff -u -r1.23 -r1.23.2.1
  --- spool_in.c    20 Jan 2009 16:09:20 -0000    1.23
  +++ spool_in.c    24 Feb 2009 15:57:55 -0000    1.23.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/spool_in.c,v 1.23 2009/01/20 16:09:20 fanf2 Exp $ */
  +/* $Cambridge: exim/exim-src/src/spool_in.c,v 1.23.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -278,11 +278,7 @@
   bmi_verdicts = NULL;
   #endif


-#ifdef EXPERIMENTAL_DOMAINKEYS
-dk_do_verify = 0;
-#endif
-
-#ifdef EXPERIMENTAL_DKIM
+#ifndef DISABLE_DKIM
dkim_do_verify = 0;
#endif


  Index: transport.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transport.c,v
  retrieving revision 1.23
  retrieving revision 1.23.2.1
  diff -u -r1.23 -r1.23.2.1
  --- transport.c    30 Sep 2008 10:03:55 -0000    1.23
  +++ transport.c    24 Feb 2009 15:57:55 -0000    1.23.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transport.c,v 1.23 2008/09/30 10:03:55 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/transport.c,v 1.23.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -941,7 +941,7 @@
   }



-#if (defined EXPERIMENTAL_DOMAINKEYS) || (defined EXPERIMENTAL_DKIM)
+#ifndef DISABLE_DKIM

   /***************************************************************************************************
   *    External interface to write the message, while signing it with DKIM and/or Domainkeys         *
  @@ -965,14 +965,6 @@
                                                                                      0/false => send anyway
                  uschar *dkim_sign_headers        DKIM: List of headers that should be included in signature
                                                   generation
  -               uschar *dk_private_key           Domainkeys: The private key to use (filename or plain data)
  -               uschar *dk_domain                Domainkeys: Override domain (normally NULL)
  -               uschar *dk_selector              Domainkeys: The selector to use.
  -               uschar *dk_canon                 Domainkeys: The canonalization scheme to use, "simple" or "nofws"
  -               uschar *dk_headers               Domainkeys: Colon-separated header list to include in the signing
  -                                                process.
  -               uschar *dk_strict                Domainkeys: What to do if signing fails: 1/true  => throw error
  -                                                                                         0/false => send anyway


   Returns:       TRUE on success; FALSE (with errno) for any failure
   */
  @@ -982,9 +974,7 @@
     int size_limit, uschar *add_headers, uschar *remove_headers,
     uschar *check_string, uschar *escape_string, rewrite_rule *rewrite_rules,
     int rewrite_existflags, uschar *dkim_private_key, uschar *dkim_domain,
  -  uschar *dkim_selector, uschar *dkim_canon, uschar *dkim_strict, uschar *dkim_sign_headers,
  -  uschar *dk_private_key, uschar *dk_domain, uschar *dk_selector, uschar *dk_canon,
  -  uschar *dk_headers, uschar *dk_strict
  +  uschar *dkim_selector, uschar *dkim_canon, uschar *dkim_strict, uschar *dkim_sign_headers
     )
   {
     int dkim_fd;
  @@ -995,12 +985,10 @@
     int sread = 0;
     int wwritten = 0;
     uschar *dkim_signature = NULL;
  -  uschar *dk_signature = NULL;
     off_t size = 0;


  -  if ( !( ((dkim_private_key != NULL) && (dkim_domain != NULL) && (dkim_selector != NULL)) ||
  -          ((dk_private_key != NULL) && (dk_selector != NULL)) ) ) {
  -    /* If we can sign with neither method, just call the original function. */
  +  if (!( ((dkim_private_key != NULL) && (dkim_domain != NULL) && (dkim_selector != NULL)) )) {
  +    /* If we can't sign, just call the original function. */
       return transport_write_message(addr, fd, options,
                 size_limit, add_headers, remove_headers,
                 check_string, escape_string, rewrite_rules,
  @@ -1031,8 +1019,6 @@
       goto CLEANUP;
       }


  -
  -  #ifdef EXPERIMENTAL_DKIM
     if ( (dkim_private_key != NULL) && (dkim_domain != NULL) && (dkim_selector != NULL) ) {
       /* Rewind file and feed it to the goats^W DKIM lib */
       lseek(dkim_fd, 0, SEEK_SET);
  @@ -1075,48 +1061,6 @@
     }
     #endif


  -  #ifdef EXPERIMENTAL_DOMAINKEYS
  -  if ( (dk_private_key != NULL) && (dk_selector != NULL) ) {
  -    /* Rewind file and feed it to the goats^W DK lib */
  -    lseek(dkim_fd, 0, SEEK_SET);
  -    dk_signature = dk_exim_sign(dkim_fd,
  -                                dk_private_key,
  -                                dk_domain,
  -                                dk_selector,
  -                                dk_canon);
  -    if (dk_signature == NULL) {
  -      if (dk_strict != NULL) {
  -        uschar *dk_strict_result = expand_string(dk_strict);
  -        if (dk_strict_result != NULL) {
  -          if ( (strcmpic(dk_strict,US"1") == 0) ||
  -               (strcmpic(dk_strict,US"true") == 0) ) {
  -            save_errno = errno;
  -            rc = FALSE;
  -            goto CLEANUP;
  -          }
  -        }
  -      }
  -    }
  -    else {
  -      int siglen = Ustrlen(dk_signature);
  -      while(siglen > 0) {
  -        #ifdef SUPPORT_TLS
  -        if (tls_active == fd) wwritten = tls_write(dk_signature, siglen); else
  -        #endif
  -        wwritten = write(fd,dk_signature,siglen);
  -        if (wwritten == -1) {
  -          /* error, bail out */
  -          save_errno = errno;
  -          rc = FALSE;
  -          goto CLEANUP;
  -        }
  -        siglen -= wwritten;
  -        dk_signature += wwritten;
  -      }
  -    }
  -  }
  -  #endif
  -
     /* Fetch file positition (the size) */
     size = lseek(dkim_fd,0,SEEK_CUR);



  Index: dkim.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/lookups/dkim.c,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- dkim.c    28 Sep 2007 12:21:57 -0000    1.1
  +++ dkim.c    24 Feb 2009 15:57:55 -0000    1.1.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/lookups/dkim.c,v 1.1 2007/09/28 12:21:57 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/lookups/dkim.c,v 1.1.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -39,7 +39,7 @@
   dkim_find(void *handle, uschar *filename, uschar *keystring, int length,
     uschar **result, uschar **errmsg, BOOL *do_cache)
   {
  -#ifdef EXPERIMENTAL_DKIM
  +#ifndef DISABLE_DKIM
     dkim_exim_verify_result(keystring,result,errmsg);
     return OK;
   #else


  Index: pdkim.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/pdkim/Attic/pdkim.c,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- pdkim.c    24 Feb 2009 13:13:47 -0000    1.1.2.1
  +++ pdkim.c    24 Feb 2009 15:57:55 -0000    1.1.2.2
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/pdkim/pdkim.c,v 1.1.2.1 2009/02/24 13:13:47 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/pdkim/pdkim.c,v 1.1.2.2 2009/02/24 15:57:55 tom Exp $ */
   /* pdkim.c */


#include <stdlib.h>
@@ -549,7 +549,7 @@


/* -------------------------------------------------------------------------- */
-int pdkim_feed_finish(pdkim_ctx *ctx) {
+int pdkim_feed_finish(pdkim_ctx *ctx, char **signature) {

     /* Check if we must still flush a (partial) header. If that is the
        case, the message has no body, and we must compute a body hash
  @@ -730,14 +730,19 @@
       if (ctx->debug_stream) {
         fprintf(ctx->debug_stream,
                 "PDKIM >> Final DKIM-Signature header >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
  -      fprintf(ctx->debug_stream,"%s\n",hdr->str);
  -      //pdkim_quoteprint(ctx->debug_stream, hdr->str, hdr->len, 1);
  +      pdkim_quoteprint(ctx->debug_stream, hdr->str, hdr->len, 1);
         fprintf(ctx->debug_stream,
                 "PDKIM <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
       }
   #endif
  +
  +    if (signature != NULL) {
  +      *signature = hdr->str;
  +    }
  +
     }


  +
     return PDKIM_OK;
   }


@@ -793,6 +798,7 @@

   /* -------------------------------------------------------------------------- */
   int pdkim_set_optional(pdkim_ctx *ctx,
  +                       int input_mode,
                          char *sign_headers,
                          char *identity,
                          int canon_headers,
  @@ -818,6 +824,7 @@
       strcpy(ctx->sig->sign_headers, sign_headers);
     }


  +  ctx->input_mode = input_mode;
     ctx->sig->canon_headers = canon_headers;
     ctx->sig->canon_body = canon_body;
     ctx->sig->bodylength = bodylength;


  Index: pdkim.h
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/pdkim/Attic/pdkim.h,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- pdkim.h    24 Feb 2009 13:13:47 -0000    1.1.2.1
  +++ pdkim.h    24 Feb 2009 15:57:55 -0000    1.1.2.2
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/pdkim/pdkim.h,v 1.1.2.1 2009/02/24 13:13:47 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/pdkim/pdkim.h,v 1.1.2.2 2009/02/24 15:57:55 tom Exp $ */
   /* pdkim.h */


#include "sha1.h"
@@ -181,8 +181,8 @@
int pdkim_bodyline_complete (pdkim_ctx *);
int pdkim_header_complete (pdkim_ctx *);

  -int   pdkim_feed              (pdkim_ctx *, char *data, int len);
  -int   pdkim_feed_finish       (pdkim_ctx *);
  +int   pdkim_feed              (pdkim_ctx *, char *, int);
  +int   pdkim_feed_finish       (pdkim_ctx *, char **);


   pdkim_str
        *pdkim_create_header     (pdkim_ctx *, int);
  @@ -190,7 +190,9 @@
   pdkim_ctx
        *pdkim_init_sign         (char *, char *, char *);


  -int   pdkim_set_optional      (pdkim_ctx *, char *, char *,
  +int   pdkim_set_optional      (pdkim_ctx *,
  +                               int,
  +                               char *, char *,
                                  int, int,
                                  unsigned long, int,
                                  unsigned long,


  Index: smtp.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transports/smtp.c,v
  retrieving revision 1.41
  retrieving revision 1.41.2.1
  diff -u -r1.41 -r1.41.2.1
  --- smtp.c    2 Jan 2009 17:22:12 -0000    1.41
  +++ smtp.c    24 Feb 2009 15:57:55 -0000    1.41.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transports/smtp.c,v 1.41 2009/01/02 17:22:12 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/transports/smtp.c,v 1.41.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -39,19 +39,7 @@
         (void *)offsetof(smtp_transport_options_block, data_timeout) },
     { "delay_after_cutoff", opt_bool,
         (void *)offsetof(smtp_transport_options_block, delay_after_cutoff) },
  -  #if (defined EXPERIMENTAL_DOMAINKEYS) || (defined EXPERIMENTAL_DKIM)
  -  { "dk_canon", opt_stringptr,
  -      (void *)offsetof(smtp_transport_options_block, dk_canon) },
  -  { "dk_domain", opt_stringptr,
  -      (void *)offsetof(smtp_transport_options_block, dk_domain) },
  -  { "dk_headers", opt_stringptr,
  -      (void *)offsetof(smtp_transport_options_block, dk_headers) },
  -  { "dk_private_key", opt_stringptr,
  -      (void *)offsetof(smtp_transport_options_block, dk_private_key) },
  -  { "dk_selector", opt_stringptr,
  -      (void *)offsetof(smtp_transport_options_block, dk_selector) },
  -  { "dk_strict", opt_stringptr,
  -      (void *)offsetof(smtp_transport_options_block, dk_strict) },
  +#ifndef DISABLE_DKIM
     { "dkim_canon", opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, dkim_canon) },
     { "dkim_domain", opt_stringptr,
  @@ -64,7 +52,7 @@
         (void *)offsetof(smtp_transport_options_block, dkim_sign_headers) },
     { "dkim_strict", opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, dkim_strict) },
  -  #endif
  +#endif
     { "dns_qualify_single",   opt_bool,
         (void *)offsetof(smtp_transport_options_block, dns_qualify_single) },
     { "dns_search_parents",   opt_bool,
  @@ -75,14 +63,14 @@
         (void *)offsetof(smtp_transport_options_block, final_timeout) },
     { "gethostbyname",        opt_bool,
         (void *)offsetof(smtp_transport_options_block, gethostbyname) },
  -  #ifdef SUPPORT_TLS
  +#ifdef SUPPORT_TLS
     { "gnutls_require_kx",    opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, gnutls_require_kx) },
     { "gnutls_require_mac",   opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, gnutls_require_mac) },
     { "gnutls_require_protocols", opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, gnutls_require_proto) },
  -  #endif
  +#endif
     { "helo_data",            opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, helo_data) },
     { "hosts",                opt_stringptr,
  @@ -91,28 +79,28 @@
         (void *)offsetof(smtp_transport_options_block, hosts_avoid_esmtp) },
     { "hosts_avoid_pipelining", opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, hosts_avoid_pipelining) },
  -  #ifdef SUPPORT_TLS
  +#ifdef SUPPORT_TLS
     { "hosts_avoid_tls",      opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, hosts_avoid_tls) },
  -  #endif
  +#endif
     { "hosts_max_try",        opt_int,
         (void *)offsetof(smtp_transport_options_block, hosts_max_try) },
     { "hosts_max_try_hardlimit", opt_int,
         (void *)offsetof(smtp_transport_options_block, hosts_max_try_hardlimit) },
  -  #ifdef SUPPORT_TLS
  +#ifdef SUPPORT_TLS
     { "hosts_nopass_tls",     opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, hosts_nopass_tls) },
  -  #endif
  +#endif
     { "hosts_override",       opt_bool,
         (void *)offsetof(smtp_transport_options_block, hosts_override) },
     { "hosts_randomize",      opt_bool,
         (void *)offsetof(smtp_transport_options_block, hosts_randomize) },
     { "hosts_require_auth",   opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, hosts_require_auth) },
  -  #ifdef SUPPORT_TLS
  +#ifdef SUPPORT_TLS
     { "hosts_require_tls",    opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, hosts_require_tls) },
  -  #endif
  +#endif
     { "hosts_try_auth",       opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, hosts_try_auth) },
     { "interface",            opt_stringptr,
  @@ -135,7 +123,7 @@
         (void *)offsetof(smtp_transport_options_block, serialize_hosts) },
     { "size_addition",        opt_int,
         (void *)offsetof(smtp_transport_options_block, size_addition) }
  -  #ifdef SUPPORT_TLS
  +#ifdef SUPPORT_TLS
    ,{ "tls_certificate",      opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, tls_certificate) },
     { "tls_crl",              opt_stringptr,
  @@ -148,7 +136,7 @@
         (void *)offsetof(smtp_transport_options_block, tls_tempfail_tryclear) },
     { "tls_verify_certificates", opt_stringptr,
         (void *)offsetof(smtp_transport_options_block, tls_verify_certificates) }
  -  #endif
  +#endif
   };


   /* Size of the options list. An extern variable has to be used so that its
  @@ -196,7 +184,7 @@
     TRUE,                /* keepalive */
     FALSE,               /* lmtp_ignore_quota */
     TRUE                 /* retry_include_ip_address */
  -  #ifdef SUPPORT_TLS
  +#ifdef SUPPORT_TLS
    ,NULL,                /* tls_certificate */
     NULL,                /* tls_crl */
     NULL,                /* tls_privatekey */
  @@ -206,21 +194,15 @@
     NULL,                /* gnutls_require_proto */
     NULL,                /* tls_verify_certificates */
     TRUE                 /* tls_tempfail_tryclear */
  -  #endif
  -  #if (defined EXPERIMENTAL_DOMAINKEYS) || (defined EXPERIMENTAL_DKIM)
  - ,NULL,                /* dk_canon */
  -  NULL,                /* dk_domain */
  -  NULL,                /* dk_headers */
  -  NULL,                /* dk_private_key */
  -  NULL,                /* dk_selector */
  -  NULL                 /* dk_strict */
  +#endif
  +#ifndef DISABLE_DKIM
    ,NULL,                /* dkim_canon */
     NULL,                /* dkim_domain */
     NULL,                /* dkim_private_key */
     NULL,                /* dkim_selector */
     NULL,                /* dkim_sign_headers */
     NULL                 /* dkim_strict */
  -  #endif
  +#endif
   };



  @@ -1592,7 +1574,7 @@
     DEBUG(D_transport|D_v)
       debug_printf("  SMTP>> writing message and terminating \".\"\n");
     transport_count = 0;
  -#if (defined EXPERIMENTAL_DOMAINKEYS) || (defined EXPERIMENTAL_DKIM)
  +#ifndef DISABLE_DKIM
     ok = dkim_transport_write_message(addrlist, inblock.sock,
       topt_use_crlf | topt_end_dot | topt_escape_headers |
         (tblock->body_only? topt_no_headers : 0) |
  @@ -1605,9 +1587,7 @@
       US".", US"..",    /* Escaping strings */
       tblock->rewrite_rules, tblock->rewrite_existflags,
       ob->dkim_private_key, ob->dkim_domain, ob->dkim_selector,
  -    ob->dkim_canon, ob->dkim_strict, ob->dkim_sign_headers,
  -    ob->dk_private_key, ob->dk_domain, ob->dk_selector,
  -    ob->dk_canon, ob->dk_headers, ob->dk_strict
  +    ob->dkim_canon, ob->dkim_strict, ob->dkim_sign_headers
       );
   #else
     ok = transport_write_message(addrlist, inblock.sock,


  Index: smtp.h
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transports/smtp.h,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- smtp.h    5 Mar 2008 21:13:23 -0000    1.14
  +++ smtp.h    24 Feb 2009 15:57:55 -0000    1.14.2.1
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transports/smtp.h,v 1.14 2008/03/05 21:13:23 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/transports/smtp.h,v 1.14.2.1 2009/02/24 15:57:55 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -57,13 +57,7 @@
     uschar *tls_verify_certificates;
     BOOL    tls_tempfail_tryclear;
     #endif
  -  #if (defined EXPERIMENTAL_DOMAINKEYS) || (defined EXPERIMENTAL_DKIM)
  -  uschar *dk_domain;
  -  uschar *dk_private_key;
  -  uschar *dk_selector;
  -  uschar *dk_canon;
  -  uschar *dk_headers;
  -  uschar *dk_strict;
  +  #ifndef DISABLE_DKIM
     uschar *dkim_domain;
     uschar *dkim_private_key;
     uschar *dkim_selector;