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

MYSQL virtual setup

Expand Messages
  • Markus Edholm
    Hi List I´m feeling quite puzzled I have an ordinary mailserver that I now extended with an mysql table for virtual mail forwarding. but I dont understand
    Message 1 of 6 , Jan 2, 2008
    • 0 Attachment
      Hi List

      I´m feeling quite puzzled

      I have an "ordinary" mailserver that I now extended with an mysql table for
      virtual mail forwarding.

      but I dont understand following error from mail.log:

      Jan 1 15:52:23 postfix postfix/trivial-rewrite[22495]: warning: do not list
      domain orebro.example.net in BOTH virtual_mailbox_domains and relay_domains

      I had to put orebro.example.netdomain in mysql postfix.domain to be eneble to
      select it in
      postfixadmin/admin webinterface to add adresses and goto in mysql: postfix.alias
      or have I missed someting?

      all mail not listed in vitual_* (orebro.example.net (subdomain)) is relayed to
      second.example.net a second server for alias check, webserver etc, and
      distribution also MX and Nameserver

      can this is this the problem? append_dot_mydomain (default: yes)




      (ip adressess and names removed as usual)

      /Markus


      /etc/postfix# postconf -n
      alias_database = hash:/etc/aliases
      alias_maps = hash:/etc/aliases
      append_dot_mydomain = no
      biff = no
      broken_sasl_auth_clients = yes
      config_directory = /etc/postfix
      content_filter = smtp-amavis:[127.0.0.1]:10024
      disable_vrfy_command = yes
      inet_interfaces = all
      inet_protocols = all
      local_recipient_maps = proxy:unix:passwd.byname $alias_maps $virtual_mailbox_maps
      local_transport = error:no local mail delivery
      mailbox_command = procmail -a "$EXTENSION"
      mailbox_size_limit = 0
      message_size_limit = 20480000
      mydestination = mailserver.example.net,example.net,localhost
      mydomain = example.net
      myhostname = mailserver.example.net
      mynetworks = 127.0.0.0/8,xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx
      myorigin = /etc/mailname
      recipient_delimiter =
      relay_domains = example.net
      relayhost =
      smtp_tls_note_starttls_offer = yes
      smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
      smtp_use_tls = yes
      smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
      smtpd_data_restrictions = reject_unauth_pipelining
      smtpd_helo_required = yes
      smtpd_recipient_restrictions = warn_if_reject reject_rhsbl_recipient
      dsn.rfc-ignorant.org permit_mynetworks, permit_tls_all_clientcerts,
      permit_sasl_authenticated, reject_non_fqdn_hostname,
      reject_non_fqdn_sender, reject_non_fqdn_recipient,
      reject_unauth_destination, reject_unauth_pipelining,
      reject_invalid_hostname, reject_unknown_sender_domain, check_helo_access
      pcre:/etc/postfix/helo_checks.pcre, reject_invalid_helo_hostname
      reject_non_fqdn_helo_hostname check_policy_service inet:127.0.0.1:60000
      reject_rbl_client zen.spamhaus.org, reject_rbl_client list.dsbl.org,
      reject_rbl_client rbl.mail-abuse.org,reject_rbl_client
      sbl-xbl.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client
      dnsbl.dronebl.org, check_sender_access
      $default_database_type:/etc/postfix/rhsbl_exceptions reject_rhsbl_sender
      dsn.rfc-ignorant.org, permit
      smtpd_sasl_auth_enable = yes
      smtpd_sasl_local_domain =
      smtpd_sasl_security_options = noanonymous
      smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access
      smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
      smtpd_tls_auth_only = no
      smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
      smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
      smtpd_tls_loglevel = 1
      smtpd_tls_received_header = yes
      smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
      smtpd_tls_session_cache_timeout = 3600s
      smtpd_use_tls = yes
      tls_random_source = dev:/dev/urandom
      transport_maps = hash:/etc/postfix/transport
      unknown_address_reject_code = 554
      unknown_client_reject_code = 550
      unknown_hostname_reject_code = 554
      unverified_sender_reject_code = 554
      virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
      virtual_gid_maps = static:6060
      virtual_mailbox_base = /var/vmail/
      virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
      virtual_mailbox_limit = 112400000
      virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
      virtual_minimum_uid = 100
      virtual_uid_maps = static:6060
    • Wietse Venema
      Markus Edholm: [ Charset ISO-8859-1 unsupported, converting... ] ... What is the output of: $ postmap -q orebro.example.net
      Message 2 of 6 , Jan 2, 2008
      • 0 Attachment
        Markus Edholm:
        [ Charset ISO-8859-1 unsupported, converting... ]
        > Hi List
        >
        > I?m feeling quite puzzled
        >
        > I have an "ordinary" mailserver that I now extended with an mysql table for
        > virtual mail forwarding.
        >
        > but I dont understand following error from mail.log:
        >
        > Jan 1 15:52:23 postfix postfix/trivial-rewrite[22495]: warning: do not list
        > domain orebro.example.net in BOTH virtual_mailbox_domains and relay_domains
        ...
        > relay_domains = example.net
        > virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf

        What is the output of:

        $ postmap -q orebro.example.net \
        mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found

        The output should be: "not found".

        Wietse
      • Markus Edholm
        ... Hi! No #!/bin/bash postmap -q orebro.example.net mysql:/etc/postfix/mysql_virtual_domains_maps.cf ... output: Örebro lokalavdelning So it replys with
        Message 3 of 6 , Jan 2, 2008
        • 0 Attachment
          Wietse Venema wrote:
          > Markus Edholm:
          > [ Charset ISO-8859-1 unsupported, converting... ]
          >> Hi List
          >>
          >> I?m feeling quite puzzled
          >>
          >> I have an "ordinary" mailserver that I now extended with an mysql table for
          >> virtual mail forwarding.
          >>
          >> but I dont understand following error from mail.log:
          >>
          >> Jan 1 15:52:23 postfix postfix/trivial-rewrite[22495]: warning: do not list
          >> domain orebro.example.net in BOTH virtual_mailbox_domains and relay_domains
          > ...
          >> relay_domains = example.net
          >> virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
          >
          > What is the output of:
          >
          > $ postmap -q orebro.example.net \
          > mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found
          >
          > The output should be: "not found".
          >
          > Wietse

          Hi!

          No

          #!/bin/bash
          postmap -q orebro.example.net mysql:/etc/postfix/mysql_virtual_domains_maps.cf \
          || echo not found

          output:
          Örebro lokalavdelning

          So it replys with description field from mysql

          (I take as you wanted me to run it as bash script)
          from prompt I got:

          /etc/postfix# $ postmap -q orebro.example.net \
          mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found
          -bash: $: command not found
          not found


          Hmm, My file:
          /etc/postfix# cat mysql_virtual_domains_maps.cf
          user = postfixadmin
          password = xxxxxxx
          hosts = localhost
          dbname = postfix
          query = SELECT description FROM domain WHERE domain='%s' AND active = '1'

          I have used several different "howtos" maby I made some misstake and using wrong
          files?

          /Markus
        • Markus Edholm
          ... OK, I see, sorry I did not told you whole story that spells postfixadmin . There I been forced to add new domain before add alias for that same virtual
          Message 4 of 6 , Jan 2, 2008
          • 0 Attachment
            Wietse Venema wrote:
            > Markus Edholm:
            > [ Charset ISO-8859-1 unsupported, converting... ]
            >> Hi List
            >>
            >> I?m feeling quite puzzled
            >>
            >> I have an "ordinary" mailserver that I now extended with an mysql table for
            >> virtual mail forwarding.
            >>
            >> but I dont understand following error from mail.log:
            >>
            >> Jan 1 15:52:23 postfix postfix/trivial-rewrite[22495]: warning: do not list
            >> domain orebro.example.net in BOTH virtual_mailbox_domains and relay_domains
            > ...
            >> relay_domains = example.net
            >> virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
            >
            > What is the output of:
            >
            > $ postmap -q orebro.example.net \
            > mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found
            >
            > The output should be: "not found".
            >
            > Wietse

            OK, I see, sorry I did not told you whole story that spells "postfixadmin".
            There I been forced to add new domain before add alias for that same virtual
            domain. Then because it is a subdomain that I added I end up with error.
            The mail works anyhow but it is not comfortable with errors and warnings in log.

            If I remove the domain from postfix.domain in mysql the error is gone, but then
            I loose ability to add new aliases with postfixadmin web tool.

            So I made some more testing and added an other domain and alias (not subdomain
            to mydomain)
            with postfixadmin, and then All work without warnings for
            virtual_mailbox_domains and relay_domains

            How to overcome subdomain issue ? or is it an issue?

            /Markus
          • mouss
            ... so orebro.example.net is a virtual_mailbox_domains and relay_domains (the latter is probably because of parent_domain_matches_subdomains). if this is a
            Message 5 of 6 , Jan 2, 2008
            • 0 Attachment
              Markus Edholm wrote:
              > Wietse Venema wrote:
              >> Markus Edholm:
              >> [ Charset ISO-8859-1 unsupported, converting... ]
              >>> Hi List
              >>>
              >>> I?m feeling quite puzzled
              >>>
              >>> I have an "ordinary" mailserver that I now extended with an mysql table for
              >>> virtual mail forwarding.
              >>>
              >>> but I dont understand following error from mail.log:
              >>>
              >>> Jan 1 15:52:23 postfix postfix/trivial-rewrite[22495]: warning: do not list
              >>> domain orebro.example.net in BOTH virtual_mailbox_domains and relay_domains
              >> ...
              >>> relay_domains = example.net
              >>> virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
              >> What is the output of:
              >>
              >> $ postmap -q orebro.example.net \
              >> mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found
              >>
              >> The output should be: "not found".
              >>
              >> Wietse
              >
              > Hi!
              >
              > No
              >
              > #!/bin/bash
              > postmap -q orebro.example.net mysql:/etc/postfix/mysql_virtual_domains_maps.cf \
              > || echo not found
              >
              > output:
              > Örebro lokalavdelning
              >

              so orebro.example.net is a virtual_mailbox_domains and relay_domains
              (the latter is probably because of parent_domain_matches_subdomains).

              if this is a virtual mailbox domain, then adjust
              parent_domain_matches_subdomains.

              > So it replys with description field from mysql

              if it replies, then it is a virtual mailbox domain. make sure not any
              domain is a virtual mailbox one.

              >
              > (I take as you wanted me to run it as bash script)
              > from prompt I got:
              >
              > /etc/postfix# $ postmap -q orebro.example.net \
              > mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found
              > -bash: $: command not found
              > not found

              remove the '$' and try again (the '$' was meant as the prompt). run the
              following command:

              postmap -q orebro.example.net \
              mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found


              but it's the same as from a shell script.

              >
              >
              > Hmm, My file:
              > /etc/postfix# cat mysql_virtual_domains_maps.cf
              > user = postfixadmin
              > password = xxxxxxx
              > hosts = localhost
              > dbname = postfix
              > query = SELECT description FROM domain WHERE domain='%s' AND active = '1'
              >
              > I have used several different "howtos" maby I made some misstake and using wrong
              > files?
              >
              > /Markus
              >
            • mouss
              ... parent_domain_matches_subdomains = and specify subdomains explicitely when needed (add .domain version anywhere you rely on subdomains of domain ). see
              Message 6 of 6 , Jan 2, 2008
              • 0 Attachment
                Markus Edholm wrote:
                > Wietse Venema wrote:
                >> Markus Edholm:
                >> [ Charset ISO-8859-1 unsupported, converting... ]
                >>> Hi List
                >>>
                >>> I?m feeling quite puzzled
                >>>
                >>> I have an "ordinary" mailserver that I now extended with an mysql table for
                >>> virtual mail forwarding.
                >>>
                >>> but I dont understand following error from mail.log:
                >>>
                >>> Jan 1 15:52:23 postfix postfix/trivial-rewrite[22495]: warning: do not list
                >>> domain orebro.example.net in BOTH virtual_mailbox_domains and relay_domains
                >> ...
                >>> relay_domains = example.net
                >>> virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
                >> What is the output of:
                >>
                >> $ postmap -q orebro.example.net \
                >> mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found
                >>
                >> The output should be: "not found".
                >>
                >> Wietse
                >
                > OK, I see, sorry I did not told you whole story that spells "postfixadmin".
                > There I been forced to add new domain before add alias for that same virtual
                > domain. Then because it is a subdomain that I added I end up with error.
                > The mail works anyhow but it is not comfortable with errors and warnings in log.
                >
                > If I remove the domain from postfix.domain in mysql the error is gone, but then
                > I loose ability to add new aliases with postfixadmin web tool.
                >
                > So I made some more testing and added an other domain and alias (not subdomain
                > to mydomain)
                > with postfixadmin, and then All work without warnings for
                > virtual_mailbox_domains and relay_domains
                >
                > How to overcome subdomain issue ? or is it an issue?


                parent_domain_matches_subdomains =

                and specify subdomains explicitely when needed (add '.domain' version
                anywhere you rely on subdomains of 'domain'). see postconf(5) for more
                infos.
              Your message has been successfully submitted and would be delivered to recipients shortly.