“An error occurred while sending mail (hostname “localhost” does not match the server certificate)” this was received while sending redmine test mail
The following setup in configuration.yml worked for me with the extra enable_starttls_auto: false
production: email_delivery: delivery_method: :smtp smtp_settings: address: localhost port: 25 enable_starttls_auto: false
Also take the care to comment out in the bottom of configuration.yml the production section which overrides the default ones even if it’s just empty.
If even this does not help you try out the following in WHM if you have it. Go to Exim Configuration Editor and search for “Sender verification”. Switch it off. Save it.