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

some user must send email only mydomain

Expand Messages
  • Gabriele Di Giambelardini
    Hi to all I have a problem with my configuration, I don t found any solution on internet. My problem is: I d need some of my users can t send email to other
    Message 1 of 8 , Oct 31, 2008
    • 0 Attachment
      Hi to all
      I have a problem with my configuration, I don't found any solution on internet.
      My problem is:
      I'd need some of my users can't send email to other domain, but only to my domain...
      Some body know the way??
      thanks
    • Nikita Kipriyanov
      ... Have you tried http://www.postfix.org/RESTRICTION_CLASS_README.html#external ?
      Message 2 of 8 , Oct 31, 2008
      • 0 Attachment
        Gabriele Di Giambelardini пишет:
        > Hi to all
        > I have a problem with my configuration, I don't found any solution on internet.
        > My problem is:
        > I'd need some of my users can't send email to other domain, but only to my domain...
        > Some body know the way??
        > thanks
        >
        Have you tried
        http://www.postfix.org/RESTRICTION_CLASS_README.html#external ?
      • Gabriele Di Giambelardini
        ok I tried it but not work well. My postfix version is 2.3.8-2 ... queue_directory = /var/spool/postfix mail_owner = postfix myhostname = test.pippo.it
        Message 3 of 8 , Oct 31, 2008
        • 0 Attachment
          ok I tried it but not work well.

          My postfix version is 2.3.8-2


          this is my configuration:

          --------------------------------------------------------------------
          queue_directory = /var/spool/postfix

          mail_owner = postfix

          myhostname = test.pippo.it

          myorigin = $myhostname

          inet_interfaces = $myhostname,localhost

          unknown_local_recipient_reject_code = 550

          mynetworks = 127.0.0.0/8, 192.168.1.0/24, 192.168.2.0/24

          relayhost = 192.168.1.2

          double_bounce_sender=postmaster

          default_destination_concurrency_limit = 50

          debug_peer_level = 2

          mydestination = $myhostname, localhost.localdomain, localhost.localdomain, localhost

          alias_maps = hash:/etc/aliases,ldap:aliases
          alias_database = hash:/etc/aliases

          home_mailbox = Maildir/

          local_transport = local
          local_recipient_maps = unix:passwd.byname
          unknown_local_recipient_reject_code = 550
          forward_path = $home/.forward

          virtual_transport = virtual
          virtual_mailbox_domains = ldap:domains
          virtual_alias_maps = ldap:aliases
          virtual_uid_maps = static:1002
          virtual_gid_maps = static:1003
          virtual_mailbox_base = /var/vmail
          virtual_mailbox_maps = ldap:mailbox
          virtual_minimum_uid = 500

          aliases_server_host = 127.0.0.1
          aliases_search_base = dc=pippo,dc=it
          aliases_scope = sub
          aliases_query_filter = (|(&(mailAlternateAddress=%s)(objectClass=postUser))(&(mail=%s)(objectClass=postGroup)))
          #aliases_result_attribute = mail
          aliases_result_attribute = rfc822member
          aliases_bind = no

          mailbox_server_host = 127.0.0.1
          mailbox_search_base = dc=pippo,dc=it
          mailbox_scope = sub
          mailbox_query_filter = (|(&(mail=%s)(objectClass=postUser))(&(mailAlternateAddress=%s)(objectClass=postUser)))
          mailbox_result_attribute = homeDirectory
          mailbox_bind = no

          domains_server_host = 127.0.0.1
          domains_search_base = dc=pippo,dc=it
          domains_scope = sub
          domains_query_filter = (&(objectClass=dominiomail)(associateddomain=%s))
          domains_result_attribute = associateddomain
          domains_bind = no

          smtpd_recipient_restriction =
          check_sender_access hash:/etc/postfix/restricted_senders


          smtpd_restriction_classes = local_only
          local_only =
          check_recipient_access hash:/etc/postfix/local_domains,
          reject
          -----------------------------------------------------------------------------

          file /etc/postfix/restricted_senders:

          pippo@... local_only
          -----------------------------------------------------------------------------

          file /etc/postfix/local_domains

          pippo.it OK
          -------------------------------------------------------------------------------


          I tried to send an email by telnet command first on localhost, and then from an network on my permit_network, but the user pippo is allowed to send mail to avery domain....
          I wrong somethings???

          THANKS


          ________________________________________
          Da: owner-postfix-users@... [owner-postfix-users@...] per conto di Nikita Kipriyanov [merlin@...]
          Inviato: venerdì 31 ottobre 2008 10.39
          A: postfix-users@...
          Oggetto: Re: some user must send email only mydomain

          Gabriele Di Giambelardini пишет:
          > Hi to all
          > I have a problem with my configuration, I don't found any solution on internet.
          > My problem is:
          > I'd need some of my users can't send email to other domain, but only to my domain...
          > Some body know the way??
          > thanks
          >
          Have you tried
          http://www.postfix.org/RESTRICTION_CLASS_README.html#external ?
        • mouss
          ... Please show the output of postconf -n instead of main.cf. and no, don t fix the typo. use: smtpd_sender_restrictions = check_sender_access
          Message 4 of 8 , Nov 2, 2008
          • 0 Attachment
            Gabriele Di Giambelardini wrote:
            > ok I tried it but not work well.
            >
            > [snip]
            >
            > smtpd_recipient_restriction =
            > check_sender_access hash:/etc/postfix/restricted_senders
            >


            Please show the output of 'postconf -n' instead of main.cf.

            and no, don't fix the typo. use:
            smtpd_sender_restrictions =
            check_sender_access hash:/etc/postfix/restricted_senders



            > [snip]
          • Gabriele Di Giambelardini
            Ok, excuse me. Now I post my postconf -n: alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases,ldap:aliases config_directory = /etc/postfix
            Message 5 of 8 , Nov 3, 2008
            • 0 Attachment
              Ok, excuse me.
              Now I post my postconf -n:




              alias_database = hash:/etc/aliases
              alias_maps = hash:/etc/aliases,ldap:aliases
              config_directory = /etc/postfix
              debug_peer_level = 2
              default_destination_concurrency_limit = 50
              double_bounce_sender = postmaster
              forward_path = $home/.forward
              home_mailbox = Maildir/
              inet_interfaces = $myhostname,localhost
              local_recipient_maps = unix:passwd.byname
              local_transport = local
              mail_owner = postfix
              mydestination = $myhostname, localhost.localdomain, localhost.localdomain, localhost
              myhostname = hosting.pippo.it
              mynetworks = 127.0.0.0/8, 192.168.1.0/24, 192.168.2.0/24
              myorigin = $myhostname
              queue_directory = /var/spool/postfix
              relayhost = 192.168.1.4
              smtpd_restriction_classes = local_only
              unknown_local_recipient_reject_code = 550
              virtual_alias_maps = ldap:aliases
              virtual_gid_maps = static:1003
              virtual_mailbox_base = /var/vmail
              virtual_mailbox_domains = ldap:domains
              virtual_mailbox_maps = ldap:mailbox
              virtual_minimum_uid = 500
              virtual_transport = virtual
              virtual_uid_maps = static:1002

              THANKS



              Gabriele Di Giambelardini wrote:
              > ok I tried it but not work well.
              >
              > [snip]
              >
              > smtpd_recipient_restriction =
              > check_sender_access hash:/etc/postfix/restricted_senders
              >


              Please show the output of 'postconf -n' instead of main.cf.

              and no, don't fix the typo. use:
              smtpd_sender_restrictions =
              check_sender_access hash:/etc/postfix/restricted_senders



              > [snip]
            • mouss
              ... as you can see, there are no smtpd_*_restrictions, probably because of a typo in your main.cf (restrictsionS is plural). but don t fix the typo. use
              Message 6 of 8 , Nov 3, 2008
              • 0 Attachment
                Gabriele Di Giambelardini wrote:
                > Ok, excuse me.
                > Now I post my postconf -n:
                >
                >
                >
                >
                > alias_database = hash:/etc/aliases
                > alias_maps = hash:/etc/aliases,ldap:aliases
                > config_directory = /etc/postfix
                > debug_peer_level = 2
                > default_destination_concurrency_limit = 50
                > double_bounce_sender = postmaster
                > forward_path = $home/.forward
                > home_mailbox = Maildir/
                > inet_interfaces = $myhostname,localhost
                > local_recipient_maps = unix:passwd.byname
                > local_transport = local
                > mail_owner = postfix
                > mydestination = $myhostname, localhost.localdomain, localhost.localdomain, localhost
                > myhostname = hosting.pippo.it
                > mynetworks = 127.0.0.0/8, 192.168.1.0/24, 192.168.2.0/24
                > myorigin = $myhostname
                > queue_directory = /var/spool/postfix
                > relayhost = 192.168.1.4
                > smtpd_restriction_classes = local_only
                > unknown_local_recipient_reject_code = 550
                > virtual_alias_maps = ldap:aliases
                > virtual_gid_maps = static:1003
                > virtual_mailbox_base = /var/vmail
                > virtual_mailbox_domains = ldap:domains
                > virtual_mailbox_maps = ldap:mailbox
                > virtual_minimum_uid = 500
                > virtual_transport = virtual
                > virtual_uid_maps = static:1002
                >

                as you can see, there are no smtpd_*_restrictions, probably because of a
                typo in your main.cf (restrictsionS is plural). but don't fix the typo.
                use smtpd_sender_restrictions as I suggested.
              • Gabriele Di Giambelardini
                Ok, I used that directive, now my postconf -n is this: alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases,ldap:aliases config_directory =
                Message 7 of 8 , Nov 3, 2008
                • 0 Attachment
                  Ok, I used that directive, now my postconf -n is this:

                  alias_database = hash:/etc/aliases
                  alias_maps = hash:/etc/aliases,ldap:aliases
                  config_directory = /etc/postfix
                  debug_peer_level = 2
                  default_destination_concurrency_limit = 50
                  double_bounce_sender = postmaster
                  forward_path = $home/.forward
                  home_mailbox = Maildir/
                  inet_interfaces = $myhostname,localhost
                  local_recipient_maps = unix:passwd.byname
                  local_transport = local
                  mail_owner = postfix
                  mydestination = $myhostname, localhost.localdomain, localhost.localdomain, localhost
                  myhostname = hosting.pippo.it
                  mynetworks = 127.0.0.0/8, 192.168.1.0/24, 192.168.2.0/24
                  myorigin = $myhostname
                  queue_directory = /var/spool/postfix
                  relayhost = 192.168.1.4
                  smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/restricted_ senders
                  smtpd_restriction_classes = local_only
                  unknown_local_recipient_reject_code = 550
                  virtual_alias_maps = ldap:aliases
                  virtual_gid_maps = static:1003
                  virtual_mailbox_base = /var/vmail
                  virtual_mailbox_domains = ldap:domains
                  virtual_mailbox_maps = ldap:mailbox
                  virtual_minimum_uid = 500
                  virtual_transport = virtual
                  virtual_uid_maps = static:1002
                  ---------------------------------------------

                  but this is my error in log file:


                  daemon started -- version 2.3.8, configuration /etc/postfix
                  Nov 3 14:05:44 hosting postfix/smtpd[31371]: fatal: parameter "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit
                  Nov 3 14:05:45 hosting postfix/master[31350]: warning: process /usr/lib/postfix/smtpd pid 31371 exit status 1
                  Nov 3 14:05:45 hosting postfix/master[31350]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling


                  I don't understand....



                  Gabriele Di Giambelardini wrote:
                  > Ok, excuse me.
                  > Now I post my postconf -n:
                  >
                  >
                  >
                  >
                  > alias_database = hash:/etc/aliases
                  > alias_maps = hash:/etc/aliases,ldap:aliases
                  > config_directory = /etc/postfix
                  > debug_peer_level = 2
                  > default_destination_concurrency_limit = 50
                  > double_bounce_sender = postmaster
                  > forward_path = $home/.forward
                  > home_mailbox = Maildir/
                  > inet_interfaces = $myhostname,localhost
                  > local_recipient_maps = unix:passwd.byname
                  > local_transport = local
                  > mail_owner = postfix
                  > mydestination = $myhostname, localhost.localdomain, localhost.localdomain, localhost
                  > myhostname = hosting.pippo.it
                  > mynetworks = 127.0.0.0/8, 192.168.1.0/24, 192.168.2.0/24
                  > myorigin = $myhostname
                  > queue_directory = /var/spool/postfix
                  > relayhost = 192.168.1.4
                  > smtpd_restriction_classes = local_only
                  > unknown_local_recipient_reject_code = 550
                  > virtual_alias_maps = ldap:aliases
                  > virtual_gid_maps = static:1003
                  > virtual_mailbox_base = /var/vmail
                  > virtual_mailbox_domains = ldap:domains
                  > virtual_mailbox_maps = ldap:mailbox
                  > virtual_minimum_uid = 500
                  > virtual_transport = virtual
                  > virtual_uid_maps = static:1002
                  >

                  as you can see, there are no smtpd_*_restrictions, probably because of a
                  typo in your main.cf (restrictsionS is plural). but don't fix the typo.
                  use smtpd_sender_restrictions as I suggested.
                • mouss
                  ... you don t read carefully. I said: but don t fix the typo. use smtpd_sender_restrictions as I suggested. it s smtpd_SENDER_restrictions. sender, not
                  Message 8 of 8 , Nov 3, 2008
                  • 0 Attachment
                    Gabriele Di Giambelardini wrote:
                    > Ok, I used that directive, now my postconf -n is this:
                    > [snip]
                    > daemon started -- version 2.3.8, configuration /etc/postfix
                    > Nov 3 14:05:44 hosting postfix/smtpd[31371]: fatal: parameter "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit
                    > Nov 3 14:05:45 hosting postfix/master[31350]: warning: process /usr/lib/postfix/smtpd pid 31371 exit status 1
                    > Nov 3 14:05:45 hosting postfix/master[31350]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
                    >
                    >
                    > I don't understand....
                    >

                    you don't read carefully. I said:
                    "but don't fix the typo. use smtpd_sender_restrictions as I suggested."

                    it's smtpd_SENDER_restrictions. sender, not recipient.

                    your smtpd_recipient_restrictions is not acceptable, because it makes
                    you an open relay. it's possible to fix it, but using
                    smtpd_sender_restrictions is safer (and easier).
                  Your message has been successfully submitted and would be delivered to recipients shortly.