1

Topic: Let's encrypt auto certificate update

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3
- Deployed with iRedMail Easy or the downloadable installer? Downloadable installer
- Linux/BSD distribution name and version: Ubuntu server 20.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Maria DB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Dear Sirs, I have just installed iRedMail 1.3 in my Ubuntu server 20.04 and all seems ok. I installed also let's encrypt free certificate using the steps enlisted in the below link
https://docs.iredmail.org/letsencrypt.html

There, a step for auto certificate update has been described and I quote the specific paragraph:

A sample cron job that runs at 3:01AM everyday, and restart postfix/nginx/dovecot after renewed:

1   3   *   *   *   certbot renew --post-hook 'service postfix restart; service nginx restart; service dovecot restart'

Because I never worked with cron job, can someone guide me further how can do it?

Thanks and Best Regards,
Mike Kranidis

----

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

2

Re: Let's encrypt auto certificate update

mikekgr wrote:

Dear Sirs, I have just installed iRedMail 1.3 in my Ubuntu server 20.04 and all seems ok. I installed also let's encrypt free certificate using the steps enlisted in the below link
https://docs.iredmail.org/letsencrypt.html

There, a step for auto certificate update has been described and I quote the specific paragraph:

A sample cron job that runs at 3:01AM everyday, and restart postfix/nginx/dovecot after renewed:

1   3   *   *   *   certbot renew --post-hook 'service postfix restart; service nginx restart; service dovecot restart'

Because I never worked with cron job, can someone guide me further how can do it?

Thanks and Best Regards,
Mike Kranidis

Well to answer my question, in order to have it here in the forum for anyone that need this info, the steps are:
As root do the following:
1) Do a cron job in order to have automatic update of the let's encrypt certificate. Running from console / terminal:
crontab -e
In the opened file (that is the file: /var/spool/cron/crontabs/root), just append / put after the last line:
### by mikek cron job for let's encrypt auto update (running each day at 03:00)
1   3   *   *   *   /usr/bin/certbot renew --post-hook 'service postfix restart; service nginx restart; service dovecot restart'

2) To check the registered cron jobs just use:
crontab -l


See also the short cron job how to: https://www.digitalocean.com/community/ … buntu-1804

I hope that this is helpful for you.

Best Regards,
Mike Kranidis

3

Re: Let's encrypt auto certificate update

Thanks for sharing, Mike.