Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

postgrey doesn't start #39

Closed
ptzool opened this issue Sep 25, 2016 · 1 comment
Closed

postgrey doesn't start #39

ptzool opened this issue Sep 25, 2016 · 1 comment

Comments

@ptzool
Copy link

ptzool commented Sep 25, 2016

Hi,

I would like to start the postgrey but it doesn't start. I exec the following command in docker and get error message. When I didn't set dbdir postgrey works well.

/usr/sbin/postgrey --delay=120 --inet=127.0.0.1:10023 --dbdir=/var/mail/postgrey

2016/09/25-07:22:21 postgrey (type Net::Server::Multiplex) starting! pid(707)
Binding to TCP port 10023 on host 127.0.0.1 with IPv4
Setting gid to "114 114"
Setting uid to "108"
ERROR: can't open lock file: /var/mail/postgrey/postgrey.lock

@hardware
Copy link
Owner

hardware commented Sep 25, 2016

You must add ENABLE_POSTGREY=true environnement variable to enabled postgrey and init /var/mail/postgrey folder with the right permissions. Without this, postgrey can't access dbdir because initially it's vmail user who own this directory.

Update your docker-compose.yml file with the new variable :

mailserver:
  image: mailserver
  container_name: mailserver
  domainname: domain.tld
  hostname: mail
  environment:
    - ENABLE_POSTGREY=true
  ...

Restart the container and you should have this in server logs :

docker logs -f mailserver | grep postgrey                                                                                                

2016-09-25 08:13:44,057 INFO spawned: 'postgrey_init' with pid 107                                                                                                               
2016-09-25 08:13:44,097 INFO success: postgrey_init entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)                                                
2016-09-25 08:13:44,138 INFO spawned: 'postgrey' with pid 146                                                                                                                    
2016-09-25 08:13:45,736 INFO success: postgrey entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)                                                     
2016-09-25 08:13:45,743 INFO exited: postgrey_init (exit status 0; expected)
docker exec -ti mailserver bash

ps -ef | grep [p]ostgrey                                                                                                                                            
postgrey   146     6  0 08:13 ?        00:00:00 postgrey --delay=120 --inet=127.0.0.1:10023 --dbdir=/var/mail/postgrey

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants