Hello,
judging by your "pki" lines, my first guess would be that
/etc/ssl/private/server.key isn't the private key for the letsencrypt
certificate you generated.
If your letsencrypt certificate is in /etc/letsencrypt/live/***,
usually, the private key is in the same folder.
Jarod G.
On 26/03/2023 20:34, Edoardo La Greca wrote:
Hi there, I'm trying to set up a SMTP server using this guide
https://blog.obtusenet.com/byoes-build-your-own-email-server/ but I
cannot receive any email (the `mail` command says "No mail for edo"), neither
from external SMTP servers, nor from the same server (by sending it from the SMTP server
to the same server).
Whenever I restart the SMTPD service, this is what /var/log/maillog contains:
Mar 26 18:17:52 edolg smtpd[81875]: info: OpenSMTPD 7.0.0 starting
Mar 26 18:17:52 edolg smtpd[27195]: dcc8ef428ff52916 mta connecting
address=smtp://*** host=***
Mar 26 18:17:52 edolg smtpd[27195]: dcc8ef428ff52916 mta connected
Mar 26 18:17:52 edolg smtpd[27195]: dcc8ef430805d68e smtp connected address=***
host=***
Mar 26 18:17:52 edolg smtpd[43231]: crypto: ca_imsg: invalid pkey hash
Mar 26 18:17:52 edolg smtpd[91301]: smtpd: process ca socket closed
Mar 26 18:17:52 edolg smtpd[27195]: dispatcher: pipe closed
(I censored the IPs and domain names using "***")
And this is /etc/mail/smtpd.conf:
# $OpenBSD: smtpd.conf,v 1.14 2019/11/26 20:14:38 gilles Exp $
# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.
# certificate
pki mail_cert cert "/etc/letsencrypt/live/***/fullchain.pem"
pki mail_cert key "/etc/ssl/private/server.key"
table aliases file:/etc/mail/aliases
# To accept external mail, replace with: listen on all
#
#listen on lo0
listen on socket
listen on all tls pki mail_cert
action "local_mail" mbox alias <aliases>
action "outbound" relay
# Uncomment the following to accept external mail for domain "example.org"
#
match from any for domain "***" action "local_mail"
match from local for local action "local_mail"
match from local for any action "outbound"
(I censored the IPs and domain names using "***" here as well)
Any idea on what could the reason be? I'm not an expert in either SMTP
or cryptography so please be patient if my question is stupid.