1

Here's an odd problem. I've set up logwatch (ubuntu server) to send email to [email protected] which is running google apps email. But I'm not receiving any logwatch emails. However, if I try logwatch --mailto [email protected] at the command-line (i.e. directly sending email to my private, gmail hosted mail) I get the logwatch email.

So why doesn't my [email protected] account receive the logwatch email? I can both read and send other email from the google apps web interface so the account is actually working except for this situation.

2 Answers 2

0

The machine you are sending the mail from probably thinks example.com's mail is hosted locally. Instead of going out to the web to check where mail would route, it is just going "oh hey I have that domain right here" and using it's localhost mail system to deliver. You need to remove whatever software and configs make the system thing it can handle @example.com mail internally. Your test sending to @gmail.com of course side stepped this by using a domain name that it knows is external.

3
  • Aha, this could be it. The hostname is the IRL equivalent of example.com and i'm trying to send mail to that server! So how would I fix this? I'm pretty much running a out-of-the-box postfix installation.
    – molidoli
    Apr 13, 2011 at 10:12
  • I don't know postfix configs very well. In exim I would change the "accept mail for" and "accept relay for" settings such that example.com was not in this list. On some servers this would mean removing $HOSTNAME from the list.
    – Caleb
    Apr 13, 2011 at 10:25
  • Update: It works! I just edited nano /etc/postfix/main.cf and remove example.com from mydestination. Thanks Caleb!
    – molidoli
    Apr 13, 2011 at 10:28
0

There were some recent Logwatch version changes which broke outbound mail on Ubuntu but you are using the correct syntax, maybe the Cron entry is broken (it's not enough to just add your mail address the the logwatch.pl script any more):

This file /etc/cron.daily/00logwatch should look like this:

test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0

/usr/sbin/logwatch --mailto [email protected]

4
  • Ok, I don't even have a cronjob for logwatch. Since when is this required. I've updated /etc/cron.daily/00logwatch accordingly.
    – molidoli
    Apr 13, 2011 at 10:05
  • 6- 12 months ago, I reckon. The default install creates that cron file though. Just create the file 00logwatch in /etc/cron.daily, add those lines and check it's executable and the crontab runs cron.daily as expected. Apr 13, 2011 at 10:08
  • Interesting but why is it that logwatch --mailto [email protected] didn't work at the command-line?
    – molidoli
    Apr 13, 2011 at 10:10
  • I suspect that might be more to do with your mail server than Logwatch config. Apr 13, 2011 at 10:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .