<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.qmailtoaster.org:80/index.php?action=history&amp;feed=atom&amp;title=Dspam_w%2FPostgreSQL</id>
	<title>Dspam w/PostgreSQL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.qmailtoaster.org:80/index.php?action=history&amp;feed=atom&amp;title=Dspam_w%2FPostgreSQL"/>
	<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=Dspam_w/PostgreSQL&amp;action=history"/>
	<updated>2026-04-29T03:47:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>http://wiki.qmailtoaster.org:80/index.php?title=Dspam_w/PostgreSQL&amp;diff=829&amp;oldid=prev</id>
		<title>Ebroch at 17:10, 30 March 2024</title>
		<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=Dspam_w/PostgreSQL&amp;diff=829&amp;oldid=prev"/>
		<updated>2024-03-30T17:10:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:10, 30 March 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Dspam|Back]]&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Assumes Dspam is already installed&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Assumes Dspam is already installed&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ebroch</name></author>
	</entry>
	<entry>
		<id>http://wiki.qmailtoaster.org:80/index.php?title=Dspam_w/PostgreSQL&amp;diff=551&amp;oldid=prev</id>
		<title>Ebroch: Created page with &quot;&lt;pre&gt; Assumes Dspam is already installed  (1) Install and start postgresql  # dnf install postgresql-server postgresql-contrib dspam-pgsql  # postgresql-setup --initdb  # systemctl enable --now postgresql  # systemctl status postgresql   (2) Edit postgres files:  # /var/lib/pgsql/data/postgresql.conf     listen_addresses = &#039;0.0.0.0&#039; # IPv4     listen_addresses = &#039;*&#039;       # IPv4/6     port = 5432    # /var/lib/pgsql/data/pg_hba.conf     # IPv4 local connections:     #hos...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.qmailtoaster.org:80/index.php?title=Dspam_w/PostgreSQL&amp;diff=551&amp;oldid=prev"/>
		<updated>2024-03-27T05:01:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; Assumes Dspam is already installed  (1) Install and start postgresql  # dnf install postgresql-server postgresql-contrib dspam-pgsql  # postgresql-setup --initdb  # systemctl enable --now postgresql  # systemctl status postgresql   (2) Edit postgres files:  # /var/lib/pgsql/data/postgresql.conf     listen_addresses = &amp;#039;0.0.0.0&amp;#039; # IPv4     listen_addresses = &amp;#039;*&amp;#039;       # IPv4/6     port = 5432    # /var/lib/pgsql/data/pg_hba.conf     # IPv4 local connections:     #hos...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Assumes Dspam is already installed&lt;br /&gt;
&lt;br /&gt;
(1) Install and start postgresql&lt;br /&gt;
 # dnf install postgresql-server postgresql-contrib dspam-pgsql&lt;br /&gt;
 # postgresql-setup --initdb&lt;br /&gt;
 # systemctl enable --now postgresql&lt;br /&gt;
 # systemctl status postgresql&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(2) Edit postgres files:&lt;br /&gt;
 # /var/lib/pgsql/data/postgresql.conf&lt;br /&gt;
    listen_addresses = &amp;#039;0.0.0.0&amp;#039; # IPv4&lt;br /&gt;
    listen_addresses = &amp;#039;*&amp;#039;       # IPv4/6&lt;br /&gt;
    port = 5432  &lt;br /&gt;
 # /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
    # IPv4 local connections:&lt;br /&gt;
    #host    all             all             127.0.0.1/32            ident&lt;br /&gt;
    host    all             all             127.0.0.1/32            md5&lt;br /&gt;
&lt;br /&gt;
(3) PostgreSQL User/DB creation:&lt;br /&gt;
           # adduser dspampg&lt;br /&gt;
           # passwd dspampg (p4ssw3rd)&lt;br /&gt;
           # su - postgres&lt;br /&gt;
           $ createdb dspam&lt;br /&gt;
           $ psql -d dspam -f /usr/share/dspam/sql-scripts/pgsql/pgsql_objects.sql&lt;br /&gt;
           $ psql -d dspam -f /usr/share/dspam/sql-scripts/pgsql/virtual_users.sql&lt;br /&gt;
           $ psql dspam&lt;br /&gt;
     dspam=#&lt;br /&gt;
     dspam=# \d&lt;br /&gt;
                             List of relations&lt;br /&gt;
           Schema |          Name          |   Type   |  Owner&lt;br /&gt;
          --------+------------------------+----------+----------&lt;br /&gt;
           public | dspam_preferences      | table    | postgres&lt;br /&gt;
           public | dspam_signature_data   | table    | postgres&lt;br /&gt;
           public | dspam_stats            | table    | postgres&lt;br /&gt;
           public | dspam_token_data       | table    | postgres&lt;br /&gt;
           public | dspam_virtual_uids     | table    | postgres&lt;br /&gt;
           public | dspam_virtual_uids_seq | sequence | postgres&lt;br /&gt;
          (6 rows)&lt;br /&gt;
&lt;br /&gt;
     dspam=# \q&lt;br /&gt;
           $&lt;br /&gt;
           $ psql template1&lt;br /&gt;
 template1=# CREATE USER dspampg WITH PASSWORD &amp;#039;p4ssw3rd&amp;#039;;&lt;br /&gt;
 template1=# GRANT ALL PRIVILEGES ON DATABASE dspam TO dspampg;&lt;br /&gt;
 template1=# \q&lt;br /&gt;
           $ psql -c &amp;quot;ALTER USER dspampg WITH SUPERUSER&amp;quot; (May not need to do the next 3 commands)&lt;br /&gt;
           $ psql -d dspam -c &amp;quot;GRANT ALL PRIVILEGES ON ALL TABLES    IN SCHEMA public to dspampg&amp;quot;&lt;br /&gt;
           $ psql -d dspam -c &amp;quot;GRANT ALL PRIVILEGES ON ALL SEQUENCES    IN SCHEMA public to dspampg&amp;quot;&lt;br /&gt;
           $ psql -d dspam -c &amp;quot;GRANT ALL PRIVILEGES ON ALL FUNCTIONS    IN SCHEMA public to dspampg&amp;quot;&lt;br /&gt;
           $ exit&lt;br /&gt;
           # systemctl restart postgresql&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(4) Dspam configuration:&lt;br /&gt;
           # vi /etc/dspam.conf (comment mysql, uncomment pgsql)&lt;br /&gt;
              (1)&lt;br /&gt;
              #StorageDriver /usr/lib64/dspam/libmysql_drv.so&lt;br /&gt;
              StorageDriver /usr/lib64/dspam/libpgsql_drv.so&lt;br /&gt;
&lt;br /&gt;
              (2)&lt;br /&gt;
              #&lt;br /&gt;
              # Storage driver settings: Specific to a particular storage driver. Uncomment&lt;br /&gt;
              # the configuration specific to your installation, if applicable.&lt;br /&gt;
              #&lt;br /&gt;
              #MySQLServer            /var/lib/mysql/mysql.sock&lt;br /&gt;
              #MySQLPort&lt;br /&gt;
              #MySQLUser              dspam&lt;br /&gt;
              #MySQLPass              p4ssw3rd&lt;br /&gt;
              #MySQLDb                dspam&lt;br /&gt;
              #MySQLCompress          true&lt;br /&gt;
              #MySQLReconnect         true&lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
              # --- PostgreSQL ---&lt;br /&gt;
&lt;br /&gt;
              # For PgSQLServer you can Use a TCP/IP address or a socket. If your socket is&lt;br /&gt;
              # in /var/run/postgresql/.s.PGSQL.5432 specify just the path where the socket&lt;br /&gt;
              # resits (without .s.PGSQL.5432).&lt;br /&gt;
&lt;br /&gt;
              PgSQLServer             127.0.0.1&lt;br /&gt;
              PgSQLPort               5432&lt;br /&gt;
              PgSQLUser               dspampg&lt;br /&gt;
              PgSQLPass               p4ssw3rd&lt;br /&gt;
              PgSQLDb                 dspam&lt;br /&gt;
              &lt;br /&gt;
(5) Restart dspam&lt;br /&gt;
           # systemctl restart dspam&lt;br /&gt;
           # systemctl status dspam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(6) Test connection with dspam paramters to PostreSQL&lt;br /&gt;
           # psql -h 127.0.0.1 -U dspampg -d dspam --port=5432  --password&lt;br /&gt;
             password: &lt;br /&gt;
               psql (13.13)&lt;br /&gt;
               Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
               dspam=&amp;gt;&lt;br /&gt;
               dspam=&amp;gt;\q&lt;br /&gt;
           &amp;lt;success&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ebroch</name></author>
	</entry>
</feed>