Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get postfix working on ubuntu #4

Open
themightychris opened this issue Jan 4, 2018 · 4 comments
Open

Get postfix working on ubuntu #4

themightychris opened this issue Jan 4, 2018 · 4 comments

Comments

@themightychris
Copy link
Member

Can't get sendmail command to work, which PHP will need:

sudo hab pkg exec jarvus/postfix sendmail -c /hab/svc/postfix/config -i -v chris

Once that works, sendmail_path and sendmail_args can be set in php.ini, or we could create a wrapper script for binlinking so PHP config doesn't need to be changed

There seem to be issues with write permissions for some process in play for mail addressed to local users:

postfix/local[5758]: 7C2E023F578: to=<[email protected]>, orig_to=<chris>, relay=local, delay=9.4, delays=9.4/0.01/0/0.01, dsn=5.2.0, status=bounced (cannot update mailbox /hab/svc/postfix/data/spool/chris for user chris. unable to create lock file /hab/svc/postfix/data/spool/chris.lock: Permission denied)

but that shouldn't matter for remote

@themightychris
Copy link
Member Author

nc localhost 25 email to a remote gmail address gets delivered via mailgun

@themightychris
Copy link
Member Author

Success!

hab pkg exec jarvus/postfix sendmail -C /hab/svc/postfix/config -i -v [email protected]

worked for remote delivery

hab pkg exec jarvus/postfix sendmail -C /hab/svc/postfix/config -i -v root

worked for local delivery AFTER manually chowning /hab/svc/postfix/data/spool/root to user root after seeing:

postfix/local[6482]: 81FED23F587: to=<[email protected]>, relay=local, delay=0.01, delays=0/0/0/0, dsn=4.2.0, status=deferred (cannot update mailbox /hab/svc/postfix/data/spool/root for user root. destination /hab/svc/postfix/data/spool/root is not owned by recipient)

Trying to deliver to other local users though results in

delivery via local: cannot update mailbox
    /hab/svc/postfix/data/spool/chris for user chris. unable to create lock
    file /hab/svc/postfix/data/spool/chris.lock: Permission denied

@themightychris
Copy link
Member Author

I tried to set sendmail_path to hab pkg exec jarvus/postfix sendmail -C /hab/svc/postfix/config in /etc/php/5.6/cli/php.ini and then this happens:

php > var_export(Emergence\Mailer\Mailer::send('[email protected]', 'Subject', date('c')));
sendmail: error: unauthorized configuration directory name: /hab/svc/postfix/config
sendmail: fatal: specify "alternate_config_directories = /hab/svc/postfix/config" or "multi_instance_directories = /hab/svc/postfix/config" in /etc/postfix/main.cf
false
php > echo ini_get('sendmail_path');
hab pkg exec jarvus/postfix sendmail -C /hab/svc/postfix/config

might be good to find a compile-time flag that lets us replace /etc/postfix with /hab/svc/postfix/config

@themightychris
Copy link
Member Author

materializing sendmail_path to /hab/pkgs/jarvus/postfix/3.2.4/20180104203932/bin/sendmail -C /hab/svc/postfix/config seems to help things, maybe using hab pkg exec was somehow still running the system version:

php > var_export(Emergence\Mailer\Mailer::send('[email protected]', 'Subject', date('c')));
sh: 1: /hab/svc/postfix/data/spool#: Permission denied
false
php > echo ini_get('sendmail_path');
/hab/svc/postfix/data/spool# /hab/pkgs/jarvus/postfix/3.2.4/20180104203932/bin/sendmail -C /hab/svc/postfix/config

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

No branches or pull requests

1 participant