1

Topic: iredmail lets encrypt certificate problem

Hi,

Ive had iredmail setup for months now but im having a issue where the Lets Encrpt wont update the Certficates i keep having his problem any ideas?

Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for mail.violetdragonsnetwork.co.uk
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (mail.violetdragonsnetwork.co.uk) from /etc/letsencrypt/renewal/mail.violetdragonsnetwork.co.uk.conf produced an unexpected error: Failed authorization procedure. mail.violetdragonsnetwork.co.uk (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://mail.violetdragonsnetwork.co.uk/ … WzyHRe3go: Timeout during connect (likely firewall problem). Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/mail.violetdragonsnetwork.co.uk/fullchain.pem (failure)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/mail.violetdragonsnetwork.co.uk/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
- The following errors were reported by the server:

   Domain: mail.violetdragonsnetwork.co.uk
   Type:   connection
   Detail: Fetching
   http://mail.violetdragonsnetwork.co.uk/ … WzyHRe3go:
   Timeout during connect (likely firewall problem)

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address. Additionally, please check that
   your computer has a publicly routable IP address and that no
   firewalls are preventing the server from communicating with the
   client. If you're using the webroot plugin, you should also verify
   that you are serving files from the webroot path you provided.

Thanks.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: iredmail lets encrypt certificate problem

LetsEncrypt server can not connect to your server via http port 80 or 443. Make sure you domain name "mail.violetdragonsnetwork.co.uk" has correct A type DNS record which points to your server IP address. Also firewall doesn't block port 80/443.

3

Re: iredmail lets encrypt certificate problem

ZhangHuangbin wrote:

LetsEncrypt server can not connect to your server via http port 80 or 443. Make sure you domain name "mail.violetdragonsnetwork.co.uk" has correct A type DNS record which points to your server IP address. Also firewall doesn't block port 80/443.

Hi,

Im back again with an issue. Its been working fine for a while until now. The problem with renewing the cert is back any soltuon to fixing this?

Thanks.

Processing /etc/letsencrypt/renewal/mail.violetdragonsnetwork.co.uk.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Starting new HTTPS connection (1): acme-staging-v02.api.letsencrypt.org
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for mail.violetdragonsnetwork.co.uk
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (mail.violetdragonsnetwork.co.uk) from /etc/letsencrypt/renewal/mail.violetdragonsnetwork.co.uk.conf produced an unexpected error: Failed authorization procedure. mail.violetdragonsnetwork.co.uk (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://mail.violetdragonsnetwork.co.uk/ … CMKZ2IouM0 [81.150]: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>". Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/mail.violetdragonsnetwork.co.uk/fullchain.pem (failure)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/mail.violetdragonsnetwork.co.uk/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
- The following errors were reported by the server:

   Domain: mail.violetdragonsnetwork.co.uk
   Type:   unauthorized
   Detail: Invalid response from
   http://mail.violetdragonsnetwork.co.uk/ … CMKZ2IouM0
   [81.150]: "<html>\r\n<head><title>404 Not
   Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
   Not Found</h1></center>\r\n<hr><center>"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

4

Re: iredmail lets encrypt certificate problem

I had this problem when I was using Apache.  If Apache is running, you get that message.
Try stopping the Apache/Nginx service and then run certbot (and then restart).
The cron job in the help pages does this off/on automatically (or should).

Can you manually run the task if you do

service nginx stop
certbot ...
service nginx restart

Obviously, this assumes nginx

Andrew

5

Re: iredmail lets encrypt certificate problem

AndyInNYC wrote:

I had this problem when I was using Apache.  If Apache is running, you get that message.
Try stopping the Apache/Nginx service and then run certbot (and then restart).
The cron job in the help pages does this off/on automatically (or should).

Can you manually run the task if you do

service nginx stop
certbot ...
service nginx restart

Obviously, this assumes nginx

Andrew

Hi thanks for your message. I dont have Apache installed only Nignx and when stopping the service i get the same message. This is annoying because i have to re-do everything after 3 months because of this Cert problem.


jack@mail:~$ service nginx stop
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'nginx.service'.
Authenticating as: jack,,, (jack)
Password:
==== AUTHENTICATION COMPLETE ===
jack@mail:~$ sudo certbot renew --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/mail.violetdragonsnetwork.co.uk.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Starting new HTTPS connection (1): acme-staging-v02.api.letsencrypt.org
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for mail.violetdragonsnetwork.co.uk
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (mail.violetdragonsnetwork.co.uk) from /etc/letsencrypt/renewal/mail.violetdragonsnetwork.co.uk.conf produced an unexpected error: Failed authorization procedure. mail.violetdragonsnetwork.co.uk (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://mail.violetdragonsnetwork.co.uk/ … Ifen_pdaDI [81.150]: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>". Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/mail.violetdragonsnetwork.co.uk/fullchain.pem (failure)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/mail.violetdragonsnetwork.co.uk/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
- The following errors were reported by the server:

   Domain: mail.violetdragonsnetwork.co.uk
   Type:   unauthorized
   Detail: Invalid response from
   http://mail.violetdragonsnetwork.co.uk/ … Ifen_pdaDI
   [81.150]: "<html>\r\n<head><title>404 Not
   Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
   Not Found</h1></center>\r\n<hr><center>"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

6

Re: iredmail lets encrypt certificate problem

I attempted a fresh install and its still giving me a issue.

http-01 challenge for mail.violetdragonsnetwork.co.uk
Using the webroot path /var/www/html for all unmatched domains.
Waiting for verification...
Challenge failed for domain mail.violetdragonsnetwork.co.uk
http-01 challenge for mail.violetdragonsnetwork.co.uk
Cleaning up challenges
Some challenges have failed.

IMPORTANT NOTES:
- The following errors were reported by the server:

   Domain: mail.violetdragonsnetwork.co.uk
   Type:   unauthorized
   Detail: Invalid response from
   http://mail.violetdragonsnetwork.co.uk/ … oAX6xpECGY
   [81.150.180.216]: "<html>\r\n<head><title>404 Not
   Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
   Not Found</h1></center>\r\n<hr><center>"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.
- Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.

7

Re: iredmail lets encrypt certificate problem

It says “ 404 Not Found”, please check Nginx log file to figure out which directory it accessed.

8

Re: iredmail lets encrypt certificate problem

@jackb
Do you have an AAAA record pointing to the mail server in your DNS zone?
If you do, certs won't renew, as long as there is an http > https redirect in place.

9

Re: iredmail lets encrypt certificate problem

Akiba wrote:

@jackb
Do you have an AAAA record pointing to the mail server in your DNS zone?
If you do, certs won't renew, as long as there is an http > https redirect in place.

Good question,

I have no AAAA Record for IPV6 as im only using IPV4 but i think i found my problem. I have A record for both websrv and mail but no A Record for the DNS Server itself from what i can see. I will fix this and try again.

10 (edited by jackb 2020-09-25 00:54:33)

Re: iredmail lets encrypt certificate problem

ZhangHuangbin wrote:

It says “ 404 Not Found”, please check Nginx log file to figure out which directory it accessed.

Hi ZhangHuangbin this can be marked as solved. I moved DNS from BIND9 to DigitalOceans DNS with the same A and MX Records as before and Certbot is working perfect with DigitalOceans API Method, using HaProxy and Acme Package on pfSense and since moving over its all working great.

I think there was a issue with BIND9 setup i was using as certain emails wasnt coming through but are now since moving DNS Servers.

Cheers.

Jack.