Hello all,
I am trying to setup a mailing list server using OpenSmtpd using postgres
tables.
My (stripped down) smtp.conf:
——————————————————————————————————————————
1 table domains postgres:/etc/mail/postgres.conf
2 table virtuals postgres:/etc/mail/postgres.conf
3 table senders postgres:/etc/mail/postgres.conf
4 #
5 listen on egress port 25
6 #
7 action "local" mbox alias <virtuals>
8
9 match from mail-from <senders> for domain <domains> action "local"
-------------------------------------------
postgres.conf:
1 conninfo host='localhost' user='mailman' password='mailman'
dbname='test'
2 query_alias SELECT destination FROM virtuals WHERE
email=$1;
3 query_credentials SELECT email, password FROM credentials WHERE
email=$1;
4 query_domain SELECT domain FROM domains WHERE
domain=$1;
5 query_mailaddr SELECT email FROM senders WHERE
alias=$1;
———————————————————————————————————
The table definition:
# psql -h localhost -U mailman test
psql (16.4)
Type "help" for help.
test=> \d senders
Table "public.senders"
Column | Type | Collation | Nullable | Default
--------+------------------------+-----------+----------+-------------------------------------
id | integer | | not null |
nextval('senders_id_seq'::regclass)
alias | character varying(255) | | |
email | character varying(255) | | |
—————————————————————
When I try to start smtpd, I get:
# smtpd -n
/etc/mail/smtpd.conf:3: syntax error
/etc/mail/smtpd.conf:9: syntax error
warn: no rules, nothing to do
———————————————————————
The error about line 9 ist ok, because the table declaration for <senders> ist
not accepted. But what is wrong with line 3?
Also, how does /usr/local/libexec/smtpd/table-postgres know what postgres table
to select for the smtpd table ‘senders’?
Where is the link between line 3 in smtpd.conf and line 5 in postgres.conf? It
seems that I am missing something here!
OpenBSD mail.rebehn.net 7.6 GENERIC.MP#338 amd64
postgresql-server-16.4p0
Thanks for any help,
-Heinrich