Skip to content

[BUG] Using setup.sh config dkim results in a malformed mail.private RSA key #1778

@Peter-Mac

Description

@Peter-Mac

Bug Report

The setup.sh tool seems to generate a private key file that results in the following error when attempting to send mail:

Jan 29 07:30:30 mail opendkim[240]: A0BBA1B5D94: SSL error:0909006C:PEM routines:get_name:no start line
Jan 29 07:30:30 mail opendkim[240]: A0BBA1B5D94: dkim_eom(): resource unavailable: PEM_read_bio_PrivateKey() failed

Context

Use the setup.sh tool to generate the dkim private and public keys as so:

./setup.sh config dkim {key size}

Will result in both a mail.private and mail.txt files being created. Configure your dkim records on your DNS server as required and proceed to test with a mail client. Watch the logs from within the mail server container using

tail -f /var/log/mail/mail.log

As you attempt to send mail from your email client, if you see the following error in your logs, it's a sign of a malformed mail.private file

Jan 29 07:30:30 mail opendkim[240]: A0BBA1B5D94: SSL error:0909006C:PEM routines:get_name:no start line
Jan 29 07:30:30 mail opendkim[240]: A0BBA1B5D94: dkim_eom(): resource unavailable: 

Note: A workaround is to manually edit the file on your docker host machine and add a carriage return after the space character after the -----BEGIN RSA PRIVATE KEY----- text string. And repeat before the space before the -----END RSA PRIVATE KEY-----

What is affected by this bug?

Ability to send emails from a remote client using a pre-created email address.

When does this occur?

Upon send of an email from a mail client

Expected Behavior

A well formed private key that can be parsed by the SSL library

Your Environment

  • docker-compose: version 1.25.0
  • server OS: ubuntu 20.04

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions