Loading ...
Sorry, an error occurred while loading the content.

Domain masquerading, but not for local

Expand Messages
  • William Wilhelm
    Hi, newbie here, apologies in advance. I have a virtual setup with a virtual domain (example.com), users and aliases working well. Recent experimentation using
    Message 1 of 3 , Mar 26, 2014
    • 0 Attachment
      Hi, newbie here, apologies in advance.
      I have a virtual setup with a virtual domain (example.com), users and
      aliases working well. Recent experimentation using shell "mail" from
      mailutils on the local system has presented me the following problem.

      Mail sent to external addresses, like gmail, has the sender listed as
      will@...—good because a reply will be delivered to my virtual
      mailbox and not to the local inbox.
      Mail sent to a virtual address also has the sender listed as
      will@...—also good.
      Mail sent to a local user (such as root@...), too, has the
      sender listed as will@...—not good, because a reply will be
      directed to my virtual inbox and not my local inbox. What I would is for
      the sender to be will@..., in this case.

      I am using masquerade_domains to get the effect of rewriting the sender
      fqdn from host.example.com to just example.com, but I don't want this
      rewriting to occur for mail between local mailboxes. I have tried
      smtp_generic_maps instead which for me will rewrite the sender for mail to
      gmail.com but not mail to a virtual address.

      Postconf below. Thanks and will gladly provide any more details.

      broken_sasl_auth_clients = yes
      command_directory = /usr/sbin
      config_directory = /etc/postfix
      daemon_directory = /usr/libexec/postfix
      data_directory = /var/lib/postfix
      debug_peer_level = 2
      debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd
      $daemon_directory/$process_name $process_id & sleep 5
      dovecot_destination_recipient_limit = 1
      home_mailbox = .maildir/
      html_directory = no
      inet_protocols = ipv4
      mail_owner = postfix
      mailq_path = /usr/bin/mailq
      manpage_directory = /usr/share/man
      masquerade_domains = $mydomain
      myhostname = host.example.com
      newaliases_path = /usr/bin/newaliases
      queue_directory = /var/spool/postfix
      readme_directory = no
      relayhost = mail.isp.com
      sample_directory = /etc/postfix
      sendmail_path = /usr/sbin/sendmail
      setgid_group = postdrop
      smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated
      reject_unauth_destination
      smtpd_sasl_auth_enable = yes
      smtpd_sasl_path = private/auth
      smtpd_sasl_type = dovecot
      smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem
      smtpd_tls_key_file = /etc/ssl/private/postfix.pem
      unknown_local_recipient_reject_code = 550
      virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
      virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
      virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
      virtual_transport = dovecot
    • Viktor Dukhovni
      ... http://www.postfix.org/SOHO_README.html#fantasy http://www.postfix.org/postconf.5.html#smtp_generic_maps ... Header address rewriting depends the transport
      Message 2 of 3 , Mar 26, 2014
      • 0 Attachment
        On Wed, Mar 26, 2014 at 10:12:10AM +0200, William Wilhelm wrote:

        > Mail sent to a local user (such as root@...), too, has the
        > sender listed as will@...?not good, because a reply will be directed
        > to my virtual inbox and not my local inbox. What I would is for the sender
        > to be will@..., in this case.

        http://www.postfix.org/SOHO_README.html#fantasy
        http://www.postfix.org/postconf.5.html#smtp_generic_maps

        > I am using masquerade_domains to get the effect of rewriting the sender fqdn
        > from host.example.com to just example.com, but I don't want this rewriting
        > to occur for mail between local mailboxes. I have tried smtp_generic_maps
        > instead which for me will rewrite the sender for mail to gmail.com but not
        > mail to a virtual address.

        Header address rewriting depends the transport used to deliver the
        message (smtp or not), and not on the input recipient address.

        If the virtual alias recipients are delivered locally, header
        addresses will be in local form, if remotely in remote form. What's
        wrong with this? Perhaps you should simplify your design.

        --
        Viktor.
      • William Wilhelm
        Thanks Victor—I solved this by diving in the deep end with multiple postfix instances. The main instance accepts incoming mail and delivers any local-bound,
        Message 3 of 3 , Mar 27, 2014
        • 0 Attachment
          Thanks Victor—I solved this by diving in the deep end with multiple postfix
          instances. The main instance accepts incoming mail and delivers any
          local-bound, then smtp_generic_maps everything else (to remove the unwanted
          hostname from host.example.com) and relays to the secondary instance. This
          instance delivers the virtual-bound mail and relays everything else to my ISP.

          Cheers for responding.


          On 26 March 2014 6:02:49 pm Viktor Dukhovni <postfix-users@...> wrote:

          > On Wed, Mar 26, 2014 at 10:12:10AM +0200, William Wilhelm wrote:
          >
          > > Mail sent to a local user (such as root@...), too, has the
          > > sender listed as will@...?not good, because a reply will be directed
          > > to my virtual inbox and not my local inbox. What I would is for the sender
          > > to be will@..., in this case.
          >
          > http://www.postfix.org/SOHO_README.html#fantasy
          > http://www.postfix.org/postconf.5.html#smtp_generic_maps
          >
          > > I am using masquerade_domains to get the effect of rewriting the sender fqdn
          > > from host.example.com to just example.com, but I don't want this rewriting
          > > to occur for mail between local mailboxes. I have tried smtp_generic_maps
          > > instead which for me will rewrite the sender for mail to gmail.com but not
          > > mail to a virtual address.
          >
          > Header address rewriting depends the transport used to deliver the
          > message (smtp or not), and not on the input recipient address.
          >
          > If the virtual alias recipients are delivered locally, header
          > addresses will be in local form, if remotely in remote form. What's
          > wrong with this? Perhaps you should simplify your design.
          >
          > --
          > Viktor.
        Your message has been successfully submitted and would be delivered to recipients shortly.