Sendmail is a default mail server in some Linux distro like CentOS that is often used by system administrators to email and its use is easy. Unfortunately, by default sendmail log (in /var/log/maillog) do not display the subject, so sysadmins will have difficulties if they have to search for an email based on the title in the log. This article will explain how to display titles in the log in CentOS 7.
For example, I want to email like this:
After that, we configure the sendmail.mc file by adding the script below into the file:
The most important part of the script above is on the last line (look at line 7). If we are wrong in this line, then the subject will not appear in the log. After typing R$*, press Tab key, then writes $: then press space and write $. After that pressing space after typing Subject: then write $1, space back then write $) keep spaces again and write $1.
You can see the picture above that subject display in the log.