Skip to content

Fix permission issues on wrong dkim path#171

Merged
tomav merged 1 commit intov2from
unknown repository
May 2, 2016
Merged

Fix permission issues on wrong dkim path#171
tomav merged 1 commit intov2from
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Apr 30, 2016

Hi, I used your v2 branch and wasn't able to send mails due

Apr 30 11:01:11 mail opendkim[521]: mail._domainkey.zauberstuhl.de: key data is not secure: /tmp can be read or written by other users
Apr 30 11:01:11 mail opendkim[521]: 176E2C07: error loading key 'mail._domainkey.zauberstuhl.de'

I followed your tutorial and ran generate-dkim-config from the console. Maybe I missed a step but in the KeyTable file there is the path to the temporary file configured after creation.

You can avoid this kind of issue by simply running sed after the copy step. Even if I missed something that fix could avoid problems in future.

great work btw.. Cheers!

@tomav
Copy link
Copy Markdown
Contributor

tomav commented Apr 30, 2016

The generator mounts a folder to /tmpto get it back on your host.
Once you have, this folder is re-mounted to /tmp and files are copied to /etc and permissions applied.
Have a look to https://github.com/tomav/docker-mailserver/blob/v2/target/start-mailserver.sh#L82-L95

Could you paste your docker-compose.yml and a tree ouput of your config directory.

You should not experience your issue. Perhaps we've missed something.

Thanks

@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 30, 2016

The generator mounts a folder to /tmp to get it back on your host.
Once you have, this folder is re-mounted to /tmp and files are copied to /etc and permissions applied.

yes and that is not the problem. My problem is the content of /etc/opendkim/KeyTable:

mail._domainkey.example.org example.org:mail:/tmp/docker-mailserver/opendkim/keys/example.org/mail.private
should be
mail._domainkey.example.org example.org:mail:/etc/opendkim/keys/example.org/mail.private

otherwise it will always complain about permission issues since he tries to load the key from tmp and not from etc

@diiigle
Copy link
Copy Markdown
Contributor

diiigle commented May 1, 2016

I can confirm this issue.
My syslog tells me:

May  1 13:06:35 vps opendkim[463]: can't load key from /tmp/docker-mailserver/opendkim/keys/example.com/mail.private: Permission denied
May  1 13:06:35 vps opendkim[463]: F186B201FBF: error loading key 'mail._domainkey.example.com'

Why don't we edit the generate-dkim-config script to write the right path to the KeyTable file?

@ghost ghost force-pushed the v2_permission_issue_on_wrong_path branch from 744c78f to 777b1ba Compare May 1, 2016 13:32
@ghost
Copy link
Copy Markdown
Author

ghost commented May 1, 2016

Why don't we edit the generate-dkim-config script to write the right path to the KeyTable file?

ups kinda missed that this is part of the docker-mailserver as well.
that is actually the better approach cheers!

@tomav tomav added bug labels May 2, 2016
@tomav tomav merged commit bee4088 into docker-mailserver:v2 May 2, 2016
@tomav
Copy link
Copy Markdown
Contributor

tomav commented May 2, 2016

Thanks @diiigle, well spotted!

RichardFevrier pushed a commit to RichardFevrier/docker-mailserver that referenced this pull request Aug 26, 2019
…on_issue_on_wrong_path

Fix permission issues on wrong dkim path
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

Successfully merging this pull request may close these issues.

2 participants