]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.2-20170109-nonprod 20170108-nonprod
authorWietse Venema <wietse@porcupine.org>
Mon, 9 Jan 2017 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Wed, 11 Jan 2017 00:34:26 +0000 (19:34 -0500)
28 files changed:
postfix/HISTORY
postfix/WISHLIST
postfix/src/cleanup/cleanup_addr.c
postfix/src/cleanup/cleanup_map11.c
postfix/src/global/mail_addr_crunch.c
postfix/src/global/mail_addr_crunch.h
postfix/src/global/mail_addr_find.c
postfix/src/global/mail_addr_find.h
postfix/src/global/mail_addr_map.c
postfix/src/global/mail_addr_map.h
postfix/src/global/mail_addr_map_tester.c
postfix/src/global/mail_version.h
postfix/src/global/split_addr.c
postfix/src/global/split_addr.h
postfix/src/global/strip_addr.c
postfix/src/global/strip_addr.h
postfix/src/local/bounce_workaround.c
postfix/src/local/recipient.c
postfix/src/oqmgr/qmgr_message.c
postfix/src/pipe/pipe.c
postfix/src/qmgr/qmgr_message.c
postfix/src/smtp/smtp_map11.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtp/smtp_sasl_glue.c
postfix/src/smtpd/smtpd_check.c
postfix/src/trivial-rewrite/resolve.c
postfix/src/trivial-rewrite/transport.c
postfix/src/virtual/mailbox.c

index d9428c0db0e3f022ef83e6fc5ae389024ef8e266..64a78948b8fc8cad3ee2cc357a0e1cb4f411bbd6 100644 (file)
@@ -22785,3 +22785,10 @@ Apologies for any names omitted.
        relocated_maps). These features may be migrated later to
        enable quoted-form address lookup keys, for consistency
        with other Postfix features.
+
+20170109
+
+       Cleanup: reduce the number of modified files, to make a
+       back-port more feasible. This renames foo() to foo_opt(),
+       and renames the backwards_compatibility foo_noconv() to
+       their old name foo().
index 109e8c82c076895beaff9e8c96c6baa875bda08e..30a9805133a6946b6f33b67f1efb2ef072fa9d54 100644 (file)
@@ -6,7 +6,11 @@ Wish list:
 
        Disable -DSNAPSHOT and -DNONPROD in makedefs.
 
-       Document RFC5321 localpart quoting in DATABASE_README.
+       Document RFC5322 localpart quoting in DATABASE_README.
+
+       Add quote_822_local() flag to indicate if an address
+       is complete or localpart only. This avoids incorrect
+       results when a localpart-only input contains '@'.
 
        In the bounce daemon, set util_utf8_enable if returning an
        SMTPUTF8 message.
index 842d0d92435a7374948329ff69aabfc9ba3a400f..b6396ada860e8b6840458a1db7552c20be95af0f 100644 (file)
@@ -165,9 +165,8 @@ off_t   cleanup_addr_sender(CLEANUP_STATE *state, const char *buf)
     if ((state->flags & CLEANUP_FLAG_BCC_OK)
        && *STR(clean_addr)
        && cleanup_send_bcc_maps) {
-       if ((bcc = mail_addr_find_noconv(cleanup_send_bcc_maps,
-                                        STR(clean_addr),
-                                        IGNORE_EXTENSION)) != 0) {
+       if ((bcc = mail_addr_find(cleanup_send_bcc_maps, STR(clean_addr),
+                                 IGNORE_EXTENSION)) != 0) {
            cleanup_addr_bcc(state, bcc);
        } else if (cleanup_send_bcc_maps->error) {
            msg_warn("%s: %s map lookup problem -- "
@@ -229,9 +228,8 @@ void    cleanup_addr_recipient(CLEANUP_STATE *state, const char *buf)
     if ((state->flags & CLEANUP_FLAG_BCC_OK)
        && *STR(clean_addr)
        && cleanup_rcpt_bcc_maps) {
-       if ((bcc = mail_addr_find_noconv(cleanup_rcpt_bcc_maps,
-                                        STR(clean_addr),
-                                        IGNORE_EXTENSION)) != 0) {
+       if ((bcc = mail_addr_find(cleanup_rcpt_bcc_maps, STR(clean_addr),
+                                 IGNORE_EXTENSION)) != 0) {
            cleanup_addr_bcc(state, bcc);
        } else if (cleanup_rcpt_bcc_maps->error) {
            msg_warn("%s: %s map lookup problem -- "
index 6e835b0e27d7e0fd6864eb80ed6cb2a33e39c0cf..941e156f23130a707c241a9718b2b0fa017865a1 100644 (file)
@@ -104,9 +104,9 @@ int     cleanup_map11_external(CLEANUP_STATE *state, VSTRING *addr,
      * the place.
      */
     for (count = 0; count < MAX_RECURSION; count++) {
-       if ((new_addr = mail_addr_map(maps, STR(addr), propagate,
-                                     MAIL_ADDR_FORM_EXTERNAL,
-                                     MAIL_ADDR_FORM_EXTERNAL)) != 0) {
+       if ((new_addr = mail_addr_map_opt(maps, STR(addr), propagate,
+                                         MAIL_ADDR_FORM_EXTERNAL,
+                                         MAIL_ADDR_FORM_EXTERNAL)) != 0) {
            if (new_addr->argc > 1)
                msg_warn("%s: multi-valued %s entry for %s",
                         state->queue_id, maps->title, STR(addr));
index 7e7db1a06941473ecba04ec8fcad6578a93838d9..73d7206dfcd54c1fba159e145c8f38f5f42ce068 100644 (file)
 /*     const char *string;
 /*     const char *extension;
 /*
-/*     ARGV    *mail_addr_crunch(string, extension, in_form, out_form)
+/*     ARGV    *mail_addr_crunch_opt(string, extension, in_form, out_form)
 /*     const char *string;
 /*     const char *extension;
 /*     int     in_form;
 /*     int     out_form;
 /* LEGACY SUPPORT
-/*     ARGV    *mail_addr_crunch_noconv(string, extension)
+/*     ARGV    *mail_addr_crunch(string, extension)
 /*     const char *string;
 /*     const char *extension;
 /* DESCRIPTION
 /*     between internal and external forms. The caller is expected
 /*     to pass the result to argv_free().
 /*
-/*     mail_addr_crunch() gives more control, at the cost of
+/*     mail_addr_crunch_opt() gives more control, at the cost of
 /*     additional conversions between internal and external forms.
 /*
-/*     mail_addr_crunch_noconv() is used by legacy code and performs
+/*     mail_addr_crunch() is used by legacy code and performs
 /*     no conversion between internal and external forms.
 /*
 /*     Arguments:
@@ -82,7 +82,7 @@
 
 /* mail_addr_crunch - break string into addresses, optionally add extension */
 
-ARGV   *mail_addr_crunch(const char *string, const char *extension,
+ARGV   *mail_addr_crunch_opt(const char *string, const char *extension,
                                 int in_form, int out_form)
 {
     VSTRING *intern_addr = vstring_alloc(100);
@@ -216,7 +216,7 @@ int     main(int unused_argc, char **unused_argv)
        vstream_fflush(VSTREAM_OUT);
     }
     while (vstring_get_nonl(buf, VSTREAM_IN) != VSTREAM_EOF) {
-       argv = mail_addr_crunch(STR(buf), (VSTRING_LEN(extension) ?
+       argv = mail_addr_crunch_opt(STR(buf), (VSTRING_LEN(extension) ?
                                           STR(extension) : 0),
                                in_form, out_form);
        for (cpp = argv->argv; *cpp; cpp++)
index 3ee39fff1b1d05c9ea07e2811a954e0e22073784..64ed02e7d1465d080ce3f125117b3b3c15203337 100644 (file)
   * Global library.
   */
 #include <mail_addr_form.h>
-#include <argv.h>
 
  /*
   * External interface.
   */
-extern ARGV *mail_addr_crunch(const char *, const char *, int, int);
+extern ARGV *mail_addr_crunch_opt(const char *, const char *, int, int);
 
- /* The least-overhead form. */
+ /*
+  * The least-overhead form.
+  */
 #define mail_addr_crunch_ext_to_int(string, extension) \
-       mail_addr_crunch((string), (extension), MAIL_ADDR_FORM_EXTERNAL, \
+       mail_addr_crunch_opt((string), (extension), MAIL_ADDR_FORM_EXTERNAL, \
                        MAIL_ADDR_FORM_INTERNAL)
 
- /* The legacy form. */
-#define mail_addr_crunch_noconv(string, extension) \
-       mail_addr_crunch((string), (extension), MAIL_ADDR_FORM_NOCONV, \
+ /*
+  * The legacy form.
+  */
+#define mail_addr_crunch(string, extension) \
+       mail_addr_crunch_opt((string), (extension), MAIL_ADDR_FORM_NOCONV, \
                        MAIL_ADDR_FORM_NOCONV)
 
 /* LICENSE
index 7adf593301c602fbcae5f05e27d2868e0603acd6..a5aff22bd47d9cfa832d1cd8981371b6b6c5c3ba 100644 (file)
 /*     const char *address;
 /*     char    **extension;
 /*
-/*     const char *mail_addr_find(maps, address, extension, in_form, out_form)
+/*     const char *mail_addr_find_opt(maps, address, extension,
+/*                                     in_form, out_form)
 /*     MAPS    *maps;
 /*     const char *address;
 /*     char    **extension;
 /*     int     in_form;
 /*     int     out_form;
 /* LEGACY SUPPORT
-/*     const char *mail_addr_find_noconv(maps, address, extension)
+/*     const char *mail_addr_find(maps, address, extension)
 /*     MAPS    *maps;
 /*     const char *address;
 /*     char    **extension;
 /*     (unquoted/quoted) conversions of the query, extension, or
 /*     result.
 /*
-/*     mail_addr_find() gives more control, at the cost of
+/*     mail_addr_find_opt() gives more control, at the cost of
 /*     additional conversions between internal and external forms.
 /*     In particular, the output conversion to internal form assumes
 /*     that the lookup result is an email address.
 /*
-/*     mail_addr_find_noconv() is used by legacy code that is not
+/*     mail_addr_find() is used by legacy code that is not
 /*     yet aware of internal versus external addres formats.
 /*
 /*     mail_addr_find_trans() implements transitional functionality.
-/*     It behaves like mail_addr_find(...INTERNAL, ...NOCONV) and
+/*     It behaves like mail_addr_find_opt(...INTERNAL, ...NOCONV) and
 /*     searches a table with the quoted form of the address, but
 /*     if the lookup produces no result, and the quoted address
 /*     differs from the unquoted form, it also tries
-/*     mail_addr_find(...NOCONV, ...NOCONV).
+/*     mail_addr_find_opt(...NOCONV, ...NOCONV).
 /*
 /*     An address that is in the form \fIuser\fR matches itself.
 /*
@@ -137,18 +138,18 @@ const char *mail_addr_find_trans(MAPS *path, const char *address, char **extp)
     static VSTRING *quoted_addr;
 
     /*
-     * First, let mail_addr_find() search with the address converted to
+     * First, let mail_addr_find_opt() search with the address converted to
      * external form. Fall back to a search with the address in internal
      * (unconverted) form, if no match was found and the internal and
      * external forms differ.
      */
-    if ((result = mail_addr_find(path, address, extp,
+    if ((result = mail_addr_find_opt(path, address, extp,
                    MAIL_ADDR_FORM_INTERNAL, MAIL_ADDR_FORM_NOCONV)) == 0) {
        if (quoted_addr == 0)
            quoted_addr = vstring_alloc(100);
        quote_822_local(quoted_addr, address);
        if (strcmp(STR(quoted_addr), address) != 0)
-           result = mail_addr_find(path, address, extp,
+           result = mail_addr_find_opt(path, address, extp,
                              MAIL_ADDR_FORM_NOCONV, MAIL_ADDR_FORM_NOCONV);
     }
     return (result);
@@ -168,8 +169,8 @@ static const char *find_addr(MAPS *path, const char *address, int flags,
 
 /* mail_addr_find - map a canonical address */
 
-const char *mail_addr_find(MAPS *path, const char *address, char **extp,
-                                  int in_form, int out_form)
+const char *mail_addr_find_opt(MAPS *path, const char *address, char **extp,
+                                      int in_form, int out_form)
 {
     const char *myname = "mail_addr_find";
     VSTRING *ext_addr_buf = 0;
@@ -205,7 +206,7 @@ const char *mail_addr_find(MAPS *path, const char *address, char **extp,
        int_bare_key = saved_ext = 0;
     } else {
        int_bare_key =
-           strip_addr_internal(int_full_key, &saved_ext, var_rcpt_delim);
+           strip_addr(int_full_key, &saved_ext, var_rcpt_delim);
     }
 
     /*
@@ -364,7 +365,7 @@ int     main(int argc, char **argv)
        expect_res = mystrtok(&bp, ":");
        expect_ext = mystrtok(&bp, ":");
        extent = 0;
-       result = mail_addr_find(path, key_field, &extent, in_form, out_form);
+       result = mail_addr_find_opt(path, key_field, &extent, in_form, out_form);
        vstream_printf("%s:%s -> %s:%s (%s)\n",
                       in_field, key_field, out_field, result ? result :
                       path->error ? "(try again)" :
index aa3a974508789060511d8a842675eeb7e4215978..e515e2033823a36393d64deb333c775b51cd0728 100644 (file)
  /*
   * External interface.
   */
-extern const char *mail_addr_find(MAPS *, const char *, char **, int, int);
+extern const char *mail_addr_find_opt(MAPS *, const char *, char **, int, int);
+extern const char *mail_addr_find_trans(MAPS *, const char *, char **);
 
  /* The least-overhead form. */
 #define mail_addr_find_int_to_ext(maps, address, extension) \
-       mail_addr_find((maps), (address), (extension), \
+       mail_addr_find_opt((maps), (address), (extension), \
            MAIL_ADDR_FORM_INTERNAL, MAIL_ADDR_FORM_EXTERNAL)
 
  /* The legacy form. */
-#define mail_addr_find_noconv(maps, address, extension) \
-       mail_addr_find((maps), (address), (extension), \
+#define mail_addr_find(maps, address, extension) \
+       mail_addr_find_opt((maps), (address), (extension), \
            MAIL_ADDR_FORM_NOCONV, MAIL_ADDR_FORM_NOCONV)
 
 /* LICENSE
index fafb05dd788fa884337ab5a36bce029aa947089b..e7b2449415dd37c872de9e4cabd8945e8ae3c20d 100644 (file)
@@ -11,7 +11,7 @@
 /*     const char *address;
 /*     int     propagate;
 /*
-/*     ARGV    *mail_addr_map(path, address, propagate, in_form, out_form)
+/*     ARGV    *mail_addr_map_opt(path, address, propagate, in_form, out_form)
 /*     MAPS    *path;
 /*     const char *address;
 /*     int     propagate;
@@ -21,7 +21,7 @@
 /*     named address, or a null pointer if none is found.  The
 /*     search address and results are in internal (unquoted) form.
 /*
-/*     mail_addr_map() gives more control, at the cost of additional
+/*     mail_addr_map_opt() gives more control, at the cost of additional
 /*     conversions between internal and external forms.
 /*
 /*     When the \fBpropagate\fR argument is non-zero,
@@ -34,7 +34,7 @@
 /*     the original user in
 /*     \fIotherdomain\fR.
 /*
-/*     mail_addr_map() gives additional control over whether the
+/*     mail_addr_map_opt() gives additional control over whether the
 /*     input is in internal (unquoted) or external (quoted) form.
 /*     to internal form and invokes mail_addr_map_int_to_ext().
 /*     This may introduce additional unqoute822_local() and
@@ -96,8 +96,8 @@
 
 /* mail_addr_map - map a canonical address */
 
-ARGV   *mail_addr_map(MAPS *path, const char *address, int propagate,
-                             int in_form, int out_form)
+ARGV   *mail_addr_map_opt(MAPS *path, const char *address, int propagate,
+                                 int in_form, int out_form)
 {
     VSTRING *buffer = 0;
     const char *myname = "mail_addr_map";
@@ -116,9 +116,10 @@ ARGV   *mail_addr_map(MAPS *path, const char *address, int propagate,
 
     /*
      * Optionally convert input from external form. We prefer internal-form
-     * input to avoid an unnecessary input conversion in mail_addr_find().
-     * But the consequence is that we have to convert the internal-form
-     * input's localpart to external form when mapping @domain -> @domain.
+     * input to avoid an unnecessary input conversion in
+     * mail_addr_find_opt(). But the consequence is that we have to convert
+     * the internal-form input's localpart to external form when mapping
+     * @domain -> @domain.
      */
     if (in_form == MAIL_ADDR_FORM_EXTERNAL) {
        int_address = vstring_alloc(100);
@@ -132,11 +133,11 @@ ARGV   *mail_addr_map(MAPS *path, const char *address, int propagate,
     /*
      * Look up the full address; if no match is found, look up the address
      * with the extension stripped off, and remember the unmatched extension.
-     * We explicitly call the mail_addr_find() variant that does not convert
-     * the lookup result.
+     * We explicitly call the mail_addr_find_opt() variant that does not
+     * convert the lookup result.
      */
-    if ((string = mail_addr_find(path, int_addr, &extension,
-                                in_form, mid_form)) != 0) {
+    if ((string = mail_addr_find_opt(path, int_addr, &extension,
+                                    in_form, mid_form)) != 0) {
 
        /*
         * Prepend the original user to @otherdomain, but do not propagate
@@ -160,8 +161,8 @@ ARGV   *mail_addr_map(MAPS *path, const char *address, int propagate,
         * Canonicalize the result, and propagate the unmatched extension to
         * each address found.
         */
-       argv = mail_addr_crunch(string, propagate ? extension : 0,
-                               mid_form, out_form);
+       argv = mail_addr_crunch_opt(string, propagate ? extension : 0,
+                                   mid_form, out_form);
        if (buffer)
            vstring_free(buffer);
        if (ext_address)
index 87f926850a481f9aaa66c8c38a4484815efe1aea..945417b86c1b499d795e5e10eaf62651845aac56 100644 (file)
  /*
   * External interface.
   */
-extern ARGV *mail_addr_map(MAPS *, const char *, int, int, int);
+extern ARGV *mail_addr_map_opt(MAPS *, const char *, int, int, int);
 
  /* The least-overhead form. */
 #define mail_addr_map_internal(path, address, propagate) \
-       mail_addr_map((path), (address), (propagate), \
+       mail_addr_map_opt((path), (address), (propagate), \
                  MAIL_ADDR_FORM_INTERNAL, MAIL_ADDR_FORM_INTERNAL)
 
 /* LICENSE
index 4bdd4bba7194cec7ee6f2d3fd55b48959acbe47a..aae1a3bf573f30d0c87dfe01d75f74277132250d 100644 (file)
@@ -73,8 +73,8 @@ typedef struct {
 #define PLUS_RECIPIENT_DELIMITER               "+"
 
  /*
-  * All these tests must pass, so that we know that mail_addr_map() works as
-  * intended.
+  * All these tests must pass, so that we know that mail_addr_map_opt() works
+  * as intended.
   */
 static MAIL_ADDR_MAP_TEST pass_tests[] = {
     {
@@ -284,8 +284,8 @@ int     main(int argc, char **argv)
                             | DICT_FLAG_FOLD_FIX | DICT_FLAG_UTF8_REQUEST);
 
        UPDATE(var_rcpt_delim, test->delimiter);
-       result = mail_addr_map(maps, test->address, test->propagate,
-                              test->in_form, test->out_form);
+       result = mail_addr_map_opt(maps, test->address, test->propagate,
+                                  test->in_form, test->out_form);
        if (compare(test->testname, test->expect_argv, test->expect_argc,
               result ? result->argv : 0, result ? result->argc : 0) != 0) {
            msg_info("database = %s", test->database);
index ced90d0bf8c0bc7736b809a06c0bd8bf1d8678dc..1694eae0a8babf3ad3e494b3ab79e8469e96ae8a 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20170108"
+#define MAIL_RELEASE_DATE      "20170109"
 #define MAIL_VERSION_NUMBER    "3.2"
 
 #ifdef SNAPSHOT
index 58b8da7994d37b5894e26c253a7ade8f06efd134..2bed146bd21e0b780d5b484de73951eee7407234 100644 (file)
@@ -15,6 +15,9 @@
 /*     found, and returns a pointer to the remainder. The address
 /*     must be in internal (unquoted) form.
 /*
+/*     split_addr() is a backwards-compatible form for legacy code.
+/*     It is an alias for split_addr_internal().
+/*
 /*     Reserved addresses are not split: postmaster, mailer-daemon,
 /*     double-bounce. Addresses that begin with owner-, or addresses
 /*     that end in -request are not split when the owner_request_special
index e278ee2cd0fbf4878ddd18dcf9262d3d1013213e..b68dc6144e6f1afcdeaed23bd3434b3c3ca3592f 100644 (file)
 
 extern char *split_addr_internal(char *, const char *);
 
+ /* Legacy API. */
+
+#define split_addr     split_addr_internal
+
 /* LICENSE
 /* .ad
 /* .fi
index da6670df6a36d9296ac77f72b63ef18404284a9a..d75db640ea1a7f5a0129c71cec0932a2d0830305 100644 (file)
@@ -17,6 +17,9 @@
 /*     The caller is expected to pass the copy to myfree().
 /*     The input and result are in internal form.
 /*
+/*     strip_addr() is a backwards-compatible form for legacy code.
+/*     It is an alias for strip_addr_internal().
+/*
 /*     Arguments:
 /* .IP address
 /*     Address localpart or user@domain form in internal form.
@@ -78,7 +81,7 @@ char   *strip_addr_internal(const char *full, char **extension,
        stripped = mystrdup(full);
        if ((ratsign = strrchr(stripped, '@')) != 0)
            *ratsign = 0;
-       if ((extent = split_addr_internal(stripped, delimiter_set)) != 0) {
+       if ((extent = split_addr(stripped, delimiter_set)) != 0) {
            extent -= 1;
            if (extension) {
                *extent = full[strlen(stripped)];
index e482ee47a997adb8f31d1f7d7a5f822bae447b73..18895bac6a6235647ed8761f893006c72c9634d1 100644 (file)
 /* DESCRIPTION
 /* .nf
 
- /*
-  * External interface.
-  */
-extern char * strip_addr_internal(const char *, char **, const char *);
+ /* External interface. */
+
+extern char *strip_addr_internal(const char *, char **, const char *);
+
+#define strip_addr     strip_addr_internal
 
 /* LICENSE
 /* .ad
index 027c0ec95a9b2c8c0b61b43d64c67652c03fd1c5..7fe4aaa147751b16e8ed26985c4c55f9782d040a 100644 (file)
@@ -108,10 +108,9 @@ int     bounce_workaround(LOCAL_STATE state)
 
        FIND_OWNER(owner_alias, owner_expansion, state.msg_attr.rcpt.address);
        if (alias_maps->error == 0 && owner_expansion == 0
-           && (stripped_recipient =
-               strip_addr_internal(state.msg_attr.rcpt.address,
-                                   (char **) 0,
-                                   var_rcpt_delim)) != 0) {
+           && (stripped_recipient = strip_addr(state.msg_attr.rcpt.address,
+                                               (char **) 0,
+                                               var_rcpt_delim)) != 0) {
            myfree(owner_alias);
            FIND_OWNER(owner_alias, owner_expansion, stripped_recipient);
            myfree(stripped_recipient);
index 7f083b5481c0838410594f8c857de7a0164e596b..e3f4d1ceb93e462f8465180471d4700c2e6ed585 100644 (file)
@@ -267,7 +267,7 @@ int     deliver_recipient(LOCAL_STATE state, USER_ATTR usr_attr)
     state.msg_attr.user = mystrdup(state.msg_attr.local);
     if (*var_rcpt_delim) {
        state.msg_attr.extension =
-           split_addr_internal(state.msg_attr.user, var_rcpt_delim);
+           split_addr(state.msg_attr.user, var_rcpt_delim);
        if (state.msg_attr.extension && strchr(state.msg_attr.extension, '/')) {
            msg_warn("%s: address with illegal extension: %s",
                     state.msg_attr.queue_id, state.msg_attr.local);
index dcc948ec0b15cfca4a5f226ef0b47bf4f5476967..26d9bd37ee03b1ac17110d1a103fbc191948289a 100644 (file)
@@ -1204,8 +1204,7 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
                   : strlen(STR(reply.recipient)));
            vstring_strncpy(queue_name, STR(reply.recipient), len);
            /* Remove the address extension from the recipient localpart. */
-           if (*var_rcpt_delim
-               && split_addr_internal(STR(queue_name), var_rcpt_delim))
+           if (*var_rcpt_delim && split_addr(STR(queue_name), var_rcpt_delim))
                vstring_truncate(queue_name, strlen(STR(queue_name)));
            /* Assume the recipient domain is equivalent to nexthop. */
            vstring_sprintf_append(queue_name, "@%s", STR(reply.nexthop));
index 649d83469ed0e4b0043bcba4a948130f8d363f20..dd995132d11b1a912edbfb51f74fb9f9354e8d25 100644 (file)
@@ -754,7 +754,7 @@ static ARGV *expand_argv(const char *service, char **argv,
                        msg_warn("no @ in recipient address: %s",
                                 rcpt_list->info[i].address);
                    if (*var_rcpt_delim)
-                       split_addr_internal(STR(buf), var_rcpt_delim);
+                       split_addr(STR(buf), var_rcpt_delim);
                    if (*STR(buf) == 0)
                        continue;
                    dict_update(PIPE_DICT_TABLE, PIPE_DICT_USER, STR(buf));
@@ -772,8 +772,7 @@ static ARGV *expand_argv(const char *service, char **argv,
                        msg_warn("no @ in recipient address: %s",
                                 rcpt_list->info[i].address);
                    if (*var_rcpt_delim == 0
-                       || (ext = split_addr_internal(STR(buf),
-                                                     var_rcpt_delim)) == 0)
+                       || (ext = split_addr(STR(buf), var_rcpt_delim)) == 0)
                        ext = "";               /* insert null arg */
                    dict_update(PIPE_DICT_TABLE, PIPE_DICT_EXTENSION, ext);
                }
index ce1a57d4a2476853e251a4e652418a2d22688ef8..495d52d93c65f26f400daa8caf47cab1d55c3332 100644 (file)
@@ -1263,8 +1263,7 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
                   : strlen(STR(reply.recipient)));
            vstring_strncpy(queue_name, STR(reply.recipient), len);
            /* Remove the address extension from the recipient localpart. */
-           if (*var_rcpt_delim
-               && split_addr_internal(STR(queue_name), var_rcpt_delim))
+           if (*var_rcpt_delim && split_addr(STR(queue_name), var_rcpt_delim))
                vstring_truncate(queue_name, strlen(STR(queue_name)));
            /* Assume the recipient domain is equivalent to nexthop. */
            vstring_sprintf_append(queue_name, "@%s", STR(reply.nexthop));
index f49b9122d66a681feb67c9def83485913a3a5dc6..745e4b1263f7dde56bb96719f2c07d143cb188fe 100644 (file)
@@ -80,7 +80,7 @@ int     smtp_map11_external(VSTRING *addr, MAPS *maps, int propagate)
     ARGV   *new_addr;
     const char *result;
 
-    if ((new_addr = mail_addr_map(maps, STR(addr), propagate,
+    if ((new_addr = mail_addr_map_opt(maps, STR(addr), propagate,
                  MAIL_ADDR_FORM_EXTERNAL, MAIL_ADDR_FORM_EXTERNAL)) != 0) {
        if (new_addr->argc > 1)
            msg_warn("multi-valued %s result for %s", maps->title, STR(addr));
index 328ad927532bbd038f0c6f91bea041fdeba149f3..89a3aab947667fa0517b9722daa1f9c6731e102c 100644 (file)
 #include <ehlo_mask.h>
 #include <maps.h>
 #include <tok822.h>
+#include <mail_addr_map.h>
 #include <ext_prop.h>
 #include <namadr_list.h>
 #include <match_parent_style.h>
index 257c72ac2ef3f69ddab52ee80b044c694e04010c..d2c1c3c59e9123c2b7f3a1e42e77e5c22d69c312 100644 (file)
@@ -184,7 +184,7 @@ int     smtp_sasl_passwd_lookup(SMTP_SESSION *session)
     smtp_sasl_passwd_map->error = 0;
     if ((smtp_mode
         && var_smtp_sender_auth && state->request->sender[0]
-        && (value = mail_addr_find_noconv(smtp_sasl_passwd_map,
+        && (value = mail_addr_find(smtp_sasl_passwd_map,
                                 state->request->sender, (char **) 0)) != 0)
        || (smtp_sasl_passwd_map->error == 0
            && (value = maps_find(smtp_sasl_passwd_map,
index 052f20f22b28646d61cb6abe79b39eea5665b2fb..f281cff79b7afbf461c72e2a59e75570ba384c99 100644 (file)
@@ -1155,8 +1155,7 @@ static const char *check_mail_addr_find(SMTPD_STATE *state,
 {
     const char *result;
 
-    if ((result = mail_addr_find_noconv(maps, key, ext)) != 0
-       || maps->error == 0)
+    if ((result = mail_addr_find(maps, key, ext)) != 0 || maps->error == 0)
        return (result);
     if (maps->error == DICT_ERR_RETRY)
        /* Warning is already logged. */
@@ -3187,7 +3186,7 @@ static int check_mail_access(SMTPD_STATE *state, const char *table,
     if (*var_rcpt_delim == 0) {
        bare_addr = 0;
     } else {
-       bare_addr = strip_addr_internal(addr, (char **) 0, var_rcpt_delim);
+       bare_addr = strip_addr(addr, (char **) 0, var_rcpt_delim);
     }
 
 #define CHECK_MAIL_ACCESS_RETURN(x) \
@@ -5196,8 +5195,8 @@ static int check_rcpt_maps(SMTPD_STATE *state, const char *sender,
      * Search the recipient lookup tables of the respective address class.
      * 
      * XXX Use the less expensive maps_find() (built-in case folding) instead of
-     * the baroque mail_addr_find(). But then we have to strip the domain and
-     * deal with address extensions ourselves.
+     * the baroque mail_addr_find(). But then we have to strip the domain
+     * and deal with address extensions ourselves.
      * 
      * XXX But that would break sites that use the virtual delivery agent for
      * local delivery, because the virtual delivery agent requires
index 69bd2c4fa27ebfe548cd5534446385f3aa8045b8..70c3fdcaaf92c8ad89685512c7df49d7f7c222cd 100644 (file)
@@ -560,10 +560,10 @@ static void resolve_addr(RES_CONTEXT *rp, char *sender, char *addr,
             */
            else {
                if (rp->snd_def_xp_info
-                   && (xport = mail_addr_find_noconv(rp->snd_def_xp_info,
+                   && (xport = mail_addr_find(rp->snd_def_xp_info,
                                            sender_key = (*sender ? sender :
                                               var_null_def_xport_maps_key),
-                                                     (char **) 0)) != 0) {
+                                              (char **) 0)) != 0) {
                    if (*xport == 0) {
                        msg_warn("%s: ignoring null lookup result for %s",
                                 rp->snd_def_xp_maps_name, sender_key);
@@ -589,10 +589,10 @@ static void resolve_addr(RES_CONTEXT *rp, char *sender, char *addr,
             * override the recipient domain.
             */
            if (rp->snd_relay_info
-               && (relay = mail_addr_find_noconv(rp->snd_relay_info,
-                                           sender_key = (*sender ? sender :
+               && (relay = mail_addr_find(rp->snd_relay_info,
+                                          sender_key = (*sender ? sender :
                                                   var_null_relay_maps_key),
-                                                 (char **) 0)) != 0) {
+                                          (char **) 0)) != 0) {
                if (*relay == 0) {
                    msg_warn("%s: ignoring null lookup result for %s",
                             rp->snd_relay_maps_name, sender_key);
@@ -716,8 +716,8 @@ static void resolve_addr(RES_CONTEXT *rp, char *sender, char *addr,
     if (relocated_maps != 0) {
        const char *newloc;
 
-       if ((newloc = mail_addr_find_noconv(relocated_maps, STR(nextrcpt),
-                                           IGNORE_ADDR_EXTENSION)) != 0) {
+       if ((newloc = mail_addr_find(relocated_maps, STR(nextrcpt),
+                                    IGNORE_ADDR_EXTENSION)) != 0) {
            vstring_strcpy(channel, MAIL_SERVICE_ERROR);
            /* 5.1.6 is the closest match, but not perfect. */
            vstring_sprintf(nexthop, "5.1.6 User has moved to %s", newloc);
index e9fc071c02dfe379370f7add129c3fca84424c6b..f270b8ddef1d1576be97f77ed5b7e4d54a60cc1c 100644 (file)
@@ -287,8 +287,8 @@ int     transport_lookup(TRANSPORT_INFO *tp, const char *addr,
      * look up the stripped address with the PARTIAL flag to avoid matching
      * partial lookup keys with regular expressions.
      */
-    if ((stripped_addr = strip_addr_internal(addr, DISCARD_EXTENSION,
-                                            var_rcpt_delim)) != 0) {
+    if ((stripped_addr = strip_addr(addr, DISCARD_EXTENSION,
+                                   var_rcpt_delim)) != 0) {
        found = find_transport_entry(tp, stripped_addr, rcpt_domain, PARTIAL,
                                     channel, nexthop);
 
index fce73b152193ea7869ae4fbed003153a5cc43e58..51e646de7af1e487d0902745030a39714249e540 100644 (file)
@@ -193,9 +193,8 @@ int     deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
      */
 #define IGNORE_EXTENSION ((char **) 0)
 
-    mailbox_res = mail_addr_find_noconv(virtual_mailbox_maps,
-                                       state.msg_attr.user,
-                                       IGNORE_EXTENSION);
+    mailbox_res = mail_addr_find(virtual_mailbox_maps, state.msg_attr.user,
+                                IGNORE_EXTENSION);
     if (mailbox_res == 0) {
        if (virtual_mailbox_maps->error == 0)
            return (NO);
@@ -214,8 +213,8 @@ int     deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
     /*
      * Look up the mailbox owner rights. Defer in case of trouble.
      */
-    uid_res = mail_addr_find_noconv(virtual_uid_maps, state.msg_attr.user,
-                                   IGNORE_EXTENSION);
+    uid_res = mail_addr_find(virtual_uid_maps, state.msg_attr.user,
+                            IGNORE_EXTENSION);
     if (uid_res == 0) {
        msg_warn("recipient %s: not found in %s",
                 state.msg_attr.user, virtual_uid_maps->title);
@@ -237,8 +236,8 @@ int     deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
     /*
      * Look up the mailbox group rights. Defer in case of trouble.
      */
-    gid_res = mail_addr_find_noconv(virtual_gid_maps, state.msg_attr.user,
-                                   IGNORE_EXTENSION);
+    gid_res = mail_addr_find(virtual_gid_maps, state.msg_attr.user,
+                            IGNORE_EXTENSION);
     if (gid_res == 0) {
        msg_warn("recipient %s: not found in %s",
                 state.msg_attr.user, virtual_gid_maps->title);