7.3. Running the EPN tool to send emails to users whose passwords are expiring
You can use the Expiring Password Notification (EPN) tool to send emails to Identity Management (IdM) users whose passwords are expiring. You can choose one of the following methods:
-
Update the
epn.confconfiguration file and enable the ipa-epn.timer tool. -
Update the
epn.confconfiguration file and run the EPN tool directly on the command line.
The EPN tool is stateless. If the EPN tool fails to email any of the users whose passwords are expiring on a given day, the EPN tool does not save a list of those users.
Prerequisites
-
The
ipa-client-epnpackage is installed. See Installing the Expiring Password Notification tool. -
Customize the
ipa-epnemail template if required. See Modifying the Expiring Password Notification email template.
Procedure
Open the
epn.confconfiguration file.# vi /etc/ipa/epn.confUpdate the
notify_ttlsoption as required. The default is to notify users whose passwords are expiring in 28, 14, 7, 3, and 1 day(s).notify_ttls = 28, 14, 7, 3, 1注記You must also activate the
ipa-epn.timertool to ensure that emails are sent.Configure your SMTP server and port:
smtp_server = localhost smtp_port = 25Specify the email address from which the email expiration notification is sent. Any unsuccessfully delivered emails are returned to this address.
mail_from = admin-email@example.comOptional: If you want to use an encrypted channel of communication, specify the credentials to be used:
Specify the path to a single file in PEM format containing the certificate to be used by EPN to authenticate with the SMTP server:
smtp_client_cert = /etc/pki/tls/certs/client.pem注記EPN is an SMTP client. The purpose of the certificate is client authentication, not secure SMTP delivery.
You can specify the path to a file that contains the private key. If not specified, the private key is taken from the certificate file.
smtp_client_key = /etc/pki/tls/certs/client.keyIf the private key is encrypted, specify the password for decrypting it.
smtp_client_key_pass = Secret123!
-
Save the
/etc/ipa/epn.conffile. Run the EPN tool in dry-run mode to generate a list of the users to whom the password expiration email notification would be sent if you run the tool without the
--dry-runoption.# ipa-epn --dry-run [ { "uid": "user5", "cn": "user 5", "krbpasswordexpiration": "2020-04-17 15:51:53", "mail": "['user5@ipa.test']" } ] [ { "uid": "user6", "cn": "user 6", "krbpasswordexpiration": "2020-12-17 15:51:53", "mail": "['user5@ipa.test']" } ] The IPA-EPN command was successful注記If the list of users returned is very large and you run the tool without the
--dry-runoption, this might cause an issue with your email server.Run the EPN tool without the
--dry-runoption to send expiration emails to the list of all the users returned when you ran the EPN tool in dry-run mode:# ipa-epn [ { "uid": "user5", "cn": "user 5", "krbpasswordexpiration": "2020-10-01 15:51:53", "mail": "['user5@ipa.test']" } ] [ { "uid": "user6", "cn": "user 6", "krbpasswordexpiration": "2020-12-17 15:51:53", "mail": "['user5@ipa.test']" } ] The IPA-EPN command was successfulYou can add EPN to any monitoring system and invoke it with the
--from-nbdaysand--to-nbdaysoptions to determine how many users passwords are going to expire within a specific time frame:# ipa-epn --from-nbdays 8 --to-nbdays 12注記If you invoke the EPN tool with the
--from-nbdaysand--to-nbdaysoptions, it is automatically executed in dry-run mode.
Verification
- Run the EPN tool and verify an email notification is sent.