Topic: Let's Encrypt Renewal Question
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
This may sound like a stupid question, but I don't want to mess up my production server.
I finally installed Let's Encrypt and certbot on 04/29/2023 and setup a job in cron to automatically renew the certificates. To make sure my certificate renewed before it expires I ran:
certbot certificates and here is the output I've replaced the actual domain name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
Certificate Name: <domain name>
Serial Number: 349066629dc8bcc706b1ab120bc09d0fd27
Key Type: ECDSA
Domains: <domain name>
Expiry Date: 2023-09-22 01:45:25+00:00 (VALID: 67 days)
Certificate Path: /etc/letsencrypt/live/<domain name>/fullchain.pem
Private Key Path: /etc/letsencrypt/live/<domain nam>/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Yet when I check the certificate from a web browser here is the expiration date
Expires: Sunday, July 23, 2023 at 8:29:28 AM Eastern Daylight Time
Here is my cron job.
# LetsEncrypt: renew ssl server certificate at AM 3:01 everyday
1 3 * * * certbot renew --post-hook '/usr/sbin/service postfix restart; /usr/sbin/service nginx restart; /usr/sbin/service dovecot restart'
I do a systemctl status postfix and this is the output:
systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2023-04-29 13:01:02 EDT; 2 months 17 days ago
Which tells me the postfix service never restarted from cron.
I do a systemctl status dovecot and this is the output:
systemctl status dovecot
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/dovecot.service.d
└─override.conf
Active: active (running) since Tue 2023-05-23 07:05:06 EDT; 1 months 24 days ago
This is because I manually restarted dovecot that day so I'm assuming it also did not restart automatically.
I do a systemctl status nginx and this is the output:
systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2023-04-29 13:00:57 EDT; 2 months 17 days ago
nginx did not restart from cron.
Question, can I just restart postfix and nginx normally with these commands?
systemctl restart postfix
systemctl restart nginx
Or is there something else I need to make sure I don't mess this up?
Also does my cron entry look correct?
Thank you,
Kevin
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.