postfix-pgsql SSL connection to postgres

Bug #1553928 reported by Magosányi Árpád
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

postfix-pgsql cannot be configured to use ssl connection, because it uses the old PQsetdbLogin API.

This patch makes it possible to use any postgresql connect string by using the PQconnectdb api.

I did not find where to report such things to upstream (beyond mailing list, which I don't intend to subscribe),
so please send it to them. I will be happy to refactor the patch to be accepted upstream, just please don't
make me subscribe yet another mailing list.

usage notes:

1. You put the connection string instead of hostname.
  It is detected based on the "postgresql:" prefix.
  dbname is not used, but you have to define it.
  My postgres.cf looks like this:
-----------------------------------------
hosts = postgresql://<email address hidden>/pdoauth?sslmode=require
query = select email from email_map where proxy='%s';
dbname = notused
-----------------------------------------

2. When daemons are chrooted,
  a) you should put a passwd file in the chroots /etc, with an entry for postfix. It is /var/spool/postfixx/etc in case of ubuntu
  b) you should have the proper ssl key and cert in ~postfix within the chrooted environment
  c) other files in /etc, like resolv.conf, ... are also used within the chroot

The patch is attached. There might be whitespace discrepancies.

Tags: patch
Revision history for this message
Magosányi Árpád (mag-magwas) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "postfix-2.11.0.pgsql.connstring.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Revision history for this message
Magosányi Árpád (mag-magwas) wrote :

Here is a new version of the patch. You just have to put this file to debian/patches. It is so hard?

Revision history for this message
Scott Kitterman (kitterman) wrote :

The mailing list is the only way.

What version of pgsql introduced PQconnectdb?

Neither of the Debian postfix maintainers use the pgsql maps, so it's difficult for us to discuss changes with upstream. There is no Ubuntu maintainer, per se.

Revision history for this message
Magosányi Árpád (mag-magwas) wrote :

PQconnectdb is there since at least 8.1 All supported postgresql versions have it.

I do use pgsql maps, and villing to help you.
In the meantime I have subscribed to the postfix-devel mailing list and sent in the new patch.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Thanks. Actually you want postfix-users. Postfix-devel is for the core postfix developers.

Revision history for this message
Magosányi Árpád (mag-magwas) wrote :

No, I wanted devel, I am such a diehard. The patch is already queued.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1553928] Re: postfix-pgsql SSL connection to postgres

On Monday, December 12, 2016 07:58:42 AM you wrote:
> No, I wanted devel, I am such a diehard. The patch is already queued.

Thanks,

Scott K

Revision history for this message
Robie Basak (racb) wrote :

> You just have to put this file to debian/patches. It is so hard?

I would prefer not to because of the consequent maintenance burden. Feel free to try to convince us if you wish.

Changed in postfix (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Robie Basak (racb) wrote :

(and thank you for developing and sending the patch upstream!)

Revision history for this message
Scott Kitterman (kitterman) wrote :

This is fixed in 3.3.

Changed in postfix (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.