# Logwatch not sending email

**URL:** <https://forums.rockylinux.org/t/logwatch-not-sending-email/6269>\
**Category:** Rocky Linux Help & Support\
**Created:** [June 7, 2022, 6:06pm UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269 "2022-06-07T18:06:23Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![pvanthony](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/pvanthony/32/1945_2.png) [@pvanthony](https://forums.rockylinux.org/u/pvanthony)\
**Post date:** [June 7, 2022, 6:06pm UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/1 "2022-06-07T18:06:23Z")

</div>

Rocky Linux version 8.6  
Latest logwatch  
mailx installed  
postfix installed

mail -s test [email@example.com](mailto:email@example.com) works.  
postfix works.

I cannot figure out why logwatch does not send emails.

What am I missing?

---

<div class="post-metadata">

**Author:** ![jbkt23](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jbkt23](https://forums.rockylinux.org/u/jbkt23)\
**Post date:** [June 7, 2022, 9:22pm UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/2 "2022-06-07T21:22:19Z")

</div>

I’m using sendmail so just trying to reverse think how it works when you use alternate mailer daemon. When I “ls -la /usr/sbin/sendmail” it shows it to be a link to “/etc/alternatives/mta” which is itself a link that points back to “/usr/sbin/sendmail.sendmail”. So I think “mta” has to point to your mailer daemon.  
Alternatively you could edit “/etc/logwatch/conf/logwatch.conf” to point to your mailer daemon directly. The defaults are in “/usr/share/logwatch/default.conf/logwatch.conf”

---

<div class="post-metadata">

**Author:** ![markdiss](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@markdiss](https://forums.rockylinux.org/u/markdiss)\
**Post date:** [June 8, 2022, 9:21am UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/3 "2022-06-08T09:21:51Z")

</div>

1. Is logwatch actually running?
2. Check the postfix logs, is anything attempted to be sent? If so, where to? Is it being rejected as spam?

Mark.

---

<div class="post-metadata">

**Author:** ![jbkt23](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jbkt23](https://forums.rockylinux.org/u/jbkt23)\
**Post date:** [June 8, 2022, 11:04am UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/4 "2022-06-08T11:04:41Z")

</div>

Logwatch runs as a cron job not as a systemd service. It should be installed automatically in “/etc/cron.daily/” whence it runs at some arbitrary time each morning.  
So if the user did not wait till the next day after install there would be no logwatch mail. You can kick start it by running as root:

# /etc/cron.daily/01logwatch

to test.

---

<div class="post-metadata">

**Author:** ![pvanthony](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/pvanthony/32/1945_2.png) [@pvanthony](https://forums.rockylinux.org/u/pvanthony)\
**Post date:** [June 9, 2022, 6:43pm UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/5 "2022-06-09T18:43:04Z")

</div>

Thank you very much for taking the time to reply and help. I do appreciate it much.

Did a check with alternatives and got the following. And I think it looks correct because postfix is installed and working.

```auto
]# alternatives --config mta

There is 1 program that provides 'mta'.

  Selection Command
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.postfix

Enter to keep the current selection[+], or type selection number:

```

---

<div class="post-metadata">

**Author:** ![pvanthony](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/pvanthony/32/1945_2.png) [@pvanthony](https://forums.rockylinux.org/u/pvanthony)\
**Post date:** [June 9, 2022, 6:48pm UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/6 "2022-06-09T18:48:11Z")

</div>

Thank you for taking the time to reply and help. I do appreciate it much.

logwatch is a cron.daily job so it runs once a day. I think 4am.

The strange thing about Rocky Linux is that there is no /var/log/maillog file.

The only way I am aware to check if postfix received the mail is to use journalctl -f.  
Unfortunately nothing is sent to postfix.

When using mail -s testing [name@example.com](mailto:name@example.com), postfix gets it and is sent out.

---

<div class="post-metadata">

**Author:** ![pvanthony](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/pvanthony/32/1945_2.png) [@pvanthony](https://forums.rockylinux.org/u/pvanthony)\
**Post date:** [June 9, 2022, 6:51pm UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/7 "2022-06-09T18:51:32Z")

</div>

Tested runing /etc/cron.daily/0logwatch no errors but no email as well.

I wonder, could this be because so how this install does not have the normal log files like maillog and logwatch got nothing to send out.

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [June 9, 2022, 8:53pm UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/8 "2022-06-09T20:53:33Z")

</div>

Check /etc/aliases or wherever your aliases file is and make sure root is set to go to your email address, something like:

```auto
root: myemail@mydomain.com

```

after this, run `newaliases` to update it and `postfix reload`. Also check under /var/spool/mail as if the aliases or postfix wasn’t configured correctly, it will be delivering locally here, probably to root.

---

<div class="post-metadata">

**Author:** ![markdiss](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@markdiss](https://forums.rockylinux.org/u/markdiss)\
**Post date:** [June 10, 2022, 8:15am UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/9 "2022-06-10T08:15:42Z")

</div>

Is rsyslog installed and running? If you’ve built the server from the minimal ISO it’s not installed by default. Expected logfiles not existing in /var/log/ always flags this up for me.

M

---

<div class="post-metadata">

**Author:** ![pvanthony](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/pvanthony/32/1945_2.png) [@pvanthony](https://forums.rockylinux.org/u/pvanthony)\
**Post date:** [June 10, 2022, 8:56am UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/10 "2022-06-10T08:56:15Z")

</div>

Thank you for replying and helping. I do appreciate it.

Did the check on the alias and it is good.

Just to be sure did the following and I received the email.  
mail -s testing root

Alias is working good.

---

<div class="post-metadata">

**Author:** ![pvanthony](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/pvanthony/32/1945_2.png) [@pvanthony](https://forums.rockylinux.org/u/pvanthony)\
**Post date:** [June 10, 2022, 9:00am UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/11 "2022-06-10T09:00:48Z")

</div>

Yes Yes Yes!!!

The server was built from the minimal ISO and rsyslog was not installed.

Just installed rsyslog. Enabled and started it.

Now the /var/log/maillog file is there with all the stuff from postfix.

Ran /etc/crond.daily/0logwatch and I am receiving the emails from logwatch.

Yahoooooooooooooo!

It is working.

Thank you very much for helping. Could not have figured this out without your help.

Thank you again for helping.

---

<div class="post-metadata">

**Author:** ![markdiss](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@markdiss](https://forums.rockylinux.org/u/markdiss)\
**Post date:** [June 10, 2022, 9:13am UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/12 "2022-06-10T09:13:31Z")

</div>

No problem, it’s bitten me in the a\*\* more than once on a new server build.

M

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [June 10, 2022, 9:41am UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/13 "2022-06-10T09:41:06Z")

</div>

> [@pvanthony](#):
>
> The server was built from the minimal ISO and rsyslog was not installed.

The minimal ISO has only ‘baseos’ packages. The rsyslog is not the only package that is in ‘appstream’ and is included in “the usual yum groups”.

It is probably a good move to (re)install the (environment) group(s) once system has network. Better yet, not rely solely on those groups, but have a list of necessary packages and use some config management tool to ensure that systems have what you need.

---

<div class="post-metadata">

**Author:** ![pvanthony](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/pvanthony/32/1945_2.png) [@pvanthony](https://forums.rockylinux.org/u/pvanthony)\
**Post date:** [June 10, 2022, 4:06pm UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/14 "2022-06-10T16:06:19Z")

</div>

> [@jlehtone](#):
>
> It is probably a good move to (re)install the (environment) group(s) once system has network. Better yet, not rely solely on those groups, but have a list of necessary packages and use some config management tool to ensure that systems have what you need.

Thank you for the advice. I will look into ansible for possible config management.

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:47am UTC](https://forums.rockylinux.org/t/logwatch-not-sending-email/6269/15 "2023-08-25T03:47:49Z")

</div>

Closed on August 25, 2023, 3:47am UTC


