]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.3-20050923
authorWietse Venema <wietse@porcupine.org>
Fri, 23 Sep 2005 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:31:29 +0000 (06:31 +0000)
29 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/conf/aliases
postfix/html/aliases.5.html
postfix/html/local.8.html
postfix/html/postconf.5.html
postfix/html/qmqp-source.1.html
postfix/html/smtp-source.1.html
postfix/man/man1/qmqp-source.1
postfix/man/man1/smtp-source.1
postfix/man/man5/aliases.5
postfix/man/man5/postconf.5
postfix/man/man8/local.8
postfix/mantools/postlink
postfix/proto/aliases
postfix/proto/postconf.proto
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/lmtp/lmtp_sasl_glue.c
postfix/src/local/alias.c
postfix/src/local/dotforward.c
postfix/src/local/local.c
postfix/src/local/mailbox.c
postfix/src/local/maildir.c
postfix/src/smtp/smtp_sasl_glue.c
postfix/src/smtpd/smtpd_sasl_glue.c
postfix/src/smtpstone/Makefile.in
postfix/src/smtpstone/qmqp-source.c
postfix/src/smtpstone/smtp-source.c

index d88540f36294a9a47622103ece0b1014d9607050..7378cf24f68f366103116bea9cdd8719528d7a23 100644 (file)
@@ -11133,7 +11133,31 @@ Apologies for any names omitted.
 
        Update: common code factored out into db_common.c, and
        adoption of Liviu Daia's connection aware MySQL quoting.
-       Files: dict_ldap.c, dict_mysql.c, dict_pgsql.c, db_common.c.
+       Patch by Victor Duchovni.  Files: dict_ldap.c, dict_mysql.c,
+       dict_pgsql.c, db_common.c.
+
+20050923
+
+       Safety: don't update the local(8) delivery agent's idea of
+       the Delivered-To: address while expanding aliases or .forward
+       files. When an alias or .forward file changes the Delivered-To:
+       address, it ties up one queue file and one cleanup process
+       instance while mail is being forwarded.  To get the old
+       behavior, specify "frozen_delivered_to = no".  Problem
+       reported by Michael Tokarev, but found independently by
+       others.  Files: local/local.c, local/aliases.c, local/dotforward.c,
+       local/mailbox.c, local/maildir.c.
+
+       Cleanup: while expanding a local(8) alias that has an owner
+       alias, don't reset the owner-alias information when recursing
+       into an alias that has no owner alias. This produces better
+       error reports when delivering mail to nested aliases that
+       have an owner alias only at the top level.  To get the old
+       behavior, specify "sticky_owner_alias = no".  Problem
+       reported by Victor Duchovni. File: local/alias.c.
+
+       Logging: additional SASL debug logging by Andreas Winkelmann.
+       Files: */*sasl_glue.c.
 
 Open problems:
 
index e64f5dfe34173a688bec7da1478006b5101d1cd0..ce56ca140d23ee21c7f2c43d8c217eae6373a74e 100644 (file)
@@ -17,6 +17,22 @@ Incompatibility with Postfix 2.1 and earlier
 If you upgrade from Postfix 2.1 or earlier, read RELEASE_NOTES-2.2
 before proceeding.
 
+Incompatibility with snapshot 20050923
+======================================
+
+The Postfix local(8) delivery agent no longer updates its idea of
+the Delivered-To: address while it expands aliases or .forward
+files. With deeply nested aliases or .forward files, this can greatly
+reduce the number of queue files and cleanup process instances. To
+get the earlier behavior, specify "frozen_delivered_to = no".
+
+While expanding an alias that has an owner alias, the Postfix
+local(8) delivery agent no longer resets the owner information when
+it expands a subordinate alias that has no owner alias.  This
+produces better error reporting with nested aliases that have an
+owner alias only at the top level. To get the earlier behavior,
+specify "sticky_owner_alias = no".
+
 Incompatibility with snapshot 20050828
 ======================================
 
index 6738a155da4baadbbc227f8ce925c4fe2fc4d6a9..ef9cca1651af77d1ed8ef2d970ad4e3bd58d2a4d 100644 (file)
@@ -36,7 +36,7 @@ abuse:                postmaster
 # trap decode to catch security attacks
 decode:                root
 
-# ALIASES(5)                                             ALIASES(5)
+# ALIASES(5)                                                          ALIASES(5)
 # 
 # NAME
 #        aliases - Postfix local alias database format
@@ -87,38 +87,39 @@ decode:             root
 # 
 #        In addition, when an alias exists for owner-name, delivery
 #        diagnostics  are  directed  to that address, instead of to
-#        the originator.  This is typically used to direct delivery
-#        errors  to the owner of a mailing list, who is in a better
-#        position to deal with mailing list delivery problems  than
-#        the originator of the undelivered mail.
+#        the originator of the message.  This is typically used  to
+#        direct  delivery  errors  to  the  maintainer of a mailing
+#        list, who is in a better position  to  deal  with  mailing
+#        list delivery problems than the originator of the undeliv-
+#        ered mail.
 # 
 #        The value contains one or more of the following:
 # 
 #        address
-#               Mail  is  forwarded to address, which is compatible
+#               Mail is forwarded to address, which  is  compatible
 #               with the RFC 822 standard.
 # 
 #        /file/name
-#               Mail is appended to /file/name.  See  local(8)  for
-#               details  of delivery to file.  Delivery is not lim-
-#               ited to regular files.  For example, to dispose  of
+#               Mail  is  appended  to /file/name. See local(8) for
+#               details of delivery to file.  Delivery is not  lim-
+#               ited  to regular files.  For example, to dispose of
 #               unwanted mail, deflect it to /dev/null.
 # 
 #        |command
-#               Mail  is  piped into command. Commands that contain
-#               special characters, such as whitespace,  should  be
-#               enclosed  between  double  quotes. See local(8) for
+#               Mail is piped into command. Commands  that  contain
+#               special  characters,  such as whitespace, should be
+#               enclosed between double quotes.  See  local(8)  for
 #               details of delivery to command.
 # 
 #               When the command fails, a limited amount of command
-#               output  is  mailed  back  to  the sender.  The file
-#               /usr/include/sysexits.h defines the  expected  exit
-#               status  codes. For example, use |"exit 67" to simu-
-#               late a "user  unknown"  error,  and  |"exit  0"  to
+#               output is mailed back  to  the  sender.   The  file
+#               /usr/include/sysexits.h  defines  the expected exit
+#               status codes. For example, use |"exit 67" to  simu-
+#               late  a  "user  unknown"  error,  and  |"exit 0" to
 #               implement an expensive black hole.
 # 
 #        :include:/file/name
-#               Mail  is  sent  to  the  destinations listed in the
+#               Mail is sent to  the  destinations  listed  in  the
 #               named file.  Lines in :include: files have the same
 #               syntax as the right-hand side of alias entries.
 # 
@@ -130,67 +131,82 @@ decode:           root
 # 
 # ADDRESS EXTENSION
 #        When alias database search fails, and the recipient local-
-#        part contains  the  optional  recipient  delimiter  (e.g.,
-#        user+foo),  the  search  is  repeated  for  the unextended
+#        part  contains  the  optional  recipient  delimiter (e.g.,
+#        user+foo), the  search  is  repeated  for  the  unextended
 #        address (e.g., user).
 # 
-#        The  propagate_unmatched_extensions   parameter   controls
-#        whether  an  unmatched  address extension (+foo) is propa-
+#        The   propagate_unmatched_extensions   parameter  controls
+#        whether an unmatched address extension  (+foo)  is  propa-
 #        gated to the result of table lookup.
 # 
 # SECURITY
-#        The local(8) delivery agent disallows  regular  expression
-#        substitution  of $1 etc. in alias_maps, because that would
+#        The  local(8)  delivery agent disallows regular expression
+#        substitution of $1 etc. in alias_maps, because that  would
 #        open a security hole.
 # 
-#        The local(8) delivery agent will silently ignore  requests
-#        to  use  the proxymap(8) server within alias_maps. Instead
-#        it will open the table directly.  Before  Postfix  version
-#        2.2,  the  local(8)  delivery  agent will terminate with a
+#        The  local(8) delivery agent will silently ignore requests
+#        to use the proxymap(8) server within  alias_maps.  Instead
+#        it  will  open the table directly.  Before Postfix version
+#        2.2, the local(8) delivery agent  will  terminate  with  a
 #        fatal error.
 # 
 # CONFIGURATION PARAMETERS
-#        The following main.cf parameters are especially  relevant.
-#        The  text  below  provides  only  a parameter summary. See
+#        The  following main.cf parameters are especially relevant.
+#        The text below provides  only  a  parameter  summary.  See
 #        postconf(5) for more details including examples.
 # 
 #        alias_database
-#               List of alias databases that  are  updated  by  the
+#               List  of  alias  databases  that are updated by the
 #               newaliases(1) command.
 # 
 #        alias_maps
-#               List  of  alias  databases  queried by the local(8)
+#               List of alias databases  queried  by  the  local(8)
 #               delivery agent.
 # 
 #        allow_mail_to_commands
-#               Restrict the usage of  mail  delivery  to  external
+#               Restrict  the  usage  of  mail delivery to external
 #               command.
 # 
 #        allow_mail_to_files
-#               Restrict  the  usage  of  mail delivery to external
+#               Restrict the usage of  mail  delivery  to  external
 #               file.
 # 
 #        expand_owner_alias
 #               When delivering to an alias that has an owner- com-
-#               panion  alias,  set  the envelope sender address to
-#               the right-hand side of  the  owner  alias,  instead
+#               panion alias, set the envelope  sender  address  to
+#               the  right-hand  side  of  the owner alias, instead
 #               using of the left-hand side address.
 # 
 #        propagate_unmatched_extensions
-#               A  list  of  address rewriting or forwarding mecha-
-#               nisms that propagate an address extension from  the
-#               original  address  to  the  result. Specify zero or
-#               more  of  canonical,   virtual,   alias,   forward,
+#               A list of address rewriting  or  forwarding  mecha-
+#               nisms  that propagate an address extension from the
+#               original address to the  result.  Specify  zero  or
+#               more   of   canonical,   virtual,  alias,  forward,
 #               include, or generic.
 # 
 #        owner_request_special
-#               Give  special treatment to owner-listname and list-
+#               Give special treatment to owner-listname and  list-
 #               name-request addresses.
 # 
 #        recipient_delimiter
-#               Delimiter that separates  recipients  from  address
+#               Delimiter  that  separates  recipients from address
 #               extensions.
 # 
+#        Available in Postfix version 2.3 and later:
+# 
+#        frozen_delivered_to
+#               Update the local(8) delivery agent's  Delivered-To:
+#               address  (see  prepend_delivered_header) only once,
+#               at the start of  a  delivery;  do  not  update  the
+#               Delivered-To:  address  while  expanding aliases or
+#               .forward files.
+# 
+#        sticky_owner_alias
+#               When expanding a local(8) alias that has  an  owner
+#               alias  (see  owner-name  discussion above), use the
+#               owner information even when the expansion invokes a
+#               subordinate alias that has no owner alias.
+# 
 # STANDARDS
 #        RFC 822 (ARPA Internet Text Messages)
 # 
@@ -215,4 +231,4 @@ decode:             root
 #        P.O. Box 704
 #        Yorktown Heights, NY 10598, USA
 # 
-#                                                        ALIASES(5)
+#                                                                     ALIASES(5)
index bc8a0cd3feb91267abf981254424d8555e03f00e..ee57e794fb1f2ec06e7d4efd54768132340e5ff0 100644 (file)
@@ -55,38 +55,39 @@ ALIASES(5)                                                          ALIASES(5)
 
        In addition, when an alias exists for <b>owner-</b><i>name</i>, delivery
        diagnostics  are  directed  to that address, instead of to
-       the originator.  This is typically used to direct delivery
-       errors  to the owner of a mailing list, who is in a better
-       position to deal with mailing list delivery problems  than
-       the originator of the undelivered mail.
+       the originator of the message.  This is typically used  to
+       direct  delivery  errors  to  the  maintainer of a mailing
+       list, who is in a better position  to  deal  with  mailing
+       list delivery problems than the originator of the undeliv-
+       ered mail.
 
        The <i>value</i> contains one or more of the following:
 
        <i>address</i>
-              Mail  is  forwarded to <i>address</i>, which is compatible
+              Mail is forwarded to <i>address</i>, which  is  compatible
               with the <a href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a> standard.
 
        <i>/file/name</i>
-              Mail is appended to <i>/file/name</i>.  See  <a href="local.8.html"><b>local</b>(8)</a>  for
-              details  of delivery to file.  Delivery is not lim-
-              ited to regular files.  For example, to dispose  of
+              Mail  is  appended  to <i>/file/name</i>. See <a href="local.8.html"><b>local</b>(8)</a> for
+              details of delivery to file.  Delivery is not  lim-
+              ited  to regular files.  For example, to dispose of
               unwanted mail, deflect it to <b>/dev/null</b>.
 
        |<i>command</i>
-              Mail  is  piped into <i>command</i>. Commands that contain
-              special characters, such as whitespace,  should  be
-              enclosed  between  double  quotes. See <a href="local.8.html"><b>local</b>(8)</a> for
+              Mail is piped into <i>command</i>. Commands  that  contain
+              special  characters,  such as whitespace, should be
+              enclosed between double quotes.  See  <a href="local.8.html"><b>local</b>(8)</a>  for
               details of delivery to command.
 
               When the command fails, a limited amount of command
-              output  is  mailed  back  to  the sender.  The file
-              <b>/usr/include/sysexits.h</b> defines the  expected  exit
-              status  codes. For example, use <b>|"exit 67"</b> to simu-
-              late a "user  unknown"  error,  and  <b>|"exit  0"</b>  to
+              output is mailed back  to  the  sender.   The  file
+              <b>/usr/include/sysexits.h</b>  defines  the expected exit
+              status codes. For example, use <b>|"exit 67"</b> to  simu-
+              late  a  "user  unknown"  error,  and  <b>|"exit 0"</b> to
               implement an expensive black hole.
 
        <b>:include:</b><i>/file/name</i>
-              Mail  is  sent  to  the  destinations listed in the
+              Mail is sent to  the  destinations  listed  in  the
               named file.  Lines in <b>:include:</b> files have the same
               syntax as the right-hand side of alias entries.
 
@@ -98,67 +99,82 @@ ALIASES(5)                                                          ALIASES(5)
 
 <b>ADDRESS EXTENSION</b>
        When alias database search fails, and the recipient local-
-       part contains  the  optional  recipient  delimiter  (e.g.,
-       <i>user+foo</i>),  the  search  is  repeated  for  the unextended
+       part  contains  the  optional  recipient  delimiter (e.g.,
+       <i>user+foo</i>), the  search  is  repeated  for  the  unextended
        address (e.g., <i>user</i>).
 
-       The  <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b>   parameter   controls
-       whether  an  unmatched  address extension (<i>+foo</i>) is propa-
+       The   <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b>   parameter  controls
+       whether an unmatched address extension  (<i>+foo</i>)  is  propa-
        gated to the result of table lookup.
 
 <b>SECURITY</b>
-       The <a href="local.8.html"><b>local</b>(8)</a> delivery agent disallows  regular  expression
-       substitution  of $1 etc. in <b><a href="postconf.5.html#alias_maps">alias_maps</a></b>, because that would
+       The  <a href="local.8.html"><b>local</b>(8)</a>  delivery agent disallows regular expression
+       substitution of $1 etc. in <b><a href="postconf.5.html#alias_maps">alias_maps</a></b>, because that  would
        open a security hole.
 
-       The <a href="local.8.html"><b>local</b>(8)</a> delivery agent will silently ignore  requests
-       to  use  the <a href="proxymap.8.html"><b>proxymap</b>(8)</a> server within <b><a href="postconf.5.html#alias_maps">alias_maps</a></b>. Instead
-       it will open the table directly.  Before  Postfix  version
-       2.2,  the  <a href="local.8.html"><b>local</b>(8)</a>  delivery  agent will terminate with a
+       The  <a href="local.8.html"><b>local</b>(8)</a> delivery agent will silently ignore requests
+       to use the <a href="proxymap.8.html"><b>proxymap</b>(8)</a> server within  <b><a href="postconf.5.html#alias_maps">alias_maps</a></b>.  Instead
+       it  will  open the table directly.  Before Postfix version
+       2.2, the <a href="local.8.html"><b>local</b>(8)</a> delivery agent  will  terminate  with  a
        fatal error.
 
 <b>CONFIGURATION PARAMETERS</b>
-       The following <b>main.cf</b> parameters are especially  relevant.
-       The  text  below  provides  only  a parameter summary. See
+       The  following <b>main.cf</b> parameters are especially relevant.
+       The text below provides  only  a  parameter  summary.  See
        <a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including examples.
 
        <b><a href="postconf.5.html#alias_database">alias_database</a></b>
-              List of alias databases that  are  updated  by  the
+              List  of  alias  databases  that are updated by the
               <a href="newaliases.1.html"><b>newaliases</b>(1)</a> command.
 
        <b><a href="postconf.5.html#alias_maps">alias_maps</a></b>
-              List  of  alias  databases  queried by the <a href="local.8.html"><b>local</b>(8)</a>
+              List of alias databases  queried  by  the  <a href="local.8.html"><b>local</b>(8)</a>
               delivery agent.
 
        <b><a href="postconf.5.html#allow_mail_to_commands">allow_mail_to_commands</a></b>
-              Restrict the usage of  mail  delivery  to  external
+              Restrict  the  usage  of  mail delivery to external
               command.
 
        <b><a href="postconf.5.html#allow_mail_to_files">allow_mail_to_files</a></b>
-              Restrict  the  usage  of  mail delivery to external
+              Restrict the usage of  mail  delivery  to  external
               file.
 
        <b><a href="postconf.5.html#expand_owner_alias">expand_owner_alias</a></b>
               When delivering to an alias that has an <b>owner-</b> com-
-              panion  alias,  set  the envelope sender address to
-              the right-hand side of  the  owner  alias,  instead
+              panion alias, set the envelope  sender  address  to
+              the  right-hand  side  of  the owner alias, instead
               using of the left-hand side address.
 
        <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b>
-              A  list  of  address rewriting or forwarding mecha-
-              nisms that propagate an address extension from  the
-              original  address  to  the  result. Specify zero or
-              more  of  <b>canonical</b>,   <b>virtual</b>,   <b>alias</b>,   <b>forward</b>,
+              A list of address rewriting  or  forwarding  mecha-
+              nisms  that propagate an address extension from the
+              original address to the  result.  Specify  zero  or
+              more   of   <b>canonical</b>,   <b>virtual</b>,  <b>alias</b>,  <b>forward</b>,
               <b>include</b>, or <b>generic</b>.
 
        <b><a href="postconf.5.html#owner_request_special">owner_request_special</a></b>
-              Give  special treatment to <b>owner-</b><i>listname</i> and <i>list-</i>
+              Give special treatment to <b>owner-</b><i>listname</i> and  <i>list-</i>
               <i>name</i><b>-request</b> addresses.
 
        <b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a></b>
-              Delimiter that separates  recipients  from  address
+              Delimiter  that  separates  recipients from address
               extensions.
 
+       Available in Postfix version 2.3 and later:
+
+       <b><a href="postconf.5.html#frozen_delivered_to">frozen_delivered_to</a></b>
+              Update the <a href="local.8.html">local(8)</a> delivery agent's  Delivered-To:
+              address  (see  <a href="postconf.5.html#prepend_delivered_header">prepend_delivered_header</a>) only once,
+              at the start of  a  delivery;  do  not  update  the
+              Delivered-To:  address  while  expanding aliases or
+              .forward files.
+
+       <b><a href="postconf.5.html#sticky_owner_alias">sticky_owner_alias</a></b>
+              When expanding a <a href="local.8.html">local(8)</a> alias that has  an  owner
+              alias  (see  owner-<i>name</i>  discussion above), use the
+              owner information even when the expansion invokes a
+              subordinate alias that has no owner alias.
+
 <b>STANDARDS</b>
        <a href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a> (ARPA Internet Text Messages)
 
index 35990ec069b749b0a4cdba6c8e3490744687a48e..5bb9b37a7c3138c958d9ded82c9a73a3f712254c 100644 (file)
@@ -377,6 +377,22 @@ LOCAL(8)                                                              LOCAL(8)
        <b><a href="postconf.5.html#sun_mailtool_compatibility">sun_mailtool_compatibility</a> (no)</b>
               Obsolete SUN mailtool compatibility feature.
 
+       Available in Postfix version 2.3 and later:
+
+       <b><a href="postconf.5.html#frozen_delivered_to">frozen_delivered_to</a> (yes)</b>
+              Update the <a href="local.8.html"><b>local</b>(8)</a> delivery agent's  idea  of  the
+              Delivered-To:     address    (see    prepend_deliv-
+              ered_header) only once, at the start of a  delivery
+              attempt;  do  not  update the Delivered-To: address
+              while expanding aliases or .forward files.
+
+       <b><a href="postconf.5.html#sticky_owner_alias">sticky_owner_alias</a> (yes)</b>
+              When expanding a <a href="local.8.html"><b>local</b>(8)</a> alias that has  an  owner
+              alias  (see  owner-<i>name</i>  discussion in <a href="aliases.5.html"><b>aliases</b>(5)</a>),
+              use the owner information even when  the  expansion
+              invokes  a  subordinate  alias  that  has  no owner
+              alias.
+
 <b>DELIVERY METHOD CONTROLS</b>
        The precedence of <a href="local.8.html"><b>local</b>(8)</a> delivery methods from  high  to
        low  is: aliases, .forward files, <a href="postconf.5.html#mailbox_transport">mailbox_transport</a>, <a href="postconf.5.html#mailbox_command_maps">mail</a>-
@@ -536,22 +552,23 @@ LOCAL(8)                                                              LOCAL(8)
        <b><a href="postconf.5.html#prepend_delivered_header">prepend_delivered_header</a> (command, file, forward)</b>
               The  message  delivery  contexts  where the Postfix
               <a href="local.8.html"><b>local</b>(8)</a> delivery agent  prepends  a  Delivered-To:
-              message header.
+              message  header  with the address that the mail was
+              delivered to.
 
        <b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
-              The  process  ID  of  a  Postfix  command or daemon
+              The process ID  of  a  Postfix  command  or  daemon
               process.
 
        <b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
-              The process name of a  Postfix  command  or  daemon
+              The  process  name  of  a Postfix command or daemon
               process.
 
        <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a> (canonical, virtual)</b>
-              What  address  lookup tables copy an address exten-
+              What address lookup tables copy an  address  exten-
               sion from the lookup key to the lookup result.
 
        <b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
-              The location of the Postfix top-level queue  direc-
+              The  location of the Postfix top-level queue direc-
               tory.
 
        <b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> (empty)</b>
@@ -559,15 +576,15 @@ LOCAL(8)                                                              LOCAL(8)
               sions (user+foo).
 
        <b><a href="postconf.5.html#require_home_directory">require_home_directory</a> (no)</b>
-              Whether or not a <a href="local.8.html"><b>local</b>(8)</a> recipient's  home  direc-
-              tory  must exist before mail delivery is attempted.
+              Whether  or  not a <a href="local.8.html"><b>local</b>(8)</a> recipient's home direc-
+              tory must exist before mail delivery is  attempted.
 
        <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
               The syslog facility of Postfix logging.
 
        <b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
-              The mail system  name  that  is  prepended  to  the
-              process  name  in  syslog  records, so that "smtpd"
+              The  mail  system  name  that  is  prepended to the
+              process name in syslog  records,  so  that  "smtpd"
               becomes, for example, "postfix/smtpd".
 
 <b>FILES</b>
@@ -587,14 +604,14 @@ LOCAL(8)                                                              LOCAL(8)
        syslogd(8), system logging
 
 <b>LICENSE</b>
-       The Secure Mailer license must be  distributed  with  this
+       The  Secure  Mailer  license must be distributed with this
        software.
 
 <b>HISTORY</b>
        The <b>Delivered-To:</b> message header appears in the <b>qmail</b> sys-
        tem by Daniel Bernstein.
 
-       The <i>maildir</i> structure  appears  in  the  <b>qmail</b>  system  by
+       The  <i>maildir</i>  structure  appears  in  the  <b>qmail</b> system by
        Daniel Bernstein.
 
 <b>AUTHOR(S)</b>
index f3ed038268d119568bc450f67f5c70738b08d35b..bccd8ed6586c2f353dd8a0411742cab76b02aaca 100644 (file)
@@ -2474,6 +2474,24 @@ Examples:
 </pre>
 
 
+</DD>
+
+<DT><b><a name="frozen_delivered_to">frozen_delivered_to</a>
+(default: yes)</b></DT><DD>
+
+<p> Update the <a href="local.8.html">local(8)</a> delivery agent's idea of the Delivered-To:
+address (see <a href="postconf.5.html#prepend_delivered_header">prepend_delivered_header</a>) only once, at the start of
+a delivery attempt; do not update the Delivered-To: address while
+expanding aliases or .forward files. </p>
+
+<p> This feature is available in Postfix 2.3 and later. With older
+Postfix releases, the behavior is as if this parameter is set to
+"no". The old setting can be expensive with deeply nested aliases
+or .forward files. When an alias or .forward file changes the
+Delivered-To: address, it ties up one queue file and one cleanup
+process instance while mail is being forwarded.  </p>
+
+
 </DD>
 
 <DT><b><a name="hash_queue_depth">hash_queue_depth</a>
@@ -4636,10 +4654,10 @@ This feature is available in Postfix 2.0 and later.
 <DT><b><a name="prepend_delivered_header">prepend_delivered_header</a>
 (default: command, file, forward)</b></DT><DD>
 
-<p>
-The message delivery contexts where the Postfix <a href="local.8.html">local(8)</a> delivery
-agent prepends a Delivered-To:  message header.
-</p>
+<p> The message delivery contexts where the Postfix <a href="local.8.html">local(8)</a> delivery
+agent prepends a Delivered-To:  message header with the address
+that the mail was delivered to. This information is used for mail
+delivery loop detection.  </p>
 
 <p>
 By default, the Postfix local delivery agent prepends a Delivered-To:
@@ -9131,6 +9149,22 @@ The default time unit is s (seconds).
 </p>
 
 
+</DD>
+
+<DT><b><a name="sticky_owner_alias">sticky_owner_alias</a>
+(default: yes)</b></DT><DD>
+
+<p> When expanding a <a href="local.8.html">local(8)</a> alias that has an owner alias (see
+owner-<i>name</i> discussion in <a href="aliases.5.html">aliases(5)</a>), use the owner information
+even when the expansion invokes a subordinate alias that has no
+owner alias.  </p>
+
+<p> This feature is available in Postfix 2.3 and later. With older
+Postfix releases, the behavior is as if this parameter is set to
+"no". The old setting provides poorer error reporting with nested
+aliases that only have an owner alias at the top level.  </p>
+
+
 </DD>
 
 <DT><b><a name="strict_7bit_headers">strict_7bit_headers</a>
index e92b801f99815252e7d741513389404e55ca42e2..27e8fa47bf03614c8363dbe04abe14041908348b 100644 (file)
@@ -51,6 +51,11 @@ QMQP-SOURCE(1)                                                  QMQP-SOURCE(1)
        <b>-m</b> <i>message</i><b>_</b><i>count</i>
               Send the specified number of messages (default: 1).
 
+       <b>-M</b> <i><a href="postconf.5.html#myhostname">myhostname</a></i>
+              Use  the  specified  hostname  or  [address] in the
+              default sender and recipient addresses, instead  of
+              the machine hostname.
+
        <b>-r</b> <i>recipient</i><b>_</b><i>count</i>
               Send  the specified number of recipients per trans-
               action (default: 1).  Recipient names are generated
@@ -68,6 +73,9 @@ QMQP-SOURCE(1)                                                  QMQP-SOURCE(1)
               between messages.  Suspending one thread  does  not
               affect other delivery threads.
 
+       <b>-v</b>     Make  the  program more verbose, for debugging pur-
+              poses.
+
        <b>-w</b> <i>interval</i>
               Wait a fixed time between messages.  Suspending one
               thread does not affect other delivery threads.
@@ -76,7 +84,7 @@ QMQP-SOURCE(1)                                                  QMQP-SOURCE(1)
        <a href="qmqp-sink.1.html">qmqp-sink(1)</a>, QMQP message dump
 
 <b>LICENSE</b>
-       The Secure Mailer license must be  distributed  with  this
+       The  Secure  Mailer  license must be distributed with this
        software.
 
 <b>AUTHOR(S)</b>
index 80abf7ffefa7c96702eb5d62d77955bcfc5219e0..19e882d661523c3e6eeb3dfdee95917cb32077bb 100644 (file)
@@ -48,11 +48,8 @@ SMTP-SOURCE(1)                                                  SMTP-SOURCE(1)
               Use  the   specified   sender   address   (default:
               &lt;foo@<a href="postconf.5.html#myhostname">myhostname</a>&gt;).
 
-       <b>-o</b>     Old  mode:  don't send HELO, and don't send message
-              headers.
-
        <b>-l</b> <i>length</i>
-              Send <i>length</i> bytes as message  payload.  The  length
+              Send  <i>length</i>  bytes  as message payload. The length
               does not include message headers.
 
        <b>-L</b>     Speak LMTP rather than SMTP.
@@ -60,13 +57,21 @@ SMTP-SOURCE(1)                                                  SMTP-SOURCE(1)
        <b>-m</b> <i>message</i><b>_</b><i>count</i>
               Send the specified number of messages (default: 1).
 
-       <b>-N</b>     Prepend a non-repeating  sequence  number  to  each
-              recipient  address. This avoids the artificial 100%
-              hit rate in the resolve and rewrite  client  caches
-              and  exercises  the  trivial-rewrite daemon, better
-              approximating Postfix performance  under  real-life
+       <b>-M</b> <i><a href="postconf.5.html#myhostname">myhostname</a></i>
+              Use the specified hostname or [address] in the HELO
+              command and in the  default  sender  and  recipient
+              addresses, instead of the machine hostname.
+
+       <b>-N</b>     Prepend  a  non-repeating  sequence  number to each
+              recipient address. This avoids the artificial  100%
+              hit  rate  in the resolve and rewrite client caches
+              and exercises the  trivial-rewrite  daemon,  better
+              approximating  Postfix  performance under real-life
               work-loads.
 
+       <b>-o</b>     Old mode: don't send HELO, and don't  send  message
+              headers.
+
        <b>-r</b> <i>recipient</i><b>_</b><i>count</i>
               Send  the specified number of recipients per trans-
               action (default: 1).  Recipient names are generated
@@ -88,12 +93,15 @@ SMTP-SOURCE(1)                                                  SMTP-SOURCE(1)
               between  messages.   Suspending one thread does not
               affect other delivery threads.
 
+       <b>-v</b>     Make the program more verbose, for  debugging  pur-
+              poses.
+
        <b>-w</b> <i>interval</i>
               Wait a fixed time between messages.  Suspending one
               thread does not affect other delivery threads.
 
        [<b>inet:</b>]<i>host</i>[:<i>port</i>]
-              Connect  via  TCP  to  host  <i>host</i>,  port  <i>port</i>. The
+              Connect via  TCP  to  host  <i>host</i>,  port  <i>port</i>.  The
               default port is <b>smtp</b>.
 
        <b>unix:</b><i>pathname</i>
@@ -106,7 +114,7 @@ SMTP-SOURCE(1)                                                  SMTP-SOURCE(1)
        <a href="smtp-sink.1.html">smtp-sink(1)</a>, SMTP/LMTP message dump
 
 <b>LICENSE</b>
-       The Secure Mailer license must be  distributed  with  this
+       The  Secure  Mailer  license must be distributed with this
        software.
 
 <b>AUTHOR(S)</b>
index 31455c45db2e58274b6b28918934c82cdc3f3294..668c595a8b74dd5a1ffbf092ce35d14b71ecd886 100644 (file)
@@ -43,6 +43,10 @@ Send \fIlength\fR bytes as message payload. The length
 includes the message headers.
 .IP "\fB-m \fImessage_count\fR"
 Send the specified number of messages (default: 1).
+.IP "\fB-M \fImyhostname\fR"
+Use the specified hostname or [address] in the default
+sender and recipient addresses, instead of the machine
+hostname.
 .IP "\fB-r \fIrecipient_count\fR"
 Send the specified number of recipients per transaction (default: 1).
 Recipient names are generated by prepending a number to the
@@ -54,6 +58,8 @@ Use the specified recipient address (default: <foo@myhostname>).
 .IP "\fB-R \fIinterval\fR"
 Wait for a random period of time 0 <= n <= interval between messages.
 Suspending one thread does not affect other delivery threads.
+.IP \fB-v\fR
+Make the program more verbose, for debugging purposes.
 .IP "\fB-w \fIinterval\fR"
 Wait a fixed time between messages.
 Suspending one thread does not affect other delivery threads.
index 2b588bdd27338f3a93bfa5652a435873a655ed04..594363cf7d84645a63096115e5179501bb423f04 100644 (file)
@@ -43,8 +43,6 @@ Don't disconnect after sending a message; send the next
 message over the same connection.
 .IP "\fB-f \fIfrom\fR"
 Use the specified sender address (default: <foo@myhostname>).
-.IP \fB-o\fR
-Old mode: don't send HELO, and don't send message headers.
 .IP "\fB-l \fIlength\fR"
 Send \fIlength\fR bytes as message payload. The length does not
 include message headers.
@@ -52,12 +50,18 @@ include message headers.
 Speak LMTP rather than SMTP.
 .IP "\fB-m \fImessage_count\fR"
 Send the specified number of messages (default: 1).
+.IP "\fB-M \fImyhostname\fR"
+Use the specified hostname or [address] in the HELO command
+and in the default sender and recipient addresses, instead
+of the machine hostname.
 .IP "\fB-N\fR"
 Prepend a non-repeating sequence number to each recipient
 address. This avoids the artificial 100% hit rate in the
 resolve and rewrite client caches and exercises the
 trivial-rewrite daemon, better approximating Postfix
 performance under real-life work-loads.
+.IP \fB-o\fR
+Old mode: don't send HELO, and don't send message headers.
 .IP "\fB-r \fIrecipient_count\fR"
 Send the specified number of recipients per transaction (default: 1).
 Recipient names are generated by prepending a number to the
@@ -71,6 +75,8 @@ Use the specified recipient address (default: <foo@myhostname>).
 .IP "\fB-R \fIinterval\fR"
 Wait for a random period of time 0 <= n <= interval between messages.
 Suspending one thread does not affect other delivery threads.
+.IP \fB-v\fR
+Make the program more verbose, for debugging purposes.
 .IP "\fB-w \fIinterval\fR"
 Wait a fixed time between messages.
 Suspending one thread does not affect other delivery threads.
index bd70ee64bf01e5c74fd74e71c9972ff9eae28d16..5479068757e5da1eaa8fac2235ecdf55f969ce3c 100644 (file)
@@ -52,8 +52,9 @@ such as whitespace, `#', `:', or `@'. The \fIname\fR is folded to
 lowercase, in order to make database lookups case insensitive.
 .PP
 In addition, when an alias exists for \fBowner-\fIname\fR, delivery
-diagnostics are directed to that address, instead of to the originator.
-This is typically used to direct delivery errors to the owner of
+diagnostics are directed to that address, instead of to the originator
+of the message.
+This is typically used to direct delivery errors to the maintainer of
 a mailing list, who is in a better position to deal with mailing
 list delivery problems than the originator of the undelivered mail.
 .PP
@@ -145,6 +146,18 @@ Give special treatment to \fBowner-\fIlistname\fR and
 addresses.
 .IP \fBrecipient_delimiter\fR
 Delimiter that separates recipients from address extensions.
+.PP
+Available in Postfix version 2.3 and later:
+.IP \fBfrozen_delivered_to\fR
+Update the local(8) delivery agent's Delivered-To: address
+(see prepend_delivered_header) only once, at the start of
+a delivery; do not update the Delivered-To: address while
+expanding aliases or .forward files.
+.IP \fBsticky_owner_alias\fR
+When expanding a local(8) alias that has an owner alias
+(see owner-\fIname\fR discussion above), use the owner
+information even when the expansion invokes a subordinate
+alias that has no owner alias.
 .SH "STANDARDS"
 .na
 .nf
index 7d08a8289f9f48599cdfc7139364103cd0b5e9ca..ef44cd526d74c3556dadba0aaaeeb0c13b934a47 100644 (file)
@@ -1309,6 +1309,18 @@ forward_path =
 .fi
 .ad
 .ft R
+.SH frozen_delivered_to (default: yes)
+Update the \fBlocal\fR(8) delivery agent's idea of the Delivered-To:
+address (see prepend_delivered_header) only once, at the start of
+a delivery attempt; do not update the Delivered-To: address while
+expanding aliases or .forward files.
+.PP
+This feature is available in Postfix 2.3 and later. With older
+Postfix releases, the behavior is as if this parameter is set to
+"no". The old setting can be expensive with deeply nested aliases
+or .forward files. When an alias or .forward file changes the
+Delivered-To: address, it ties up one queue file and one cleanup
+process instance while mail is being forwarded.
 .SH hash_queue_depth (default: 1)
 The number of subdirectory levels for queue directories listed with
 the hash_queue_names parameter.
@@ -2546,7 +2558,9 @@ submissions from the Postfix maildrop queue.
 This feature is available in Postfix 2.0 and later.
 .SH prepend_delivered_header (default: command, file, forward)
 The message delivery contexts where the Postfix \fBlocal\fR(8) delivery
-agent prepends a Delivered-To:  message header.
+agent prepends a Delivered-To:  message header with the address
+that the mail was delivered to. This information is used for mail
+delivery loop detection.
 .PP
 By default, the Postfix local delivery agent prepends a Delivered-To:
 header when forwarding mail and when delivering to file (mailbox)
@@ -5335,6 +5349,16 @@ This is used for delivery to file or mailbox.
 .PP
 Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
 The default time unit is s (seconds).
+.SH sticky_owner_alias (default: yes)
+When expanding a \fBlocal\fR(8) alias that has an owner alias (see
+owner-\fIname\fR discussion in \fBaliases\fR(5)), use the owner information
+even when the expansion invokes a subordinate alias that has no
+owner alias.
+.PP
+This feature is available in Postfix 2.3 and later. With older
+Postfix releases, the behavior is as if this parameter is set to
+"no". The old setting provides poorer error reporting with nested
+aliases that only have an owner alias at the top level.
 .SH strict_7bit_headers (default: no)
 Reject mail with 8-bit text in message headers. This blocks mail
 from poorly written applications.
index 3ff4dfc948bc487f70d0d6641689940bbe8c5e84..409f7f5d3cea97c7000fdb9c3604a8fb3d7cc687 100644 (file)
@@ -392,6 +392,18 @@ address localparts: don't split such addresses when the
 recipient_delimiter is set to "-".
 .IP "\fBsun_mailtool_compatibility (no)\fR"
 Obsolete SUN mailtool compatibility feature.
+.PP
+Available in Postfix version 2.3 and later:
+.IP "\fBfrozen_delivered_to (yes)\fR"
+Update the \fBlocal\fR(8) delivery agent's idea of the Delivered-To:
+address (see prepend_delivered_header) only once, at the start of
+a delivery attempt; do not update the Delivered-To: address while
+expanding aliases or .forward files.
+.IP "\fBsticky_owner_alias (yes)\fR"
+When expanding a \fBlocal\fR(8) alias that has an owner alias (see
+owner-\fIname\fR discussion in \fBaliases\fR(5)), use the owner information
+even when the expansion invokes a subordinate alias that has no
+owner alias.
 .SH "DELIVERY METHOD CONTROLS"
 .na
 .nf
@@ -520,7 +532,8 @@ The maximal number of connection requests before a Postfix daemon
 process terminates.
 .IP "\fBprepend_delivered_header (command, file, forward)\fR"
 The message delivery contexts where the Postfix \fBlocal\fR(8) delivery
-agent prepends a Delivered-To:  message header.
+agent prepends a Delivered-To:  message header with the address
+that the mail was delivered to.
 .IP "\fBprocess_id (read-only)\fR"
 The process ID of a Postfix command or daemon process.
 .IP "\fBprocess_name (read-only)\fR"
index fbb88c4bf18209d46c83758e1239f10be5b20c7a..06a3a1f3acda91cab843c719926bf6497acc1dfb 100755 (executable)
@@ -501,6 +501,9 @@ while (<>) {
     s;\btls_ran[-</Bb>]*\n* *[<Bb>]*dom_reseed_period\b;<a href="postconf.5.html#tls_random_reseed_period">$&</a>;g;
     s;\btls_ran[-</Bb>]*\n* *[<Bb>]*dom_source\b;<a href="postconf.5.html#tls_random_source">$&</a>;g;
  
+    s;\bfrozen_delivered_to\b;<a href="postconf.5.html#frozen_delivered_to">$&</a>;g;
+    s;\bsticky_owner_alias\b;<a href="postconf.5.html#sticky_owner_alias">$&</a>;g;
+
     # Undo hyperlinks of manual pages with the same name as parameters.
 
     s/<a href="[^"]*">([^<]*)<\/a>\(/$1(/g;
index 8a499a416f7a098a4704eb49a8e61dd50caf1272..bce2d9d2faafd8828068d4dfc84bf705bdfe18d7 100644 (file)
@@ -46,8 +46,9 @@
 #      lowercase, in order to make database lookups case insensitive.
 # .PP
 #      In addition, when an alias exists for \fBowner-\fIname\fR, delivery
-#      diagnostics are directed to that address, instead of to the originator.
-#      This is typically used to direct delivery errors to the owner of
+#      diagnostics are directed to that address, instead of to the originator
+#      of the message.
+#      This is typically used to direct delivery errors to the maintainer of
 #      a mailing list, who is in a better position to deal with mailing
 #      list delivery problems than the originator of the undelivered mail.
 # .PP
 #      addresses.
 # .IP \fBrecipient_delimiter\fR
 #      Delimiter that separates recipients from address extensions.
+# .PP
+#      Available in Postfix version 2.3 and later:
+# .IP \fBfrozen_delivered_to\fR
+#      Update the local(8) delivery agent's Delivered-To: address
+#      (see prepend_delivered_header) only once, at the start of
+#      a delivery; do not update the Delivered-To: address while
+#      expanding aliases or .forward files.
+# .IP \fBsticky_owner_alias\fR
+#      When expanding a local(8) alias that has an owner alias
+#      (see owner-\fIname\fR discussion above), use the owner
+#      information even when the expansion invokes a subordinate
+#      alias that has no owner alias.
 # STANDARDS
 #      RFC 822 (ARPA Internet Text Messages)
 # SEE ALSO
index 2a5d693f858b6f409ae59eaa9d9e717fa53e7d50..b37eadef67dcf8e0c15f7c928b2e22893e547c81 100644 (file)
@@ -6841,10 +6841,10 @@ This feature is available in Postfix 2.0 and later.
 
 %PARAM prepend_delivered_header command, file, forward
 
-<p>
-The message delivery contexts where the Postfix local(8) delivery
-agent prepends a Delivered-To:  message header.
-</p>
+<p> The message delivery contexts where the Postfix local(8) delivery
+agent prepends a Delivered-To:  message header with the address
+that the mail was delivered to. This information is used for mail
+delivery loop detection.  </p>
 
 <p>
 By default, the Postfix local delivery agent prepends a Delivered-To:
@@ -8541,3 +8541,29 @@ message_strip_characters = \0
 </pre>
 
 <p> This feature is available in Postfix 2.3 and later.  </p>
+
+%PARAM sticky_owner_alias yes
+
+<p> When expanding a local(8) alias that has an owner alias (see
+owner-<i>name</i> discussion in aliases(5)), use the owner information
+even when the expansion invokes a subordinate alias that has no
+owner alias.  </p>
+
+<p> This feature is available in Postfix 2.3 and later. With older
+Postfix releases, the behavior is as if this parameter is set to
+"no". The old setting provides poorer error reporting with nested
+aliases that only have an owner alias at the top level.  </p>
+
+%PARAM frozen_delivered_to yes
+
+<p> Update the local(8) delivery agent's idea of the Delivered-To:
+address (see prepend_delivered_header) only once, at the start of
+a delivery attempt; do not update the Delivered-To: address while
+expanding aliases or .forward files. </p>
+
+<p> This feature is available in Postfix 2.3 and later. With older
+Postfix releases, the behavior is as if this parameter is set to
+"no". The old setting can be expensive with deeply nested aliases
+or .forward files. When an alias or .forward file changes the
+Delivered-To: address, it ties up one queue file and one cleanup
+process instance while mail is being forwarded.  </p>
index 1b9f033259d084dd53f1674f86465b2d13494b80..8a22a1c6d5a54700aa3eca729dc0e7743122fcac 100644 (file)
@@ -2373,6 +2373,17 @@ extern char *var_msg_reject_chars;
 #define DEF_MSG_STRIP_CHARS            ""
 extern char *var_msg_strip_chars;
 
+ /*
+  * Local forwarding complexity controls.
+  */
+#define VAR_FROZEN_DELIVERED           "frozen_delivered_to"
+#define DEF_FROZEN_DELIVERED           1
+extern bool var_frozen_delivered;
+
+#define VAR_STICKY_OWNER_ALIAS         "sticky_owner_alias"
+#define DEF_STICKY_OWNER_ALIAS         1
+extern bool var_sticky_owner_alias;
+
 /* LICENSE
 /* .ad
 /* .fi
index 55236fe8477422ca732fd010d1fa3825179e71d5..9e1b0d5af36e30297a1df907a1d7b07a282e8334 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      "20050922"
+#define MAIL_RELEASE_DATE      "20050923"
 #define MAIL_VERSION_NUMBER    "2.3"
 
 #ifdef SNAPSHOT
index 371bfc6fe935d4a04f6eb280a1d2db6832ffc609..3c0a6f8ed4001187bbadde4663a02dbaa1905bf4 100644 (file)
@@ -145,8 +145,6 @@ static NAME_MASK lmtp_sasl_sec_mask[] = {
 
 #if SASL_VERSION_MAJOR < 2
 /* SASL version 1.x */
-#define SASL_LOG_WARN SASL_LOG_WARNING
-#define SASL_LOG_NOTE SASL_LOG_INFO
 #define SASL_CLIENT_NEW(srv, fqdn, lport, rport, prompt, secflags, pconn) \
        sasl_client_new(srv, fqdn, prompt, secflags, pconn)
 #define SASL_CLIENT_START(conn, mechlst, secret, prompt, clout, cllen, mech) \
@@ -177,16 +175,53 @@ static int lmtp_sasl_log(void *unused_context, int priority,
 {
     switch (priority) {
        case SASL_LOG_ERR:              /* unusual errors */
-       case SASL_LOG_WARN:             /* non-fatal warnings */
+#ifdef SASL_LOG_WARN                   /* non-fatal warnings (Cyrus-SASL v2) */
+       case SASL_LOG_WARN:
+#endif
+#ifdef SASL_LOG_WARNING                        /* non-fatal warnings (Cyrus-SASL v1) */
+       case SASL_LOG_WARNING:
+#endif
        msg_warn("SASL authentication problem: %s", message);
        break;
-    case SASL_LOG_NOTE:                        /* other info */
+#ifdef SASL_LOG_INFO
+    case SASL_LOG_INFO:                        /* other info (Cyrus-SASL v1) */
        if (msg_verbose)
            msg_info("SASL authentication info: %s", message);
        break;
-#if SASL_VERSION_MAJOR >= 2
-    case SASL_LOG_FAIL:                        /* authentication failures */
+#endif
+#ifdef SASL_LOG_NOTE
+    case SASL_LOG_NOTE:                        /* other info (Cyrus-SASL v2) */
+       if (msg_verbose)
+           msg_info("SASL authentication info: %s", message);
+       break;
+#endif
+#ifdef SASL_LOG_FAIL
+    case SASL_LOG_FAIL:                        /* authentication failures
+                                                * (Cyrus-SASL v2) */
        msg_warn("SASL authentication failure: %s", message);
+       break;
+#endif
+#ifdef SASL_LOG_DEBUG
+    case SASL_LOG_DEBUG:                       /* more verbose than LOG_NOTE
+                                                * (Cyrus-SASL v2) */
+       if (msg_verbose > 1)
+           msg_info("SASL authentication debug: %s", message);
+       break;
+#endif
+#ifdef SASL_LOG_TRACE
+    case SASL_LOG_TRACE:                       /* traces of internal
+                                                * protocols (Cyrus-SASL v2) */
+       if (msg_verbose > 1)
+           msg_info("SASL authentication trace: %s", message);
+       break;
+#endif
+#ifdef SASL_LOG_PASS
+    case SASL_LOG_PASS:                        /* traces of internal
+                                                * protocols, including
+                                                * passwords (Cyrus-SASL v2) */
+       if (msg_verbose > 1)
+           msg_info("SASL authentication pass: %s", message);
+       break;
 #endif
     }
     return (SASL_OK);
@@ -315,7 +350,7 @@ void    lmtp_sasl_initialize(void)
 #endif
        )
        msg_fatal("incorrect SASL library version. "
-                 "Postfix was built with include files from version %d.%d.%d, "
+             "Postfix was built with include files from version %d.%d.%d, "
                  "but the run-time library version is %d.%d.%d",
                  SASL_VERSION_MAJOR, SASL_VERSION_MINOR, SASL_VERSION_STEP,
                  sasl_major, sasl_minor, sasl_step);
@@ -447,7 +482,7 @@ int     lmtp_sasl_authenticate(LMTP_STATE *state, DSN_BUF *why)
 
     if (msg_verbose)
        msg_info("%s: %s: SASL mechanisms %s",
-              myname, session->namaddr, state->sasl_mechanism_list);
+                myname, session->namaddr, state->sasl_mechanism_list);
 
     /*
      * Start the client side authentication protocol.
@@ -458,12 +493,12 @@ int     lmtp_sasl_authenticate(LMTP_STATE *state, DSN_BUF *why)
                               &clientout, &clientoutlen, &mechanism);
     if (result != SASL_OK && result != SASL_CONTINUE) {
        dsb_update(why, "4.7.0", DSB_DEF_ACTION, DSB_SKIP_RMTA, DSB_DTYPE_SASL,
-                   421, sasl_errstring(result, NO_SASL_LANGLIST,
-                                       NO_SASL_OUTLANG),
-                   "cannot SASL authenticate to server %s: %s",
-                       session->namaddr,
-                       sasl_errstring(result, NO_SASL_LANGLIST,
-                                      NO_SASL_OUTLANG));
+                  421, sasl_errstring(result, NO_SASL_LANGLIST,
+                                      NO_SASL_OUTLANG),
+                  "cannot SASL authenticate to server %s: %s",
+                  session->namaddr,
+                  sasl_errstring(result, NO_SASL_LANGLIST,
+                                 NO_SASL_OUTLANG));
        return (-1);
     }
 
@@ -510,7 +545,7 @@ int     lmtp_sasl_authenticate(LMTP_STATE *state, DSN_BUF *why)
        if (SASL_DECODE64(line, serverinlen, STR(state->sasl_decoded),
                          serverinlen, &enc_length) != SASL_OK) {
            lmtp_dsn_update(why, "5.7.0", DSN_BY_LOCAL_MTA,
-                            501, "501 malformed SASL challenge",
+                           501, "501 malformed SASL challenge",
                            "malformed SASL challenge from server %s",
                            session->namaddr);
            return (-1);
index 0ec7b32790b13968de4c8c167f9dd741ff3b3b1d..5149f3ef61e1b1d23c5e610bbe485f83fd47e232 100644 (file)
@@ -263,7 +263,8 @@ int     deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr,
                SET_OWNER_ATTR(state.msg_attr, STR(canon_owner), state.level);
            } else {
                canon_owner = 0;
-               RESET_OWNER_ATTR(state.msg_attr, state.level);
+               if (var_sticky_owner_alias == 0)
+                   RESET_OWNER_ATTR(state.msg_attr, state.level);
            }
 
            /*
@@ -272,7 +273,8 @@ int     deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr,
             * Set the delivered message attribute to the recipient, so that
             * this message will list the correct forwarding address.
             */
-           state.msg_attr.delivered = state.msg_attr.rcpt.address;
+           if (var_frozen_delivered == 0)
+               state.msg_attr.delivered = state.msg_attr.rcpt.address;
 
            /*
             * Deliver.
index e1e78f26af974f9ed98cd785dc0c9cc0675a0cdb..79f3d98762c664327cea9fffbde8734dc6d3576c 100644 (file)
@@ -139,7 +139,8 @@ int     deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
      * Set the delivered message attribute to the recipient, so that this
      * message will list the correct forwarding address.
      */
-    state.msg_attr.delivered = state.msg_attr.rcpt.address;
+    if (var_frozen_delivered == 0)
+       state.msg_attr.delivered = state.msg_attr.rcpt.address;
 
     /*
      * DELIVERY RIGHTS
index 63a1f78be7809bdcc8fa475af7d78ee4e711a740..f849c1da57f431c94a13eb2b6a948dfe1f95c91d 100644 (file)
 /*     recipient_delimiter is set to "-".
 /* .IP "\fBsun_mailtool_compatibility (no)\fR"
 /*     Obsolete SUN mailtool compatibility feature.
+/* .PP
+/*     Available in Postfix version 2.3 and later:
+/* .IP "\fBfrozen_delivered_to (yes)\fR"
+/*     Update the \fBlocal\fR(8) delivery agent's idea of the Delivered-To:
+/*     address (see prepend_delivered_header) only once, at the start of
+/*     a delivery attempt; do not update the Delivered-To: address while
+/*     expanding aliases or .forward files.
+/* .IP "\fBsticky_owner_alias (yes)\fR"
+/*     When expanding a \fBlocal\fR(8) alias that has an owner alias (see
+/*     owner-\fIname\fR discussion in \fBaliases\fR(5)), use the owner information
+/*     even when the expansion invokes a subordinate alias that has no
+/*     owner alias.
 /* DELIVERY METHOD CONTROLS
 /* .ad
 /* .fi
 /*     process terminates.
 /* .IP "\fBprepend_delivered_header (command, file, forward)\fR"
 /*     The message delivery contexts where the Postfix \fBlocal\fR(8) delivery
-/*     agent prepends a Delivered-To:  message header.
+/*     agent prepends a Delivered-To:  message header with the address
+/*     that the mail was delivered to.
 /* .IP "\fBprocess_id (read-only)\fR"
 /*     The process ID of a Postfix command or daemon process.
 /* .IP "\fBprocess_name (read-only)\fR"
@@ -606,6 +619,8 @@ int     var_stat_home_dir;
 int     var_mailtool_compat;
 char   *var_mailbox_lock;
 int     var_mailbox_limit;
+bool    var_frozen_delivered;
+bool    var_sticky_owner_alias;
 
 int     local_cmd_deliver_mask;
 int     local_file_deliver_mask;
@@ -845,6 +860,8 @@ int     main(int argc, char **argv)
        VAR_EXP_OWN_ALIAS, DEF_EXP_OWN_ALIAS, &var_exp_own_alias,
        VAR_STAT_HOME_DIR, DEF_STAT_HOME_DIR, &var_stat_home_dir,
        VAR_MAILTOOL_COMPAT, DEF_MAILTOOL_COMPAT, &var_mailtool_compat,
+       VAR_FROZEN_DELIVERED, DEF_FROZEN_DELIVERED, &var_frozen_delivered,
+       VAR_STICKY_OWNER_ALIAS, DEF_STICKY_OWNER_ALIAS, &var_sticky_owner_alias,
        0,
     };
 
index 82b210424471b32566eabf629f23f3a78c2ce0ec..9b43950a3206c750830633d11c22cf283cc5b6b4 100644 (file)
@@ -124,7 +124,8 @@ static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr)
      */
     if (vstream_fseek(state.msg_attr.fp, state.msg_attr.offset, SEEK_SET) < 0)
        msg_fatal("seek message file %s: %m", VSTREAM_PATH(state.msg_attr.fp));
-    state.msg_attr.delivered = state.msg_attr.rcpt.address;
+    if (var_frozen_delivered == 0)
+       state.msg_attr.delivered = state.msg_attr.rcpt.address;
     mail_copy_status = MAIL_COPY_STAT_WRITE;
     if (*var_home_mailbox) {
        spool_dir = 0;
index 6b338a6fdda41dfd5392e0853e5a114f338f84e9..08a50b43fb8970bc455f4971fdf2634d47c243f6 100644 (file)
@@ -114,7 +114,8 @@ int     deliver_maildir(LOCAL_STATE state, USER_ATTR usr_attr, char *path)
      */
     if (vstream_fseek(state.msg_attr.fp, state.msg_attr.offset, SEEK_SET) < 0)
        msg_fatal("seek message file %s: %m", VSTREAM_PATH(state.msg_attr.fp));
-    state.msg_attr.delivered = state.msg_attr.rcpt.address;
+    if (var_frozen_delivered == 0)
+       state.msg_attr.delivered = state.msg_attr.rcpt.address;
     mail_copy_status = MAIL_COPY_STAT_WRITE;
     buf = vstring_alloc(100);
 
index ef6c4cb6eba2b0579ae44a7570bd6884b44d316f..eb097a602d270f133c8daefc3654db63a016b745 100644 (file)
@@ -160,8 +160,6 @@ static NAME_MASK smtp_sasl_sec_mask[] = {
 
 #if SASL_VERSION_MAJOR < 2
 /* SASL version 1.x */
-#define SASL_LOG_WARN SASL_LOG_WARNING
-#define SASL_LOG_NOTE SASL_LOG_INFO
 #define SASL_CLIENT_NEW(srv, fqdn, lport, rport, prompt, secflags, pconn) \
        sasl_client_new(srv, fqdn, prompt, secflags, pconn)
 #define SASL_CLIENT_START(conn, mechlst, secret, prompt, clout, cllen, mech) \
@@ -197,32 +195,50 @@ static int smtp_sasl_log(void *unused_context, int priority,
 {
     switch (priority) {
        case SASL_LOG_ERR:              /* unusual errors */
-       case SASL_LOG_WARN:             /* non-fatal warnings */
+#ifdef SASL_LOG_WARN                   /* non-fatal warnings (Cyrus-SASL v2) */
+       case SASL_LOG_WARN:
+#endif
+#ifdef SASL_LOG_WARNING                        /* non-fatal warnings (Cyrus-SASL v1) */
+       case SASL_LOG_WARNING:
+#endif
        msg_warn("SASL authentication problem: %s", message);
        break;
-    case SASL_LOG_NOTE:                        /* other info */
+#ifdef SASL_LOG_INFO
+    case SASL_LOG_INFO:                        /* other info (Cyrus-SASL v1) */
        if (msg_verbose)
            msg_info("SASL authentication info: %s", message);
        break;
+#endif
+#ifdef SASL_LOG_NOTE
+    case SASL_LOG_NOTE:                        /* other info (Cyrus-SASL v2) */
+       if (msg_verbose)
+           msg_info("SASL authentication info: %s", message);
+       break;
+#endif
 #ifdef SASL_LOG_FAIL
-    case SASL_LOG_FAIL:                        /* authentication failures */
+    case SASL_LOG_FAIL:                        /* authentication failures
+                                                * (Cyrus-SASL v2) */
        msg_warn("SASL authentication failure: %s", message);
        break;
 #endif
 #ifdef SASL_LOG_DEBUG
-    case SASL_LOG_DEBUG:
+    case SASL_LOG_DEBUG:                       /* more verbose than LOG_NOTE
+                                                * (Cyrus-SASL v2) */
        if (msg_verbose > 1)
            msg_info("SASL authentication debug: %s", message);
        break;
 #endif
 #ifdef SASL_LOG_TRACE
-    case SASL_LOG_TRACE:
+    case SASL_LOG_TRACE:                       /* traces of internal
+                                                * protocols (Cyrus-SASL v2) */
        if (msg_verbose > 1)
            msg_info("SASL authentication trace: %s", message);
        break;
 #endif
 #ifdef SASL_LOG_PASS
-    case SASL_LOG_PASS:
+    case SASL_LOG_PASS:                        /* traces of internal
+                                                * protocols, including
+                                                * passwords (Cyrus-SASL v2) */
        if (msg_verbose > 1)
            msg_info("SASL authentication pass: %s", message);
        break;
index cd97b31773b355387493668c069b7374e4ad021e..10cfd371286ebfa422cf55fb5a27d59c7954efc9 100644 (file)
 
 #if SASL_VERSION_MAJOR < 2
 /* SASL version 1.x */
-#define SASL_LOG_WARN SASL_LOG_WARNING
-#define SASL_LOG_NOTE SASL_LOG_INFO
 #define SASL_SERVER_NEW(srv, fqdn, rlm, lport, rport, cb, secflags, pconn) \
        sasl_server_new(srv, fqdn, rlm, cb, secflags, pconn)
 #define SASL_SERVER_START(conn, mech, clin, clinlen, srvout, srvoutlen, err) \
@@ -165,39 +163,57 @@ static int smtpd_sasl_log(void *unused_context, int priority,
                                  const char *message)
 {
     switch (priority) {
-    case SASL_LOG_ERR:
-    case SASL_LOG_WARN:
+       case SASL_LOG_ERR:              /* unusual errors */
+#ifdef SASL_LOG_WARN                   /* non-fatal warnings (Cyrus-SASL v2) */
+       case SASL_LOG_WARN:
+#endif
+#ifdef SASL_LOG_WARNING                        /* non-fatal warnings (Cyrus-SASL v1) */
+       case SASL_LOG_WARNING:
+#endif
        msg_warn("SASL authentication problem: %s", message);
        break;
-    case SASL_LOG_NOTE:
+#ifdef SASL_LOG_INFO
+    case SASL_LOG_INFO:                        /* other info (Cyrus-SASL v1) */
        if (msg_verbose)
            msg_info("SASL authentication info: %s", message);
        break;
+#endif
+#ifdef SASL_LOG_NOTE
+    case SASL_LOG_NOTE:                        /* other info (Cyrus-SASL v2) */
+       if (msg_verbose)
+           msg_info("SASL authentication info: %s", message);
+       break;
+#endif
 #ifdef SASL_LOG_FAIL
-    case SASL_LOG_FAIL:
+    case SASL_LOG_FAIL:                        /* authentication failures
+                                                * (Cyrus-SASL v2) */
        msg_warn("SASL authentication failure: %s", message);
        break;
 #endif
 #ifdef SASL_LOG_DEBUG
-    case SASL_LOG_DEBUG:
+    case SASL_LOG_DEBUG:                       /* more verbose than LOG_NOTE
+                                                * (Cyrus-SASL v2) */
        if (msg_verbose > 1)
            msg_info("SASL authentication debug: %s", message);
        break;
 #endif
 #ifdef SASL_LOG_TRACE
-    case SASL_LOG_TRACE:
+    case SASL_LOG_TRACE:                       /* traces of internal
+                                                * protocols (Cyrus-SASL v2) */
        if (msg_verbose > 1)
            msg_info("SASL authentication trace: %s", message);
        break;
 #endif
 #ifdef SASL_LOG_PASS
-    case SASL_LOG_PASS:
+    case SASL_LOG_PASS:                        /* traces of internal
+                                                * protocols, including
+                                                * passwords (Cyrus-SASL v2) */
        if (msg_verbose > 1)
            msg_info("SASL authentication pass: %s", message);
        break;
 #endif
     }
-    return SASL_OK;
+    return (SASL_OK);
 }
 
  /*
@@ -245,7 +261,7 @@ void    smtpd_sasl_initialize(void)
 #endif
        )
        msg_fatal("incorrect SASL library version. "
-                 "Postfix was built with include files from version %d.%d.%d, "
+             "Postfix was built with include files from version %d.%d.%d, "
                  "but the run-time library version is %d.%d.%d",
                  SASL_VERSION_MAJOR, SASL_VERSION_MINOR, SASL_VERSION_STEP,
                  sasl_major, sasl_minor, sasl_step);
index f6b35abf5e2f83a53d469942a933648955d5c6ae..0642a3bc9dd35b219dc41a2a30aa3ab62121f46a 100644 (file)
@@ -106,6 +106,8 @@ qmqp-source.o: ../../include/qmqp_proto.h
 qmqp-source.o: ../../include/sane_connect.h
 qmqp-source.o: ../../include/split_at.h
 qmqp-source.o: ../../include/sys_defs.h
+qmqp-source.o: ../../include/valid_hostname.h
+qmqp-source.o: ../../include/valid_mailhost_addr.h
 qmqp-source.o: ../../include/vbuf.h
 qmqp-source.o: ../../include/vstream.h
 qmqp-source.o: ../../include/vstring.h
@@ -142,6 +144,8 @@ smtp-source.o: ../../include/sane_connect.h
 smtp-source.o: ../../include/smtp_stream.h
 smtp-source.o: ../../include/split_at.h
 smtp-source.o: ../../include/sys_defs.h
+smtp-source.o: ../../include/valid_hostname.h
+smtp-source.o: ../../include/valid_mailhost_addr.h
 smtp-source.o: ../../include/vbuf.h
 smtp-source.o: ../../include/vstream.h
 smtp-source.o: ../../include/vstring.h
index 7ff27bf8397577356c0893a6f6ada98817be39d9..d06054215edbf2539c000fd02fd540116f69ae74 100644 (file)
 /*     includes the message headers.
 /* .IP "\fB-m \fImessage_count\fR"
 /*     Send the specified number of messages (default: 1).
+/* .IP "\fB-M \fImyhostname\fR"
+/*     Use the specified hostname or [address] in the default
+/*     sender and recipient addresses, instead of the machine
+/*     hostname.
 /* .IP "\fB-r \fIrecipient_count\fR"
 /*     Send the specified number of recipients per transaction (default: 1).
 /*     Recipient names are generated by prepending a number to the
@@ -48,6 +52,8 @@
 /* .IP "\fB-R \fIinterval\fR"
 /*     Wait for a random period of time 0 <= n <= interval between messages.
 /*     Suspending one thread does not affect other delivery threads.
+/* .IP \fB-v\fR
+/*     Make the program more verbose, for debugging purposes.
 /* .IP "\fB-w \fIinterval\fR"
 /*     Wait a fixed time between messages.
 /*     Suspending one thread does not affect other delivery threads.
 #include <host_port.h>
 #include <myaddrinfo.h>
 #include <inet_proto.h>
+#include <valid_hostname.h>
+#include <valid_mailhost_addr.h>
 
 /* Global library. */
 
@@ -428,7 +436,7 @@ static void receive_reply(int unused_event, char *context)
 
 static void usage(char *myname)
 {
-    msg_fatal("usage: %s -s sess -l msglen -m msgs -c -C count -f from -t to -R delay -v -w delay host[:port]", myname);
+    msg_fatal("usage: %s -cv -s sess -l msglen -m msgs -C count -M myhostname -f from -t to -R delay -w delay host[:port]", myname);
 }
 
 /* main - parse JCL and start the machine */
@@ -458,7 +466,7 @@ int     main(int argc, char **argv)
     /*
      * Parse JCL.
      */
-    while ((ch = GETOPT(argc, argv, "46cC:f:l:m:r:R:s:t:vw:")) > 0) {
+    while ((ch = GETOPT(argc, argv, "46cC:f:l:m:M:r:R:s:t:vw:")) > 0) {
        switch (ch) {
        case '4':
            protocols = INET_PROTO_NAME_IPV4;
@@ -484,6 +492,16 @@ int     main(int argc, char **argv)
            if ((message_count = atoi(optarg)) <= 0)
                usage(argv[0]);
            break;
+       case 'M':
+           if (*optarg == '[') {
+               if (!valid_mailhost_literal(optarg, DO_GRIPE))
+                   msg_fatal("bad address literal: %s", optarg);
+           } else {
+               if (!valid_hostname(optarg, DO_GRIPE))
+                   msg_fatal("bad hostname: %s", optarg);
+           }
+           var_myhostname = optarg;
+           break;
        case 'r':
            if ((recipients = atoi(optarg)) <= 0)
                usage(argv[0]);
@@ -562,7 +580,8 @@ int     main(int argc, char **argv)
     /*
      * Make sure we have sender and recipient addresses.
      */
-    var_myhostname = get_hostname();
+    if (var_myhostname == 0)
+       var_myhostname = get_hostname();
     if (sender == 0 || recipient == 0) {
        vstring_sprintf(buffer, "foo@%s", var_myhostname);
        defaddr = mystrdup(vstring_str(buffer));
index 2b665d3633923939193b521850fc7f33d3d9c17b..f02f809acd25f729c0f35b7ed696b64479469c49 100644 (file)
@@ -37,8 +37,6 @@
 /*     message over the same connection.
 /* .IP "\fB-f \fIfrom\fR"
 /*     Use the specified sender address (default: <foo@myhostname>).
-/* .IP \fB-o\fR
-/*     Old mode: don't send HELO, and don't send message headers.
 /* .IP "\fB-l \fIlength\fR"
 /*     Send \fIlength\fR bytes as message payload. The length does not
 /*     include message headers.
 /*     Speak LMTP rather than SMTP.
 /* .IP "\fB-m \fImessage_count\fR"
 /*     Send the specified number of messages (default: 1).
+/* .IP "\fB-M \fImyhostname\fR"
+/*     Use the specified hostname or [address] in the HELO command
+/*     and in the default sender and recipient addresses, instead
+/*     of the machine hostname.
 /* .IP "\fB-N\fR"
 /*     Prepend a non-repeating sequence number to each recipient
 /*     address. This avoids the artificial 100% hit rate in the
 /*     resolve and rewrite client caches and exercises the
 /*     trivial-rewrite daemon, better approximating Postfix
 /*     performance under real-life work-loads.
+/* .IP \fB-o\fR
+/*     Old mode: don't send HELO, and don't send message headers.
 /* .IP "\fB-r \fIrecipient_count\fR"
 /*     Send the specified number of recipients per transaction (default: 1).
 /*     Recipient names are generated by prepending a number to the
@@ -65,6 +69,8 @@
 /* .IP "\fB-R \fIinterval\fR"
 /*     Wait for a random period of time 0 <= n <= interval between messages.
 /*     Suspending one thread does not affect other delivery threads.
+/* .IP \fB-v\fR
+/*     Make the program more verbose, for debugging purposes.
 /* .IP "\fB-w \fIinterval\fR"
 /*     Wait a fixed time between messages.
 /*     Suspending one thread does not affect other delivery threads.
 #include <host_port.h>
 #include <myaddrinfo.h>
 #include <inet_proto.h>
+#include <valid_hostname.h>
+#include <valid_mailhost_addr.h>
 
 /* Global library. */
 
@@ -784,7 +792,7 @@ static void quit_done(int unused_event, char *context)
 
 static void usage(char *myname)
 {
-    msg_fatal("usage: %s -cdLNov -s sess -l msglen -m msgs -C count -f from -t to -r rcptcount -R delay -w delay host[:port]", myname);
+    msg_fatal("usage: %s -cdLNov -s sess -l msglen -m msgs -C count -M myhostname -f from -t to -r rcptcount -R delay -w delay host[:port]", myname);
 }
 
 /* main - parse JCL and start the machine */
@@ -812,7 +820,7 @@ int     main(int argc, char **argv)
     /*
      * Parse JCL.
      */
-    while ((ch = GETOPT(argc, argv, "46cC:df:l:Lm:Nor:R:s:S:t:vw:")) > 0) {
+    while ((ch = GETOPT(argc, argv, "46cC:df:l:Lm:M:Nor:R:s:S:t:vw:")) > 0) {
        switch (ch) {
        case '4':
            protocols = INET_PROTO_NAME_IPV4;
@@ -851,6 +859,16 @@ int     main(int argc, char **argv)
            if ((message_count = atoi(optarg)) <= 0)
                msg_fatal("bad message count: %s", optarg);
            break;
+       case 'M':
+           if (*optarg == '[') {
+               if (!valid_mailhost_literal(optarg, DO_GRIPE))
+                   msg_fatal("bad address literal: %s", optarg);
+           } else {
+               if (!valid_hostname(optarg, DO_GRIPE))
+                   msg_fatal("bad hostname: %s", optarg);
+           }
+           var_myhostname = optarg;
+           break;
        case 'N':
            number_rcpts = 1;
            break;
@@ -947,7 +965,8 @@ int     main(int argc, char **argv)
     /*
      * Make sure we have sender and recipient addresses.
      */
-    var_myhostname = get_hostname();
+    if (var_myhostname == 0)
+       var_myhostname = get_hostname();
     if (sender == 0 || recipient == 0) {
        vstring_sprintf(buffer, "foo@%s", var_myhostname);
        defaddr = mystrdup(vstring_str(buffer));