Closed masterjg closed 8 months ago
Are you able to access and login to the web application?
yes, absolutely, everything works from web app
@willbrowningme anything else I could help with while debugging? I can mount some debug-able files if needed to pinpoint the issue.
It is related to user=anonaddy argv=php /var/www/anonaddy/postfix/AccessPolicy.php
. Are you able to check the contents of storage/logs/postfix-access-policy.log
(I'm not sure where this is stored for the Docker image).
$noAliasExists = Database::table('aliases')->select('id')->where('email', $aliasEmail)->doesntExist();
this fails, I've added dumb logging with:
logData("9?");
// Check if the alias already exists or not
$noAliasExists = Database::table('aliases')->select('id')->where('email', $aliasEmail)->doesntExist();
logData("10?");
and only 9? is shown in the log.
Not truly sure how this supposed to be able to open connection to tadabase without credentials? Is it singleton or something once called with $database->setAsGlobal();
?
I've even dumped (logData(print_r($_ENV, true));
) $_ENV before setAsGlobal:
(
[DB_HOST] => mariadb
[DB_PORT] => 3306
[DB_DATABASE] => ...
[DB_USERNAME] => ...
[DB_PASSWORD] => ...
[ANONADDY_ADMIN_USERNAME] => null
[ANONADDY_ALL_DOMAINS] => ...
[ANONADDY_SECRET] => ...
)
@willbrowningme OK, I've found the bug. Try setting db password with #
symbol via env var DB_PASSWORD
. printenv
shows it properly in container, however $_ENV
strips everything after this symbol.
Good find, I think if you wrap it all in double quotes it should work with the #
symbol. Need a note adding about this in the Readme.
It's already wrapped in docker-compose.yml. And If I enter container I can see the env variable with printenv, only in PHP there are issues. And what's weird is that only with this AccessPolicy.php there are issues as web app works without any issues. So that leads me to believe that there's bug there somewhere.
All in all I've just destroyed database and run a new container with new password without hashtags and now it works as expected.
#
is used for comments in .env
files - https://github.com/vlucas/phpdotenv?tab=readme-ov-file#comments
If I enter DB_PASSWORD=secret#123
then dump $_ENV['DB_PASSWORD']
it returns secret
missing out everything after the hash.
But if I enter DB_PASSWORD="secret#123"
and then dump $_ENV['DB_PASSWORD']
it correctly returns secret#123
.
Support guidelines
I've found a bug and checked that ...
Description
Can't seem to receive any mail to any of the aliases whatsoever. In the logs it shows that during the time postfix processes emails something can't access database? I may be completely off but could it be related to https://github.com/anonaddy/docker/blob/3de44c7adf9088d6ae5928bc4fc3cbfd1af696f5/rootfs/etc/cont-init.d/15-config-postfix.sh#L22 ?
Expected behaviour
All emails successfully received by all aliases.
Actual behaviour
No emails received, getting
451 4.3.5 <oval.tragedy514@xxx.yyy>: Recipient address rejected: Server configuration problem
Steps to reproduce
Docker Compose config
stepswaks --to oval.tragedy514@xxx.yyy --from zzzz@yyyy.com --server mail.xxx.yyy --ehlo mail.xxx.yyy
or just using any client to that aliasDocker info
Docker Compose config
Logs