]> git.pld-linux.org Git - packages/postfix.git/commitdiff
- updated to 2.9.0 (by shadzik)
authorAdam Gołębiowski <adamg@pld-linux.org>
Sun, 5 Feb 2012 23:10:28 +0000 (23:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    postfix-config.patch -> 1.19
    postfix-dictname.patch -> 1.2
    postfix-dynamicmaps.patch -> 1.18
    postfix-ident.patch -> 1.9

postfix-config.patch
postfix-dictname.patch
postfix-dynamicmaps.patch
postfix-ident.patch

index bd3fc018642c40e59b71febf2a9b9dd1a55971fc..0f734ab8c09969bebc6129cc8bd74c63c1be98bd 100644 (file)
@@ -1,16 +1,36 @@
-diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
---- postfix-2.1.3.orig/conf/main.cf    2004-06-06 23:53:58.000000000 +0200
-+++ postfix-2.1.3/conf/main.cf 2004-06-22 14:23:20.533313840 +0200
-@@ -38,7 +38,7 @@
+diff -dur postfix-2.1.3.orig/src/global/mail_params.h postfix-2.1.3/src/global/mail_params.h
+--- postfix-2.1.3.orig/src/global/mail_params.h        2004-06-22 14:20:57.890585644 +0200
++++ postfix-2.1.3/src/global/mail_params.h     2004-06-22 14:21:17.963422126 +0200
+@@ -64,7 +64,7 @@
+ extern gid_t var_owner_gid;
+ #define VAR_SGID_GROUP                "setgid_group"
+-#define DEF_SGID_GROUP                "postdrop"
++#define DEF_SGID_GROUP                "maildrop"
+ extern char *var_sgid_group;
+ extern gid_t var_sgid_gid;
+#@@ -231,7 +231,7 @@
+#   */
+# #define VAR_CONFIG_DIR               "config_directory"
+# #ifndef DEF_CONFIG_DIR
+#-#define DEF_CONFIG_DIR               "/etc/postfix"
+#+#define DEF_CONFIG_DIR               "/etc/mail"
+# #endif
+# extern char *var_config_dir;
+# 
+--- postfix-2.9.0/conf/main.cf.orig    2012-02-04 19:05:20.960656539 +0100
++++ postfix-2.9.0/conf/main.cf 2012-02-04 19:12:31.810624906 +0100
+@@ -39,7 +39,7 @@
  # daemon programs (i.e. programs listed in the master.cf file). This
  # directory must be owned by root.
  #
 -daemon_directory = /usr/libexec/postfix
 +daemon_directory = /usr/lib/postfix
  
- # QUEUE AND PROCESS OWNERSHIP
- #
-@@ -56,7 +56,7 @@
+ # The data_directory parameter specifies the location of Postfix-writable
+ # data files (caches, random numbers). This directory must be owned
+@@ -63,7 +63,7 @@
  # These rights are used in the absence of a recipient user context.
  # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
  #
@@ -19,7 +39,7 @@ diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
  
  # INTERNET HOST AND DOMAIN NAMES
  # 
-@@ -88,7 +88,7 @@
+@@ -95,7 +95,7 @@
  # myorigin also specifies the default domain name that is appended
  # to recipient addresses that have no @domain part.
  #
@@ -28,7 +48,7 @@ diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
  #myorigin = $mydomain
  
  # RECEIVING MAIL
-@@ -372,7 +372,7 @@
+@@ -379,7 +379,7 @@
  # "postfix reload" to eliminate the delay.
  #
  #alias_maps = dbm:/etc/aliases
@@ -37,7 +57,7 @@ diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
  #alias_maps = hash:/etc/aliases, nis:mail.aliases
  #alias_maps = netinfo:/aliases
  
-@@ -383,7 +383,7 @@
+@@ -390,7 +390,7 @@
  #
  #alias_database = dbm:/etc/aliases
  #alias_database = dbm:/etc/mail/aliases
@@ -46,7 +66,7 @@ diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
  #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
  
  # ADDRESS EXTENSIONS (e.g., user+foo)
-@@ -411,7 +411,7 @@
+@@ -418,7 +418,7 @@
  # UNIX-style mailboxes are kept. The default setting depends on the
  # system type.
  #
@@ -55,7 +75,7 @@ diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
  #mail_spool_directory = /var/spool/mail
  
  # The mailbox_command parameter specifies the optional external
-@@ -433,8 +433,8 @@
+@@ -440,8 +440,8 @@
  # IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
  # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
  #
@@ -66,11 +86,12 @@ diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
  
  # The mailbox_transport specifies the optional transport in master.cf
  # to use after processing aliases and .forward files. This parameter
-@@ -588,44 +588,22 @@
- #     echo where) | gdb $daemon_directory/$process_name $process_id 2>&1
- #     >$config_directory/$process_name.$process_id.log & sleep 5
+@@ -613,45 +613,24 @@
+ #     -dmS $process_name gdb $daemon_directory/$process_name
+ #     $process_id & sleep 1
  
 +biff = no
++
  # INSTALL-TIME CONFIGURATION INFORMATION
  #
  # The following parameters are used when installing a new Postfix version.
@@ -95,7 +116,8 @@ diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
  # is not shared with other accounts, not even with the Postfix account.
  #
 -setgid_group =
--
++setgid_group = maildrop
 -# html_directory: The location of the Postfix HTML documentation.
 -#
 -html_directory =
@@ -103,54 +125,30 @@ diff -dur postfix-2.1.3.orig/conf/main.cf postfix-2.1.3/conf/main.cf
 -# manpage_directory: The location of the Postfix on-line manual pages.
 -#
 -manpage_directory =
--
++inet_protocols = ipv4
 -# sample_directory: The location of the Postfix sample configuration files.
 -# This parameter is obsolete as of Postfix 2.1.
--#
--sample_directory =
-+setgid_group = maildrop
--# readme_directory: The location of the Postfix README files.
--#
--readme_directory =
 +# The unknown_address_reject_code parameter specifies the SMTP server
 +# response when a client violates the reject_unknown_sender_domain
 +# or reject_unknown_recipient_domain restrictions.
-+#
+ #
+-sample_directory =
+-
+-# readme_directory: The location of the Postfix README files.
 +# Contrary to what Wietse thinks (450) this should be 550
-+#
+ #
+-readme_directory =
+-inet_protocols = ipv4
 +unknown_address_reject_code = 550
-+
-diff -dur postfix-2.1.3.orig/src/global/mail_params.h postfix-2.1.3/src/global/mail_params.h
---- postfix-2.1.3.orig/src/global/mail_params.h        2004-06-22 14:20:57.890585644 +0200
-+++ postfix-2.1.3/src/global/mail_params.h     2004-06-22 14:21:17.963422126 +0200
-@@ -64,7 +64,7 @@
- extern gid_t var_owner_gid;
- #define VAR_SGID_GROUP                "setgid_group"
--#define DEF_SGID_GROUP                "postdrop"
-+#define DEF_SGID_GROUP                "maildrop"
- extern char *var_sgid_group;
- extern gid_t var_sgid_gid;
-#@@ -231,7 +231,7 @@
-#   */
-# #define VAR_CONFIG_DIR               "config_directory"
-# #ifndef DEF_CONFIG_DIR
-#-#define DEF_CONFIG_DIR               "/etc/postfix"
-#+#define DEF_CONFIG_DIR               "/etc/mail"
-# #endif
-# extern char *var_config_dir;
-# 
-diff -dur postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_defs.h
---- postfix-2.1.3.orig/src/util/sys_defs.h     2004-06-22 14:20:58.094573821 +0200
-+++ postfix-2.1.3/src/util/sys_defs.h  2004-06-22 14:21:17.966421952 +0200
-@@ -550,7 +550,7 @@
- #define HAS_FSYNC
- #define HAS_DB
- #define DEF_DB_TYPE   "hash"
+--- postfix-2.9.0/src/util/sys_defs.h.orig     2012-02-04 19:05:23.000000000 +0100
++++ postfix-2.9.0/src/util/sys_defs.h  2012-02-04 19:15:31.153933031 +0100
+@@ -54,7 +54,7 @@
+ #define ALIAS_DB_MAP   "hash:/etc/mail/aliases"       /* OpenBSD 2.7 */
+ #endif
+ #ifndef ALIAS_DB_MAP
 -#define ALIAS_DB_MAP  "hash:/etc/aliases"
 +#define ALIAS_DB_MAP  "hash:/etc/mail/aliases"
- #define HAS_NIS
+ #endif
  #define GETTIMEOFDAY(t)       gettimeofday(t,(struct timezone *) 0)
  #define ROOT_PATH     "/bin:/usr/bin:/sbin:/usr/sbin"
index f0f89d8b8d2efddee01662c495d20b1a0cde9ff7..0b9f937bb96122899f8b9fed4404807d54eef007 100644 (file)
@@ -1,11 +1,11 @@
---- postfix-2.3.0/src/util/dict_open.c~        2006-07-25 13:36:17.245609587 +0300
-+++ postfix-2.3.0/src/util/dict_open.c 2006-07-25 13:38:52.429059090 +0300
-@@ -327,7 +327,7 @@
-       lib=vstring_alloc(1);
-       vstring_sprintf(lib,dl->soname,dict_type);
-       if (stat(vstring_str(lib),&st) < 0) {
--          msg_fatal("%s: unsupported dictionary type: %s (%s not found.  Is the postfix-%s package installed?)",
-+          msg_fatal("%s: unsupported dictionary type: %s (%s not found.  Is the postfix-dict-%s package installed?)",
-               myname, dict_type, vstring_str(lib), dict_type);
-       }
-       func=vstring_alloc(1);
+--- postfix-2.9.0/src/util/dict_open.c.orig    2012-02-04 19:42:26.000000000 +0100
++++ postfix-2.9.0/src/util/dict_open.c 2012-02-04 19:43:42.937093038 +0100
+@@ -365,7 +365,7 @@
+        lib=vstring_alloc(1);
+        vstring_sprintf(lib,dl->soname,dict_type);
+        if (stat(vstring_str(lib),&st) < 0) {
+-           msg_fatal("%s: unsupported dictionary type: %s (%s not found.  Is the postfix-%s package installed?)",
++           msg_fatal("%s: unsupported dictionary type: %s (%s not found.  Is the postfix-dict-%s package installed?)",
+                myname, dict_type, vstring_str(lib), dict_type);
+        }
+        func=vstring_alloc(1);
index 7e5b6aa0867e5b661c5b3ef094196db5aed7cbff..b54dc163dc193b7be4303e1f2330169279a8101d 100644 (file)
@@ -91,164 +91,6 @@ diff -durN postfix-2.1.3.orig/src/util/dict.h postfix-2.1.3/src/util/dict.h
   /*
    * High-level interface, with logical dictionary names.
    */
-diff -durN postfix-2.1.3.orig/src/util/dict_open.c postfix-2.1.3/src/util/dict_open.c
---- postfix-2.1.3.orig/src/util/dict_open.c    2004-06-22 15:38:57.069468247 +0200
-+++ postfix-2.1.3/src/util/dict_open.c 2004-06-22 15:39:24.254859679 +0200
-@@ -158,6 +158,9 @@
- #include <strings.h>
- #endif
-+#include <sys/stat.h>
-+#include <unistd.h>
-+
- /* Utility library. */
- #include <argv.h>
-@@ -181,6 +184,14 @@
- #include <split_at.h>
- #include <htable.h>
-+#ifndef NO_DYNAMIC_MAPS
-+#include <load_lib.h>
-+#include <vstring.h>
-+#include <vstream.h>
-+#include <vstring_vstream.h>
-+#include <mvect.h>
-+#endif
-+
-  /*
-   * lookup table for available map types.
-   */
-@@ -212,9 +223,11 @@
- #ifdef HAS_NETINFO
-     DICT_TYPE_NETINFO, dict_ni_open,
- #endif
-+#ifndef MAX_DYNAMIC_MAPS
- #ifdef HAS_PCRE
-     DICT_TYPE_PCRE, dict_pcre_open,
- #endif
-+#endif /* MAX_DYNAMIC_MAPS */
- #ifdef HAS_POSIX_REGEXP
-     DICT_TYPE_REGEXP, dict_regexp_open,
- #endif
-@@ -269,8 +282,38 @@
-     if (dict_open_hash == 0)
-       dict_open_init();
--    if ((dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type)) == 0)
--      msg_fatal("unsupported dictionary type: %s", dict_type);
-+    if ((dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type)) == 0) {
-+#ifndef NO_DYNAMIC_MAPS
-+      struct stat st;
-+      VSTRING *lib, *func;
-+      LIB_FN fn[2];
-+      DICT *(*open) (const char *, int, int);
-+      DLINFO *dl=dict_open_dlfind(dict_type);
-+      if (!dl)
-+#endif
-+          msg_fatal("%s: unsupported dictionary type: %s", myname, dict_type);
-+#ifndef NO_DYNAMIC_MAPS
-+      lib=vstring_alloc(1);
-+      vstring_sprintf(lib,dl->soname,dict_type);
-+      if (stat(vstring_str(lib),&st) < 0) {
-+          msg_fatal("%s: unsupported dictionary type: %s (%s not found.  Is the postfix-%s package installed?)",
-+              myname, dict_type, vstring_str(lib), dict_type);
-+      }
-+      func=vstring_alloc(1);
-+      vstring_sprintf(func,dl->openfunc,dict_type);
-+      fn[0].name = vstring_str(func);
-+      fn[0].ptr  = (void**)&open;
-+      fn[1].name = NULL;
-+      load_library_symbols(vstring_str(lib), fn, NULL);
-+      dict_open_register(dict_type, open);
-+      dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type);
-+      vstring_free(lib);
-+      vstring_free(func);
-+#endif
-+    }
-+    if (msg_verbose>1) {
-+      msg_info("%s: calling %s open routine",myname,dict_type);
-+    }
-     if ((dict = dp->open(dict_name, open_flags, dict_flags)) == 0)
-       msg_fatal("opening %s:%s %m", dict_type, dict_name);
-     if (msg_verbose)
-@@ -317,6 +360,76 @@
-     return mapnames;
- }
-+#ifndef NO_DYNAMIC_MAPS
-+static DLINFO  *dict_dlinfo;
-+
-+void dict_open_dlinfo(const char *path)
-+{
-+    char    *myname="dict_open_dlinfo";
-+    VSTREAM *conf_fp=vstream_fopen(path,O_RDONLY,0);
-+    VSTRING *buf = vstring_alloc(100);
-+    char    *cp;
-+    ARGV    *argv;
-+    MVECT    vector;
-+    int      nelm=0;
-+    int      linenum=0;
-+
-+    dict_dlinfo=(DLINFO*)mvect_alloc(&vector,sizeof(DLINFO),3,NULL,NULL);
-+
-+    if (!conf_fp) {
-+      msg_warn("%s: cannot open %s.  No dynamic maps will be allowed.",
-+              myname, path);
-+    } else {
-+      while (vstring_get_nonl(buf,conf_fp) != VSTREAM_EOF) {
-+          cp = vstring_str(buf);
-+          linenum++;
-+          if (*cp == '#' || *cp == '\0')
-+              continue;
-+          argv = argv_split(cp, " \t");
-+          if (argv->argc != 3) {
-+              msg_fatal("%s: Expected \"pattern .so-name function\" at line %d",
-+                        myname, linenum);
-+          }
-+          if (argv->argv[1][0] != '/') {
-+              msg_fatal("%s: .so name must begin with a \"/\" at line %d",
-+                        myname, linenum);
-+          }
-+          if (nelm >= vector.nelm) {
-+              dict_dlinfo=(DLINFO*)mvect_realloc(&vector,vector.nelm+3);
-+          }
-+          dict_dlinfo[nelm].pattern  = mystrdup(argv->argv[0]);
-+          dict_dlinfo[nelm].soname   = mystrdup(argv->argv[1]);
-+          dict_dlinfo[nelm].openfunc = mystrdup(argv->argv[2]);
-+          nelm++;
-+          argv_free(argv);
-+      }
-+    }
-+    if (nelm >= vector.nelm) {
-+      dict_dlinfo=(DLINFO*)mvect_realloc(&vector,vector.nelm+1);
-+    }
-+    dict_dlinfo[nelm].pattern  = NULL;
-+    dict_dlinfo[nelm].soname   = NULL;
-+    dict_dlinfo[nelm].openfunc = NULL;
-+    if (conf_fp)
-+      vstream_fclose(conf_fp);
-+    vstring_free(buf);
-+}
-+
-+DLINFO *dict_open_dlfind(const char *type)
-+{
-+    DLINFO *dp;
-+
-+    if (!dict_dlinfo)
-+      return NULL;
-+
-+    for (dp=dict_dlinfo; dp->pattern; dp++) {
-+      if (strcmp(dp->pattern,type)==0 || strcmp(dp->pattern,"*")==0)
-+          return dp;
-+    }
-+    return NULL;
-+}
-+#endif /* !NO_DYNAMIC_MAPS */
-+
- #ifdef TEST
-  /*
 diff -durN postfix-2.1.3.orig/src/util/load_lib.c postfix-2.1.3/src/util/load_lib.c
 --- postfix-2.1.3.orig/src/util/load_lib.c     1970-01-01 01:00:00.000000000 +0100
 +++ postfix-2.1.3/src/util/load_lib.c  2004-06-22 15:39:24.257859501 +0200
@@ -538,8 +380,241 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
  #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
  #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
  #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
---- postfix-2.8.3/src/util/Makefile.in~        2011-05-17 13:59:05.580000068 +0200
-+++ postfix-2.8.3/src/util/Makefile.in 2011-05-17 14:10:13.870000068 +0200
+--- postfix-2.8.3/src/global/Makefile.in~      2011-05-17 14:11:58.243333401 +0200
++++ postfix-2.8.3/src/global/Makefile.in       2011-05-17 14:27:36.783333538 +0200
+@@ -35,7 +35,7 @@
+       canon_addr.o cfg_parser.o cleanup_strerror.o cleanup_strflags.o \
+       clnt_stream.o conv_time.o db_common.o debug_peer.o debug_process.o \
+       defer.o deliver_completed.o deliver_flock.o deliver_pass.o \
+-      deliver_request.o dict_ldap.o dict_mysql.o dict_pgsql.o \
++      deliver_request.o \
+       dict_proxy.o dict_sqlite.o domain_list.o dot_lockfile.o dot_lockfile_as.o \
+       dsb_scan.o dsn.o dsn_buf.o dsn_mask.o dsn_print.o dsn_util.o \
+       ehlo_mask.o ext_prop.o file_id.o flush_clnt.o header_opts.o \
+@@ -106,8 +106,12 @@
+ LIB_DIR       = ../../lib
+ INC_DIR       = ../../include
+ MAKES =
++LDAPSO  = dict_ldap.so
++MYSQLSO = dict_mysql.so
++PGSQLSO       = dict_pgsql.so
++SQLITESO= dict_sqlite.so
+-.c.o:;        $(CC) $(CFLAGS) -c $*.c
++.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
+ all: $(LIB)
+@@ -119,14 +123,36 @@
+ test: $(TESTPROG)
+ $(LIB):       $(OBJS)
+-      $(AR) $(ARFL) $(LIB) $?
+-      $(RANLIB) $(LIB)
++      gcc -shared -Wl,-soname,libpostfix-global.so.1 -o $(LIB) $(OBJS)
++
++$(LDAPSO): dict_ldap.o $(LIB)
++      gcc -shared -Wl,-soname,dict_ldap.so -o $@ $? -lldap -llber -L../../lib -lutil -L. -lglobal
++
++$(MYSQLSO): dict_mysql.o $(LIB)
++      gcc -shared -Wl,-soname,dict_mysql.so -o $@ $? -lmysqlclient -L../../lib -lutil -L. -lglobal
++
++$(PGSQLSO): dict_pgsql.o $(LIB)
++      gcc -shared -Wl,-soname,dict_pgsql.so -o $@ $? -lpq -L../../lib -lutil -L. -lglobal
++
++$(SQLITESO): dict_sqlite.o $(LIB)
++      gcc -shared -Wl,-soname,dict_sqlite.so -o $@ $? -lsqlite3 -L../../lib -lutil -L. -lglobal
+ $(LIB_DIR)/$(LIB): $(LIB)
+       cp $(LIB) $(LIB_DIR)
+-      $(RANLIB) $(LIB_DIR)/$(LIB)
+-update: $(LIB_DIR)/$(LIB) $(HDRS)
++$(LIB_DIR)/$(LDAPSO): $(LDAPSO)
++      cp $(LDAPSO) $(LIB_DIR)
++
++$(LIB_DIR)/$(MYSQLSO): $(MYSQLSO)
++      cp $(MYSQLSO) $(LIB_DIR)
++
++$(LIB_DIR)/$(PGSQLSO): $(PGSQLSO)
++      cp $(PGSQLSO) $(LIB_DIR)
++
++$(LIB_DIR)/$(SQLITESO): $(SQLITESO)
++      cp $(SQLITESO) $(LIB_DIR)
++
++update: $(LIB_DIR)/$(LIB) $(LIB_DIR)/${LDAPSO} $(LIB_DIR)/${MYSQLSO} $(LIB_DIR)/${PGSQLSO} $(LIB_DIR)/${SQLITESO} $(HDRS)
+       -for i in $(HDRS); \
+       do \
+         cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \
+@@ -497,7 +523,7 @@
+       lint $(DEFS) $(SRCS) $(LINTFIX)
+ clean:
+-      rm -f *.o $(LIB) *core $(TESTPROG) junk
++      rm -f *.o $(LIB) $(LDAPSO) $(MYSQLSO) $(PGSQLSO) $(SQLITESO) *core $(TESTPROG) junk
+       rm -rf printfck
+ tidy: clean
+--- postfix-2.9.0/src/util/dict_open.c.orig    2012-02-04 19:16:54.231837262 +0100
++++ postfix-2.9.0/src/util/dict_open.c 2012-02-04 19:27:54.884124599 +0100
+@@ -213,6 +213,9 @@
+ #include <strings.h>
+ #endif
++#include <sys/stat.h>
++#include <unistd.h>
++
+ /* Utility library. */
+ #include <argv.h>
+@@ -241,6 +244,14 @@
+ #include <htable.h>
+ #include <myflock.h>
++#ifndef NO_DYNAMIC_MAPS
++#include <load_lib.h>
++#include <vstring.h>
++#include <vstream.h>
++#include <vstring_vstream.h>
++#include <mvect.h>
++#endif
++
+  /*
+   * lookup table for available map types.
+   */
+@@ -276,9 +287,11 @@
+ #ifdef HAS_NETINFO
+     DICT_TYPE_NETINFO, dict_ni_open,
+ #endif
++#ifndef MAX_DYNAMIC_MAPS
+ #ifdef HAS_PCRE
+     DICT_TYPE_PCRE, dict_pcre_open,
+ #endif
++#endif /* MAX_DYNAMIC_MAPS */
+ #ifdef HAS_POSIX_REGEXP
+     DICT_TYPE_REGEXP, dict_regexp_open,
+ #endif
+@@ -338,9 +351,38 @@
+                 dict_type, dict_name);
+     if (dict_open_hash == 0)
+       dict_open_init();
+-    if ((dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type)) == 0)
+-      return (dict_surrogate(dict_type, dict_name, open_flags, dict_flags,
+-                           "unsupported dictionary type: %s", dict_type));
++    if ((dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type)) == 0) {
++#ifndef NO_DYNAMIC_MAPS
++       struct stat st;
++       VSTRING *lib, *func;
++       LIB_FN fn[2];
++       DICT *(*open) (const char *, int, int);
++       DLINFO *dl=dict_open_dlfind(dict_type);
++       if (!dl)
++#endif
++           msg_fatal("%s: unsupported dictionary type: %s", myname, dict_type);
++#ifndef NO_DYNAMIC_MAPS
++       lib=vstring_alloc(1);
++       vstring_sprintf(lib,dl->soname,dict_type);
++       if (stat(vstring_str(lib),&st) < 0) {
++           msg_fatal("%s: unsupported dictionary type: %s (%s not found.  Is the postfix-%s package installed?)",
++               myname, dict_type, vstring_str(lib), dict_type);
++       }
++       func=vstring_alloc(1);
++       vstring_sprintf(func,dl->openfunc,dict_type);
++       fn[0].name = vstring_str(func);
++       fn[0].ptr  = (void**)&open;
++       fn[1].name = NULL;
++       load_library_symbols(vstring_str(lib), fn, NULL);
++       dict_open_register(dict_type, open);
++       dp = (DICT_OPEN_INFO *) htable_find(dict_open_hash, dict_type);
++       vstring_free(lib);
++       vstring_free(func);
++#endif
++    }
++    if (msg_verbose>1) {
++       msg_info("%s: calling %s open routine",myname,dict_type);
++    }
+     if ((dict = dp->open(dict_name, open_flags, dict_flags)) == 0)
+       return (dict_surrogate(dict_type, dict_name, open_flags, dict_flags,
+                           "cannot open %s:%s: %m", dict_type, dict_name));
+@@ -407,6 +449,76 @@
+     return mapnames;
+ }
++#ifndef NO_DYNAMIC_MAPS
++static DLINFO  *dict_dlinfo;
++
++void dict_open_dlinfo(const char *path)
++{
++    char    *myname="dict_open_dlinfo";
++    VSTREAM *conf_fp=vstream_fopen(path,O_RDONLY,0);
++    VSTRING *buf = vstring_alloc(100);
++    char    *cp;
++    ARGV    *argv;
++    MVECT    vector;
++    int      nelm=0;
++    int      linenum=0;
++
++    dict_dlinfo=(DLINFO*)mvect_alloc(&vector,sizeof(DLINFO),3,NULL,NULL);
++
++    if (!conf_fp) {
++      msg_warn("%s: cannot open %s.  No dynamic maps will be allowed.",
++              myname, path);
++    } else {
++      while (vstring_get_nonl(buf,conf_fp) != VSTREAM_EOF) {
++          cp = vstring_str(buf);
++          linenum++;
++          if (*cp == '#' || *cp == '\0')
++              continue;
++          argv = argv_split(cp, " \t");
++          if (argv->argc != 3) {
++              msg_fatal("%s: Expected \"pattern .so-name function\" at line %d",
++                        myname, linenum);
++          }
++          if (argv->argv[1][0] != '/') {
++              msg_fatal("%s: .so name must begin with a \"/\" at line %d",
++                        myname, linenum);
++          }
++          if (nelm >= vector.nelm) {
++              dict_dlinfo=(DLINFO*)mvect_realloc(&vector,vector.nelm+3);
++          }
++          dict_dlinfo[nelm].pattern  = mystrdup(argv->argv[0]);
++          dict_dlinfo[nelm].soname   = mystrdup(argv->argv[1]);
++          dict_dlinfo[nelm].openfunc = mystrdup(argv->argv[2]);
++          nelm++;
++          argv_free(argv);
++      }
++    }
++    if (nelm >= vector.nelm) {
++      dict_dlinfo=(DLINFO*)mvect_realloc(&vector,vector.nelm+1);
++    }
++    dict_dlinfo[nelm].pattern  = NULL;
++    dict_dlinfo[nelm].soname   = NULL;
++    dict_dlinfo[nelm].openfunc = NULL;
++    if (conf_fp)
++      vstream_fclose(conf_fp);
++    vstring_free(buf);
++}
++
++DLINFO *dict_open_dlfind(const char *type)
++{
++    DLINFO *dp;
++
++    if (!dict_dlinfo)
++      return NULL;
++
++    for (dp=dict_dlinfo; dp->pattern; dp++) {
++      if (strcmp(dp->pattern,type)==0 || strcmp(dp->pattern,"*")==0)
++          return dp;
++    }
++    return NULL;
++}
++#endif /* !NO_DYNAMIC_MAPS */
++
+ #ifdef TEST
+  /*
+--- postfix-2.9.0/src/util/Makefile.in.orig    2012-02-04 19:16:54.187276228 +0100
++++ postfix-2.9.0/src/util/Makefile.in 2012-02-04 19:30:39.503837753 +0100
 @@ -30,7 +30,7 @@
        username.c valid_hostname.c vbuf.c vbuf_print.c vstream.c \
        vstream_popen.c vstring.c vstring_vstream.c watchdog.c writable.c \
@@ -548,8 +623,8 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
 +      allascii.c load_file.c killme_after.c vstream_tweak.c load_lib.c \
        unix_pass_listen.c unix_pass_trigger.c edit_file.c inet_windowsize.c \
        unix_pass_fd_fix.c dict_cache.c valid_utf_8.c dict_thash.c \
-       ip_match.c nbbio.c stream_pass_connect.c
-@@ -40,7 +40,7 @@
+       ip_match.c nbbio.c stream_pass_connect.c base32_code.c dict_test.c \
+@@ -41,7 +41,7 @@
        chroot_uid.o cidr_match.o clean_env.o close_on_exec.o concatenate.o \
        ctable.o dict.o dict_alloc.o dict_cdb.o dict_cidr.o dict_db.o \
        dict_dbm.o dict_debug.o dict_env.o dict_ht.o dict_ni.o dict_nis.o \
@@ -558,7 +633,7 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
        dict_static.o dict_tcp.o dict_unix.o dir_forest.o doze.o dummy_read.o \
        dummy_write.o duplex_pipe.o environ.o events.o exec_command.o \
        fifo_listen.o fifo_trigger.o file_limit.o find_inet.o fsspace.o \
-@@ -65,7 +65,7 @@
+@@ -66,7 +66,7 @@
        username.o valid_hostname.o vbuf.o vbuf_print.o vstream.o \
        vstream_popen.o vstring.o vstring_vstream.o watchdog.o writable.o \
        write_buf.o write_wait.o sane_basename.o format_tv.o allspace.o \
@@ -566,17 +641,17 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
 +      allascii.o load_file.o killme_after.o vstream_tweak.o load_lib.o \
        unix_pass_listen.o unix_pass_trigger.o edit_file.o inet_windowsize.o \
        unix_pass_fd_fix.o dict_cache.o valid_utf_8.o dict_thash.o \
-       ip_match.o nbbio.o stream_pass_connect.o
-@@ -87,7 +87,7 @@
+       ip_match.o nbbio.o stream_pass_connect.o base32_code.o dict_test.o \
+@@ -89,7 +89,7 @@
        sigdelay.h sock_addr.h spawn_command.h split_at.h stat_as.h \
        stringops.h sys_defs.h timed_connect.h timed_wait.h trigger.h \
        username.h valid_hostname.h vbuf.h vbuf_print.h vstream.h vstring.h \
 -      vstring_vstream.h watchdog.h format_tv.h load_file.h killme_after.h \
 +      vstring_vstream.h watchdog.h format_tv.h load_file.h killme_after.h load_lib.h \
-       edit_file.h dict_cache.h dict_thash.h \
-       ip_match.h nbbio.h
+       edit_file.h dict_cache.h dict_thash.h ip_match.h nbbio.h base32_code.h \
+       dict_fail.h warn_stat.h
  TESTSRC       = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
-@@ -96,6 +96,7 @@
+@@ -98,6 +98,7 @@
  CFLAGS        = $(DEBUG) $(OPT) $(DEFS)
  FILES = Makefile $(SRCS) $(HDRS)
  INCL  =
@@ -584,7 +659,7 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
  LIB   = libutil.a
  TESTPROG= dict_open dup2_pass_on_exec events exec_command fifo_open \
        fifo_rdonly_bug fifo_rdwr_bug fifo_trigger fsspace fullname \
-@@ -111,8 +112,9 @@
+@@ -113,8 +114,9 @@
  
  LIB_DIR       = ../../lib
  INC_DIR       = ../../include
@@ -595,7 +670,7 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
  
  all: $(LIB)
  
-@@ -123,15 +125,19 @@
+@@ -125,15 +127,19 @@
  
  test: $(TESTPROG)
  
@@ -619,7 +694,7 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
        -for i in $(HDRS); \
        do \
          cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \
-@@ -153,7 +159,8 @@
+@@ -155,7 +161,8 @@
        lint $(DEFS) $(SRCS) $(LINTFIX)
  
  clean:
@@ -629,9 +704,9 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
        rm -rf printfck
  
  tidy: clean
---- postfix-2.8.3/src/global/mail_dict.c~      2011-05-17 14:11:58.216666735 +0200
-+++ postfix-2.8.3/src/global/mail_dict.c       2011-05-17 14:15:04.606666734 +0200
-@@ -46,18 +46,6 @@
+--- postfix-2.9.0/src/global/mail_dict.c.orig  2012-02-04 19:16:53.000000000 +0100
++++ postfix-2.9.0/src/global/mail_dict.c       2012-02-04 19:33:20.047179113 +0100
+@@ -47,18 +47,6 @@
  
  static const DICT_OPEN_INFO dict_open_info[] = {
      DICT_TYPE_PROXY, dict_proxy_open,
@@ -647,81 +722,6 @@ diff -durN postfix-2.1.3.orig/src/util/sys_defs.h postfix-2.1.3/src/util/sys_def
 -#ifdef HAS_SQLITE
 -    DICT_TYPE_SQLITE, dict_sqlite_open,
 -#endif
+     DICT_TYPE_MEMCACHE, dict_memcache_open,
      0,
  };
---- postfix-2.8.3/src/global/Makefile.in~      2011-05-17 14:11:58.243333401 +0200
-+++ postfix-2.8.3/src/global/Makefile.in       2011-05-17 14:27:36.783333538 +0200
-@@ -35,7 +35,7 @@
-       canon_addr.o cfg_parser.o cleanup_strerror.o cleanup_strflags.o \
-       clnt_stream.o conv_time.o db_common.o debug_peer.o debug_process.o \
-       defer.o deliver_completed.o deliver_flock.o deliver_pass.o \
--      deliver_request.o dict_ldap.o dict_mysql.o dict_pgsql.o \
-+      deliver_request.o \
-       dict_proxy.o dict_sqlite.o domain_list.o dot_lockfile.o dot_lockfile_as.o \
-       dsb_scan.o dsn.o dsn_buf.o dsn_mask.o dsn_print.o dsn_util.o \
-       ehlo_mask.o ext_prop.o file_id.o flush_clnt.o header_opts.o \
-@@ -106,8 +106,12 @@
- LIB_DIR       = ../../lib
- INC_DIR       = ../../include
- MAKES =
-+LDAPSO  = dict_ldap.so
-+MYSQLSO = dict_mysql.so
-+PGSQLSO       = dict_pgsql.so
-+SQLITESO= dict_sqlite.so
--.c.o:;        $(CC) $(CFLAGS) -c $*.c
-+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
- all: $(LIB)
-@@ -119,14 +123,36 @@
- test: $(TESTPROG)
- $(LIB):       $(OBJS)
--      $(AR) $(ARFL) $(LIB) $?
--      $(RANLIB) $(LIB)
-+      gcc -shared -Wl,-soname,libpostfix-global.so.1 -o $(LIB) $(OBJS)
-+
-+$(LDAPSO): dict_ldap.o $(LIB)
-+      gcc -shared -Wl,-soname,dict_ldap.so -o $@ $? -lldap -llber -L../../lib -lutil -L. -lglobal
-+
-+$(MYSQLSO): dict_mysql.o $(LIB)
-+      gcc -shared -Wl,-soname,dict_mysql.so -o $@ $? -lmysqlclient -L../../lib -lutil -L. -lglobal
-+
-+$(PGSQLSO): dict_pgsql.o $(LIB)
-+      gcc -shared -Wl,-soname,dict_pgsql.so -o $@ $? -lpq -L../../lib -lutil -L. -lglobal
-+
-+$(SQLITESO): dict_sqlite.o $(LIB)
-+      gcc -shared -Wl,-soname,dict_sqlite.so -o $@ $? -lsqlite3 -L../../lib -lutil -L. -lglobal
- $(LIB_DIR)/$(LIB): $(LIB)
-       cp $(LIB) $(LIB_DIR)
--      $(RANLIB) $(LIB_DIR)/$(LIB)
--update: $(LIB_DIR)/$(LIB) $(HDRS)
-+$(LIB_DIR)/$(LDAPSO): $(LDAPSO)
-+      cp $(LDAPSO) $(LIB_DIR)
-+
-+$(LIB_DIR)/$(MYSQLSO): $(MYSQLSO)
-+      cp $(MYSQLSO) $(LIB_DIR)
-+
-+$(LIB_DIR)/$(PGSQLSO): $(PGSQLSO)
-+      cp $(PGSQLSO) $(LIB_DIR)
-+
-+$(LIB_DIR)/$(SQLITESO): $(SQLITESO)
-+      cp $(SQLITESO) $(LIB_DIR)
-+
-+update: $(LIB_DIR)/$(LIB) $(LIB_DIR)/${LDAPSO} $(LIB_DIR)/${MYSQLSO} $(LIB_DIR)/${PGSQLSO} $(LIB_DIR)/${SQLITESO} $(HDRS)
-       -for i in $(HDRS); \
-       do \
-         cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \
-@@ -497,7 +523,7 @@
-       lint $(DEFS) $(SRCS) $(LINTFIX)
- clean:
--      rm -f *.o $(LIB) *core $(TESTPROG) junk
-+      rm -f *.o $(LIB) $(LDAPSO) $(MYSQLSO) $(PGSQLSO) $(SQLITESO) *core $(TESTPROG) junk
-       rm -rf printfck
- tidy: clean
index 974ced606ad78c30241dbda4e38bbbc004ba9a0b..8cbd612f107998dbc7eafd93a72d92aa15dcc8a8 100644 (file)
@@ -153,9 +153,44 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
 +    return_val = mystrdup(ident_user);
 +    return return_val;
 +}
---- postfix-2.3-RC9/src/smtpd/smtpd.c.orig     2006-07-11 20:13:27.780850288 +0200
-+++ postfix-2.3-RC9/src/smtpd/smtpd.c  2006-07-11 20:27:06.515383720 +0200
-@@ -1024,6 +1024,7 @@
+--- postfix-2.3-RC9/src/smtpd/smtpd.h.orig     2006-07-09 21:49:21.000000000 +0200
++++ postfix-2.3-RC9/src/smtpd/smtpd.h  2006-07-11 20:30:43.993322048 +0200
+@@ -77,6 +77,7 @@
+     char   *addr;                     /* client host address string */
+     char   *namaddr;                  /* combined name and address */
+     char   *rfc_addr;                 /* address for RFC 2821 */
++    char   *ident_user;                       /* user name returned by ident RFC 1413 */
+     int     addr_family;              /* address family */
+     struct sockaddr_storage sockaddr; /* binary client endpoint */
+     int     name_status;              /* 2=ok 4=soft 5=hard 6=forged */
+@@ -266,6 +267,8 @@
+ extern void smtpd_peer_init(SMTPD_STATE *state);
+ extern void smtpd_peer_reset(SMTPD_STATE *state);
++extern char *smtpd_ident(struct sockaddr_in *peer_addr, struct sockaddr_in *smtpd_addr);
++
+ #define       SMTPD_PEER_CODE_OK      2
+ #define SMTPD_PEER_CODE_TEMP  4
+ #define SMTPD_PEER_CODE_PERM  5
+--- postfix-2.8.3/src/smtpd/Makefile.in~       2011-05-17 14:28:28.406666872 +0200
++++ postfix-2.8.3/src/smtpd/Makefile.in        2011-05-17 14:31:06.946666872 +0200
+@@ -2,11 +2,11 @@
+ SRCS  = smtpd.c smtpd_token.c smtpd_check.c smtpd_chat.c smtpd_state.c \
+       smtpd_peer.c smtpd_sasl_proto.c smtpd_sasl_glue.c smtpd_proxy.c \
+       smtpd_xforward.c smtpd_dsn_fix.c smtpd_milter.c smtpd_resolve.c \
+-      smtpd_expand.c
++      smtpd_expand.c smtpd_ident.c
+ OBJS  = smtpd.o smtpd_token.o smtpd_check.o smtpd_chat.o smtpd_state.o \
+       smtpd_peer.o smtpd_sasl_proto.o smtpd_sasl_glue.o smtpd_proxy.o \
+       smtpd_xforward.o smtpd_dsn_fix.o smtpd_milter.o smtpd_resolve.o \
+-      smtpd_expand.o
++      smtpd_expand.o smtpd_ident.o
+ HDRS  = smtpd_token.h smtpd_check.h smtpd_chat.h smtpd_sasl_proto.h \
+       smtpd_sasl_glue.h smtpd_proxy.h smtpd_dsn_fix.h smtpd_milter.h \
+       smtpd_resolve.h smtpd_expand.h
+--- postfix-2.9.0/src/smtpd/smtpd.c.orig       2012-02-04 19:34:17.737149536 +0100
++++ postfix-2.9.0/src/smtpd/smtpd.c    2012-02-04 19:36:43.414073592 +0100
+@@ -1208,6 +1208,7 @@
  char   *var_local_rwr_clients;
  char   *var_smtpd_ehlo_dis_words;
  char   *var_smtpd_ehlo_dis_maps;
@@ -163,7 +198,7 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
  
  char   *var_smtpd_tls_level;
  bool    var_smtpd_use_tls;
-@@ -1119,6 +1120,11 @@
+@@ -1329,6 +1330,11 @@
  int     smtpd_input_transp_mask;
  
   /*
@@ -175,7 +210,7 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
    * Forward declarations.
    */
  static void helo_reset(SMTPD_STATE *);
-@@ -2503,10 +2509,18 @@
+@@ -2950,10 +2956,18 @@
       * intermediate proxy.
       */
      if (!proxy || state->xforward.flags == 0) {
@@ -198,17 +233,17 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
  
  #define VSTRING_STRDUP(s) vstring_strcpy(vstring_alloc(strlen(s) + 1), (s))
  
-@@ -4451,6 +4451,9 @@
-     xclient_hosts = namadr_list_init(MATCH_FLAG_NONE, var_xclient_hosts);
-     xforward_hosts = namadr_list_init(MATCH_FLAG_NONE, var_xforward_hosts);
-     hogger_list = namadr_list_init(MATCH_FLAG_NONE, var_smtpd_hoggers);
+@@ -4954,6 +4968,9 @@
+     xclient_hosts = namadr_list_init(MATCH_FLAG_RETURN, var_xclient_hosts);
+     xforward_hosts = namadr_list_init(MATCH_FLAG_RETURN, var_xforward_hosts);
+     hogger_list = namadr_list_init(MATCH_FLAG_RETURN, var_smtpd_hoggers);
 +    smtpd_ident_lookup =
 +           namadr_list_init(match_parent_style(VAR_SMTPD_IDENT_LOOKUP),
 +                var_smtpd_ident_lookup);
  
      /*
       * Open maps before dropping privileges so we can read passwords etc.
-@@ -5076,6 +5093,7 @@
+@@ -5382,6 +5399,7 @@
        VAR_MILT_V, DEF_MILT_V, &var_milt_v, 1, 0,
        VAR_STRESS, DEF_STRESS, &var_stress, 0, 0,
        VAR_REJECT_REPLY_MSG_ACCESS_DENIED, DEF_REJECT_REPLY_MSG_ACCESS_DENIED, &var_reject_reply_msg_access_denied, 1, 0,
@@ -216,27 +251,8 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
        VAR_UNV_FROM_WHY, DEF_UNV_FROM_WHY, &var_unv_from_why, 0, 0,
        VAR_UNV_RCPT_WHY, DEF_UNV_RCPT_WHY, &var_unv_rcpt_why, 0, 0,
        VAR_REJECT_TMPF_ACT, DEF_REJECT_TMPF_ACT, &var_reject_tmpf_act, 1, 0,
---- postfix-2.3-RC9/src/smtpd/smtpd.h.orig     2006-07-09 21:49:21.000000000 +0200
-+++ postfix-2.3-RC9/src/smtpd/smtpd.h  2006-07-11 20:30:43.993322048 +0200
-@@ -77,6 +77,7 @@
-     char   *addr;                     /* client host address string */
-     char   *namaddr;                  /* combined name and address */
-     char   *rfc_addr;                 /* address for RFC 2821 */
-+    char   *ident_user;                       /* user name returned by ident RFC 1413 */
-     int     addr_family;              /* address family */
-     struct sockaddr_storage sockaddr; /* binary client endpoint */
-     int     name_status;              /* 2=ok 4=soft 5=hard 6=forged */
-@@ -266,6 +267,8 @@
- extern void smtpd_peer_init(SMTPD_STATE *state);
- extern void smtpd_peer_reset(SMTPD_STATE *state);
-+extern char *smtpd_ident(struct sockaddr_in *peer_addr, struct sockaddr_in *smtpd_addr);
-+
- #define       SMTPD_PEER_CODE_OK      2
- #define SMTPD_PEER_CODE_TEMP  4
- #define SMTPD_PEER_CODE_PERM  5
---- postfix-2.3-RC9/src/smtpd/smtpd_peer.c.orig        2006-07-08 02:51:33.000000000 +0200
-+++ postfix-2.3-RC9/src/smtpd/smtpd_peer.c     2006-07-11 20:41:04.935924424 +0200
+--- postfix-2.9.0/src/smtpd/smtpd_peer.c.orig  2012-02-04 19:34:17.294233547 +0100
++++ postfix-2.9.0/src/smtpd/smtpd_peer.c       2012-02-04 19:40:48.203777370 +0100
 @@ -98,6 +98,7 @@
  
  #include <sys_defs.h>
@@ -245,7 +261,7 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
  #include <netinet/in.h>
  #include <arpa/inet.h>
  #include <stdio.h>                    /* strerror() */
-@@ -116,6 +117,7 @@
+@@ -117,6 +118,7 @@
  
  /* Global library. */
  
@@ -253,7 +269,7 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
  #include <mail_proto.h>
  #include <valid_mailhost_addr.h>
  #include <mail_params.h>
-@@ -124,6 +126,8 @@
+@@ -125,6 +127,8 @@
  
  #include "smtpd.h"
  
@@ -262,7 +278,7 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
  /* smtpd_peer_init - initialize peer information */
  
  void    smtpd_peer_init(SMTPD_STATE *state)
-@@ -131,6 +135,9 @@
+@@ -132,6 +136,9 @@
      const char *myname = "smtpd_peer_init";
      SOCKADDR_SIZE sa_length;
      struct sockaddr *sa;
@@ -272,23 +288,23 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
      INET_PROTO_INFO *proto_info = inet_proto_info();
  
      sa = (struct sockaddr *) & (state->sockaddr);
-@@ -177,6 +177,7 @@
+@@ -171,6 +178,7 @@
        state->addr_family = AF_UNSPEC;
        state->name_status = SMTPD_PEER_CODE_PERM;
        state->reverse_name_status = SMTPD_PEER_CODE_PERM;
 +      state->ident_user = mystrdup("NO-USER");
-       state->port = mystrdup(CLIENT_PORT_UNKNOWN);
+       state->port = mystrdup(CLIENT_PORT_UNKNOWN);
      }
-
-@@ -302,6 +310,7 @@
+@@ -342,6 +350,7 @@
            if (aierr) {
-               msg_warn("%s: hostname %s verification failed: %s",
-                        state->addr, state->name, MAI_STRERROR(aierr));
-+              state->ident_user = mystrdup("NO-USER");
+               msg_warn("hostname %s does not resolve to address %s: %s",
+                        state->name, state->addr, MAI_STRERROR(aierr));
++                state->ident_user = mystrdup("NO-USER");
                REJECT_PEER_NAME(state, (TEMP_AI_ERROR(aierr) ?
                            SMTPD_PEER_CODE_TEMP : SMTPD_PEER_CODE_FORGED));
            } else {
-@@ -323,6 +332,20 @@
+@@ -363,6 +372,20 @@
                freeaddrinfo(res0);
            }
        }
@@ -309,36 +325,18 @@ diff -urN -x '*~' postfix-2.2.5/src/smtpd/smtpd_ident.c postfix-2.2.5-ident/src/
      }
  
      /*
-@@ -390,7 +391,8 @@
+@@ -383,6 +406,7 @@
        state->name_status = SMTPD_PEER_CODE_OK;
        state->reverse_name_status = SMTPD_PEER_CODE_OK;
        state->port = mystrdup("0");            /* XXX bogus. */
--    }
 +      state->ident_user = mystrdup("NO-USER");
-+    }
+     }
  
      /*
-      * Do the name[addr]:port formatting for pretty reports.
-@@ -410,5 +412,6 @@
+@@ -401,5 +425,6 @@
      myfree(state->addr);
      myfree(state->namaddr);
      myfree(state->rfc_addr);
 +    myfree(state->ident_user);
      myfree(state->port);
  }
---- postfix-2.8.3/src/smtpd/Makefile.in~       2011-05-17 14:28:28.406666872 +0200
-+++ postfix-2.8.3/src/smtpd/Makefile.in        2011-05-17 14:31:06.946666872 +0200
-@@ -2,11 +2,11 @@
- SRCS  = smtpd.c smtpd_token.c smtpd_check.c smtpd_chat.c smtpd_state.c \
-       smtpd_peer.c smtpd_sasl_proto.c smtpd_sasl_glue.c smtpd_proxy.c \
-       smtpd_xforward.c smtpd_dsn_fix.c smtpd_milter.c smtpd_resolve.c \
--      smtpd_expand.c
-+      smtpd_expand.c smtpd_ident.c
- OBJS  = smtpd.o smtpd_token.o smtpd_check.o smtpd_chat.o smtpd_state.o \
-       smtpd_peer.o smtpd_sasl_proto.o smtpd_sasl_glue.o smtpd_proxy.o \
-       smtpd_xforward.o smtpd_dsn_fix.o smtpd_milter.o smtpd_resolve.o \
--      smtpd_expand.o
-+      smtpd_expand.o smtpd_ident.o
- HDRS  = smtpd_token.h smtpd_check.h smtpd_chat.h smtpd_sasl_proto.h \
-       smtpd_sasl_glue.h smtpd_proxy.h smtpd_dsn_fix.h smtpd_milter.h \
-       smtpd_resolve.h smtpd_expand.h
This page took 0.293992 seconds and 4 git commands to generate.