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

Re: Postfix with PostgreSQL

Expand Messages
  • Barney Desmond
    ... Yep. For the record, you ll need Postgres packages installed before building the Postfix RPM because the build process needs to link to Postgres libraries.
    Message 1 of 27 , May 31, 2009
    • 0 Attachment
      2009/6/1 Just E. Mail <justemail@...>:
      > I installed postfix-2.6.1 (SRPM from Simon Mudd's web site) on a freshly
      > installed LINUX CentOS 5.3 machine. I followed Roger Mudd's Instructions
      > (see http://postfix.wl0.org/en/building-rpms/). Subsequently,I build a local
      > RPM by following these instructions. I did include PostgreSQL:
      >
      > # export POSTFIX_PGSQL=1
      >
      > After Postfix installation is completed (again following the instructions by
      > Simon Mudd), I displaed the list of packages included with Postfix:
      >
      > [root@rs1 ~]# postconf -m
      > btree
      > cidr
      > environ
      > hash
      > ldap
      > nis
      > proxy
      > regexp
      > static
      > unix
      > [root@rs1 ~]#
      > As you will notice that PostgreSQL is not listed. In any case, I did setup
      > Postfix & Dovecot-SASL and tested it successfully. Now I want to setup
      > PostgreSQL as backend. FYI, I did check the file
      > /etc/postfix/pgsql-aliases.cf & it does not exists. I belive it is because
      > of the same reason; PostgrSQL is not installed with Postfix!

      2009/6/1 Just E. Mail <justemail@...>:
      > I reinstalled Postfix with PostgreSQL. This time it seems that PG is
      > included.

      Yep. For the record, you'll need Postgres packages installed before
      building the Postfix RPM because the build process needs to link to
      Postgres libraries. This is the bit from the RPM specfile that relates
      to Postgres:

      %if %{with_pgsql}
      Requires: postgresql-libs
      BuildRequires: postgresql-devel
      %endif
    • Just E. Mail
      CentOS 5.3 PostgreSQL 8.3.7 Postfix 2.6.1 I have setup a Postfix Mail Server & tested it. Now I am trying to setup Postfix with PostgreSQL as backend. I did
      Message 2 of 27 , Jun 2, 2009
      • 0 Attachment
        CentOS 5.3
        PostgreSQL 8.3.7
        Postfix 2.6.1

        I have setup a Postfix Mail Server & tested it. Now I am trying to setup
        Postfix with PostgreSQL as backend. I did build (by following Simon
        Mudd's instructions) Postfix with PGSQL support. I have done
        considerable reading and searched the Internet, but I need help me with
        the following questions:

        1. I have read 'man psql_table' & 'Postfix PostgreSQL Howto' (at
        www.postfix.org). The first document says that the 'alias_maps' are
        located at 'etc/pgsql-aliase' and the second document says that they are
        at 'etc/postfix/pgsql-aliases.cf'. I assume that 'pgsql-aliases.cf' can
        be in either folder as long as it is similarly listed in
        '/etc/postfix/main.cf'. Am I corrent or not?

        2. I have not found the DEFAULT file 'pgsql-aliases.cf' anywhere on the
        Postfix server. Do I need to build it myself?

        3. On the backend SQL server, what Postfix tables are need? Is there a
        SCHEMA for these tables or they are hand build?

        Considering I am a NEWBIE, your help is highly appreciated.

        Jennifer K.
      • Magnus Bäck
        On Tuesday, June 02, 2009 at 18:28 CEST, ... You can call the file whatever you want. The filename pgsql-aliases.cf is just an example. ... Yes. ... You can
        Message 3 of 27 , Jun 2, 2009
        • 0 Attachment
          On Tuesday, June 02, 2009 at 18:28 CEST,
          "Just E. Mail" <justemail@...> wrote:

          > CentOS 5.3
          > PostgreSQL 8.3.7
          > Postfix 2.6.1
          >
          > I have setup a Postfix Mail Server & tested it. Now I am trying to
          > setup Postfix with PostgreSQL as backend. I did build (by following
          > Simon Mudd's instructions) Postfix with PGSQL support. I have done
          > considerable reading and searched the Internet, but I need help me
          > with the following questions:
          >
          > 1. I have read 'man psql_table' & 'Postfix PostgreSQL Howto' (at
          > www.postfix.org). The first document says that the 'alias_maps' are
          > located at 'etc/pgsql-aliase' and the second document says that they
          > are at 'etc/postfix/pgsql-aliases.cf'. I assume that
          > 'pgsql-aliases.cf' can be in either folder as long as it is similarly
          > listed in '/etc/postfix/main.cf'. Am I corrent or not?

          You can call the file whatever you want. The filename pgsql-aliases.cf
          is just an example.

          > 2. I have not found the DEFAULT file 'pgsql-aliases.cf' anywhere on
          > the Postfix server. Do I need to build it myself?

          Yes.

          > 3. On the backend SQL server, what Postfix tables are need? Is there a
          > SCHEMA for these tables or they are hand build?

          You can choose any schema you like as long as you can construct an
          SQL query that returns the desired data given the input Postfix will
          provide. The input depends on each table; for alias_maps Postfix the
          input is the localpart of the email address, as documented in aliases(5).

          --
          Magnus Bäck
          magnus@...
        • Just E. Mail
          ... I appreciate if someone can post or email me a sample copy of: a. A Schema of Postfix-PGSQL tables/keys b. A copy of the pgsql-aliases.cf Highly
          Message 4 of 27 , Jun 2, 2009
          • 0 Attachment
            Magnus Bäck wrote:
            > 3. On the backend SQL server, what Postfix tables are need? Is there a
            > SCHEMA for these tables or they are hand build?
            >
            >
            > You can choose any schema you like as long as you can construct an
            > SQL query that returns the desired data given the input Postfix will
            > provide. The input depends on each table; for alias_maps Postfix the
            > input is the localpart of the email address, as documented in aliases(5).
            >
            I appreciate if someone can post or email me a sample copy of:

            a. A Schema of Postfix-PGSQL tables/keys
            b. A copy of the pgsql-aliases.cf

            Highly appreciated.

            Jenn
          • Brian Evans - Postfix List
            ... a. Be creative. Postfix does not care about schema itself. It simply runs the query in the map. b. Modify the example in
            Message 5 of 27 , Jun 2, 2009
            • 0 Attachment
              Just E. Mail wrote:
              > Magnus Bäck wrote:
              >> 3. On the backend SQL server, what Postfix tables are need? Is there a
              >> SCHEMA for these tables or they are hand build?
              >>
              >> You can choose any schema you like as long as you can construct an
              >> SQL query that returns the desired data given the input Postfix will
              >> provide. The input depends on each table; for alias_maps Postfix the
              >> input is the localpart of the email address, as documented in
              >> aliases(5).
              >>
              > I appreciate if someone can post or email me a sample copy of:
              >
              > a. A Schema of Postfix-PGSQL tables/keys
              > b. A copy of the pgsql-aliases.cf

              a. Be creative. Postfix does not care about schema itself. It simply
              runs the query in the map.

              b. Modify the example in http://www.postfix.org/PGSQL_README.html to the
              schema YOU create.
              This can be named anything. Postfix does not require map files to be
              named certain things.

              Brian
            • Victor Duchovni
              ... Why are you trying to use Postgres with Postfix if you don t actually know what the Postgres part is for? Start by answering the question: - What data will
              Message 6 of 27 , Jun 2, 2009
              • 0 Attachment
                On Tue, Jun 02, 2009 at 02:28:34PM -0600, Just E. Mail wrote:

                > I appreciate if someone can post or email me a sample copy of:
                >
                > a. A Schema of Postfix-PGSQL tables/keys
                > b. A copy of the pgsql-aliases.cf

                Why are you trying to use Postgres with Postfix if you don't actually
                know what the Postgres part is for?

                Start by answering the question:

                - What data will I be storing in Postgres?
                - Why Postgres and not a CDB file, or similar?

                First get Postfix working with simple tools, add complexity slowly.

                --
                Viktor.

                Disclaimer: off-list followups get on-list replies or get ignored.
                Please do not ignore the "Reply-To" header.

                To unsubscribe from the postfix-users list, visit
                http://www.postfix.org/lists.html or click the link below:
                <mailto:majordomo@...?body=unsubscribe%20postfix-users>

                If my response solves your problem, the best way to thank me is to not
                send an "it worked, thanks" follow-up. If you must respond, please put
                "It worked, thanks" in the "Subject" so I can delete these quickly.
              • Just E. Mail
                ... I am setting up LVS. I have two Real Servers running CentOS, PostgeSQL Client, freeRADIUS, Postfix, etc. Both of the Real Servers access data from the
                Message 7 of 27 , Jun 2, 2009
                • 0 Attachment
                  Victor Duchovni wrote:
                  > On Tue, Jun 02, 2009 at 02:28:34PM -0600, Just E. Mail wrote:
                  >
                  >
                  >> I appreciate if someone can post or email me a sample copy of:
                  >>
                  >> a. A Schema of Postfix-PGSQL tables/keys
                  >> b. A copy of the pgsql-aliases.cf
                  >>
                  >
                  > Why are you trying to use Postgres with Postfix if you don't actually
                  > know what the Postgres part is for?
                  >
                  > Start by answering the question:
                  >
                  > - What data will I be storing in Postgres?
                  > - Why Postgres and not a CDB file, or similar?
                  >
                  > First get Postfix working with simple tools, add complexity slowly.
                  >
                  >
                  I am setting up LVS. I have two Real Servers running CentOS, PostgeSQL
                  Client, freeRADIUS, Postfix, etc. Both of the Real Servers access data
                  from the backend PostgreSQL Server.

                  I have setup freeRADIUS application. It authenticates users from the SQL
                  database. Postfix is much more flexible where it is open to creating
                  Schema to one's own design. There is no sample Schema to start with.
                  That's why I have so many questions but I am trying hard. I do have
                  Postfix working (but not with PGSQL)!

                  Thank you for your help.

                  Jennifer K.
                • Victor Duchovni
                  ... Well, what data is in that database that you would like to query? Or alternatively what does your Postfix installation need to know from an external source
                  Message 8 of 27 , Jun 2, 2009
                  • 0 Attachment
                    On Tue, Jun 02, 2009 at 05:24:04PM -0600, Just E. Mail wrote:

                    >> Start by answering the question:
                    >>
                    >> - What data will I be storing in Postgres?
                    >> - Why Postgres and not a CDB file, or similar?
                    >>
                    >> First get Postfix working with simple tools, add complexity slowly.
                    >
                    > I am setting up LVS. I have two Real Servers running CentOS, PostgeSQL
                    > Client, freeRADIUS, Postfix, etc. Both of the Real Servers access data from
                    > the backend PostgreSQL Server.

                    Well, what data is in that database that you would like to query? Or
                    alternatively what does your Postfix installation need to know from
                    an external source that it does not currently have available to it
                    directly via its existing config files?

                    - Rewrite tables for virtual alias users?
                    - Aliases(5) tables for system users?
                    - Transport(5) tables for selecting per-user relayhosts
                    (not recommended, use virtual(5) instead if possible)
                    - ...

                    > I have setup freeRADIUS application. It authenticates users from the SQL
                    > database. Postfix is much more flexible where it is open to creating Schema
                    > to one's own design. There is no sample Schema to start with. That's why I
                    > have so many questions but I am trying hard. I do have Postfix working (but
                    > not with PGSQL)!

                    Yes, but what is the *purpose* of having Postfix query Postgres. That
                    can't be a goal in itself. What data do you need?

                    --
                    Viktor.

                    Disclaimer: off-list followups get on-list replies or get ignored.
                    Please do not ignore the "Reply-To" header.

                    To unsubscribe from the postfix-users list, visit
                    http://www.postfix.org/lists.html or click the link below:
                    <mailto:majordomo@...?body=unsubscribe%20postfix-users>

                    If my response solves your problem, the best way to thank me is to not
                    send an "it worked, thanks" follow-up. If you must respond, please put
                    "It worked, thanks" in the "Subject" so I can delete these quickly.
                  • Charles Marcus
                    ... If you already have a functioning pgsql server authenticating users, then why not simply use that? Define a .cf map query that will work against your
                    Message 9 of 27 , Jun 3, 2009
                    • 0 Attachment
                      On 6/2/2009, Just E. Mail (justemail@...) wrote:
                      > I am setting up LVS. I have two Real Servers running CentOS,
                      > PostgeSQL Client, freeRADIUS, Postfix, etc. Both of the Real Servers
                      > access data from the backend PostgreSQL Server.
                      >
                      > I have setup freeRADIUS application. It authenticates users from the
                      > SQL database. Postfix is much more flexible where it is open to
                      > creating Schema to one's own design. There is no sample Schema to
                      > start with. That's why I have so many questions but I am trying hard.
                      > I do have Postfix working (but not with PGSQL)!

                      If you already have a functioning pgsql server authenticating users,
                      then why not simply use that? Define a .cf map query that will work
                      against your *current* *working* schema, and just point it to your
                      current/working SQL server...

                      Or maybe I'm not understanding something?

                      --

                      Best regards,

                      Charles
                    • Just E. Mail
                      I have this posting out for couple of days and many Techies from this mailing list responded with suggestions. I did not understand any one of them because I
                      Message 10 of 27 , Jun 3, 2009
                      • 0 Attachment
                        I have this posting out for couple of days and many Techies from this
                        mailing list responded with suggestions. I did not understand any one of
                        them because I am a NEWBIE and I was thinking more closed in a SQL box
                        and thinking of Postfix using the backend PGSQL in some what a
                        conventional way - database, schema, quiries, so on...

                        So today with good night sleep, I got up and read "POSTFIX - The
                        Definitive Guide" by Kyle D. Dent & it made sense. So now I understand
                        that in Postfix there are MAPS for Data/Information. Each MAP handles a
                        particular data. For example a MAP for Virtual Domains handles a list of
                        Virtual Domains, an Aliases Map has a list of emails pointing to other
                        emails (forwarding), etc. One has to configure each MAP to retrieve its
                        underlying data/information from a table or a database.

                        This is very good design used in Postfix but not understanding it
                        clearly got me down. Now I can setup one or more MAPS to connect to
                        backend PGSQL as Imake progress.

                        Thank you all.

                        I have only one more wish; I wish there was a list of all the MAPS used
                        in Postfix?

                        Jennifer King
                      • Victor Duchovni
                        ... You really don t want this. Less is more. Only define or override Postfix parameters that implement a non-default behaviour you need to control in order to
                        Message 11 of 27 , Jun 3, 2009
                        • 0 Attachment
                          On Wed, Jun 03, 2009 at 09:05:16AM -0600, Just E. Mail wrote:

                          > I have only one more wish; I wish there was a list of all the MAPS used in
                          > Postfix?

                          You really don't want this. Less is more. Only define or override Postfix
                          parameters that implement a non-default behaviour you need to control
                          in order to achieve a particular behaviour.

                          Generally, stick to what's described in:

                          - An example configuration in the (in your case O'Reilly) book, or

                          * BASIC_CONFIGURATION_README.html
                          * STANDARD_CONFIGURATION_README.html
                          * ADDRESS_REWRITING_README.html
                          * ADDRESS_CLASS_README.html
                          * VIRTUAL_README.html
                          * TLS_README.html
                          * SASL_README.html
                          * QSHAPE_README.html
                          * ... other tutorials in http://www.postfix.org/documentation.html

                          Venture into any given tutorial as and when necessary, otherwise read them
                          slowly approximately in the order suggested. Resist the urge to tweak
                          parameters (except on test servers) unless it is *vital* to change them
                          from their default value, cosmetic changes will only cause you grief later.

                          --
                          Viktor.

                          Disclaimer: off-list followups get on-list replies or get ignored.
                          Please do not ignore the "Reply-To" header.

                          To unsubscribe from the postfix-users list, visit
                          http://www.postfix.org/lists.html or click the link below:
                          <mailto:majordomo@...?body=unsubscribe%20postfix-users>

                          If my response solves your problem, the best way to thank me is to not
                          send an "it worked, thanks" follow-up. If you must respond, please put
                          "It worked, thanks" in the "Subject" so I can delete these quickly.
                        Your message has been successfully submitted and would be delivered to recipients shortly.