dbTalk Databases Forums  

Problem with Postgresql and postfix

comp.databases.postgresql comp.databases.postgresql


Discuss Problem with Postgresql and postfix in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
BLADELA
 
Posts: n/a

Default Problem with Postgresql and postfix - 12-23-2006 , 07:00 AM






i'm creating a db to store mail account's data user by postfix

i created the tables, i inserted some test accounts and i created an user
(postfix) used by postfix to access the db

i granted select right to this user, but when postfix tried to use the db,
i received this error :

[postgres.log]
2006-12-21 17:18:17 [10729] LOG: connection authorized: user=postfix
database=mail_miohost
2006-12-21 17:18:17 [10729] ERROR: Permission Denied to the Relation
domains

[mail.log]
Dec 21 17:16:13 p2-debian postfix/trivial-rewrite[10620]: warning: connect
to pgsql server 192.168.1.5: fe_sendauth: no password supplied? Dec 21
17:16:13 p2-debian postfix/cleanup[10619]: 8A7F42014A:
message-id=<20061221161613.8A7F42014A (AT) miohost (DOT) it> Dec 21 17:16:13
p2-debian postfix/qmgr[10615]: 8A7F42014A:
from=<root (AT) miohost (DOT) it>,
size=443, nrcpt=1 (queue active) Dec 21 17:16:13 p2-debian
postfix/trivial-rewrite[10620]: fatal:
pgsql:/etc/postfix/transport.cf(0,100): table lookup problem Dec 21
17:16:14 p2-debian postfix/qmgr[10615]: warning: premature end-of-input on
private/rewrite socket while reading input attribute name Dec 21 17:16:14
p2-debian postfix/qmgr[10615]: warning: problem talking to service
rewrite: Success Dec 21 17:16:14 p2-debian postfix/master[1756]: warning:
process /usr/lib/postfix/trivial-rewrite pid 10620 exit status 1

postfix is correctly(i think) configurated :

[main.cf]
virtual_maps = hash:/etc/postfix/virtual
virtual_mailbox_base =/var/spool/mail/vhosts
virtual_minimum_uid = 10000
virtual_uid_maps = pgsql:/etc/postfix/uids.cf
virtual_minimum_gid = 10000
virtual_gif_maps = pgsql:/etc/postfix/virtual.cf
virtual_mailbox_domains = pgsql:/etc/postfix/transport.cf
virtual_mailbox_maps = pgsql:/etc/postfix/mailboxes.cf


and one of postfix external configuration file

[transport.cf]:
#domain transport information
hosts = 192.168.1.5
user = postfix
password = postfix
dbname = mail_miohost
table = domains
select_field = transport
where_field = domain

this is in pg_hba.conf
postfix 192.168.1.5 255.255.255.255 password


i had errors even if i try to access the db with "postfix" user using psql -U
i've created it (the user) with the standard procedure(login as "postgres"
user and with "createuser")

i'm using Debian Sarge on Athlon XP 1250, Kernel 2.4.27-3-k7
Postgresql 7.4
postfix at the last version available(i can't access the server now)

thanks for any suggestion and...i'm sorry for my English


ciao
BLADELA from Italy
--
"Resistance is Chuck Norris"


--
"Resistance is Chuck Norris"

Reply With Quote
  #2  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Problem with Postgresql and postfix - 12-27-2006 , 04:23 AM






BLADELA <bladea (AT) nospamhotmail (DOT) com> wrote:
Quote:
i'm creating a db to store mail account's data user by postfix

i created the tables, i inserted some test accounts and i created an user
(postfix) used by postfix to access the db

i granted select right to this user, but when postfix tried to use the db,
i received this error :

[postgres.log]
2006-12-21 17:18:17 [10729] LOG: connection authorized: user=postfix
database=mail_miohost
2006-12-21 17:18:17 [10729] ERROR: Permission Denied to the Relation
domains
The error message is a little strange - maybe that's because you use
version 7.4, while I have 8.2 here.
On my system, this error would look like:

ERROR: permission denied for relation domains

The error means that user 'postfix' does not have permission to access
table 'domains' in database 'mail_miohost'.

Probably you did something wrong when you 'granted select right to this
user'. Could you tell us the exact command(s) you used to grant these rights?

The following log is from _before_ the above messages:

Quote:
[mail.log]
Dec 21 17:16:13 p2-debian postfix/trivial-rewrite[10620]: warning: connect
to pgsql server 192.168.1.5: fe_sendauth: no password supplied?
Dec 21 17:16:13 p2-debian postfix/cleanup[10619]: 8A7F42014A:
message-id=<20061221161613.8A7F42014A (AT) miohost (DOT) it> Dec 21 17:16:13
p2-debian postfix/qmgr[10615]: 8A7F42014A: from=<root (AT) miohost (DOT) it>,
size=443, nrcpt=1 (queue active)
Dec 21 17:16:13 p2-debian postfix/trivial-rewrite[10620]: fatal:
pgsql:/etc/postfix/transport.cf(0,100): table lookup problem
Dec 21 17:16:14 p2-debian postfix/qmgr[10615]: warning: premature
end-of-input on private/rewrite socket while reading input attribute name
Dec 21 17:16:14 p2-debian postfix/qmgr[10615]: warning: problem talking
to service rewrite: Success
Dec 21 17:16:14 p2-debian postfix/master[1756]: warning:
process /usr/lib/postfix/trivial-rewrite pid 10620 exit status 1
These messages are from postfix, I don't know what they mean.

Quote:
postfix is correctly(i think) configurated :

[main.cf]
virtual_maps = hash:/etc/postfix/virtual
virtual_mailbox_base =/var/spool/mail/vhosts
virtual_minimum_uid = 10000
virtual_uid_maps = pgsql:/etc/postfix/uids.cf
virtual_minimum_gid = 10000
virtual_gif_maps = pgsql:/etc/postfix/virtual.cf
virtual_mailbox_domains = pgsql:/etc/postfix/transport.cf
virtual_mailbox_maps = pgsql:/etc/postfix/mailboxes.cf
You'd have to ask a postfix group...

Quote:
and one of postfix external configuration file

[transport.cf]:
#domain transport information
hosts = 192.168.1.5
user = postfix
password = postfix
dbname = mail_miohost
table = domains
select_field = transport
where_field = domain

this is in pg_hba.conf
postfix 192.168.1.5 255.255.255.255 password
This is probably ok, because if it were not, you would not be able to
connect to the database and get the errors you quoted above.

Quote:
i had errors even if i try to access the db with "postfix" user using
psql -U i've created it (the user) with the standard procedure(login as
"postgres" user and with "createuser")
That is interesting, because the log entries that you posted on top indicate
that postfix was successful in connecting to the database as user 'postfix'.

What is the exact psql command line you used for the failed attempt, and
what was the error message from the server?

Yours,
Laurenz Albe


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.