Not able to use external SMTP server to send notifications, local postfix works

Dear Community,

I am currently using local postfix on my Check_mk 1.6.0 CRE distributed monitoring set up.

On each checkmk site / server, postfix is installed and notifications are working fine.

But we want to use our smtp mail server where we are managing postfix with DKIM records.

On reading reply for a similar question raised by someone:

On your monitoring server you don’t need a “mail server” only an mail transfer agent “MTA”.

Most default Linux installations have something like that on board.

If it is nullmailer, postfix or sendmail is not so important.

How does your local system deliver mails?

what I did:

  1. Removed postfix on checkmk server

  2. Added our mail server IP in smtp=x.x.x.x:25 to /omd/sites/mysite/etc/mail.rc

  3. Tested to send mail from command line using mail command, it sent mail.

But, here is the issue:

  1. From checkmk WI, on sending test mail it shows following error in notify.log

Output: Unhandled exception: Failed to send the mail: /usr/sbin/sendmail is missing

Plugin exited with code 2``

Am I missing to change configuration somewhere?

Looked at many checkmk files, but did not find any correct place to make changes.

Any help or guidance is very much appreciated.

Thank you.

Checkmk is using the locally installed mail transfer agent (MTA) for sending e-mails. See Notifications - via Email, SMS, Ticketsystems and more for details.

The Checkmk Appliance already ships with an MTA installed (nullmailer) which can be configured on the webconf interface. On other Linux systems, you need to set up an MTA for yourselves. This does not need to be a fully-featured daemon like Postfix oder Exim, a simple forwarder like Nullmailer or SSMTP is usually sufficient.

The ~/etc/mail.rc file is the configuration for the mail user agent (MUA) used by Checkmk for sending e-mails to the MTA.

Thank you very much for the quick reply and suggestions.

I’ve gone through the Checkmk document, you suggested.
And I understand, it is fairly simple.

I have configured ~/etc/mail.rc to use our external smtp server.

From linux command line, tested sending mails using “mail” command which is working fine.
Only checkmk site is not sending notification mails.

Shall I share any more details which might help to understand the issue?

Sending from the console is done with the same user as the monitoring is running with? In our case we didn’t change the mail.rc at all. SSMTP is used as a relay.

Hello,
How exactly do you send test emails? Where from? I did not find any Setup item on that in the web GUI interface.

Hello,
in the
/opt/omd/sites/mysite/etc/mail.rc
there is no server name/ip, nor port, nor user/password, no “from address”, so this file is not about SMTP configuration.
How can it be set up to forward emails?
in /etc/ there is no such file
in /home/linuxuser/ there is no ~/etc/mail.rc
What file are you talking about?

Yes. Checkmk ships with a copy of the heirloom-mailx mail user agent (MUA). ~/etc/mail.rc is the configuration file for mailx.

mailx uses the standard Linux interface /usr/sbin/sendmail. This can be provided by a mail transport agent (MTA), like Postfix, Exim, Berkeley Sendmail, Qmail, Nullmailer, or SSMTP.

To test if if works, simply send some Mail. As the checkmk site user, do something like

$ echo "some text" | ~/bin/mail -s "mail test" example@example.org

I have installed postfix, and no emails.
Only when i searched for more information on email, and found in the documentation that an email address for a user is not enough, and i also have to add cmkadmin user account to the “Everything” contact group. Only then i started getting emails.
Thanks

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.