Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here's an odd problem. I've set up logwatch (ubuntu server) to send email to info@example.com which is running google apps email. But I'm not receiving any logwatch emails. However, if I try logwatch --mailto foobar@gmail.com 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 info@example.com 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.

share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
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 '11 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 '11 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 '11 at 10:28
add comment

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 me@me.com

share|improve this answer
    
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 '11 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. –  Jonathan Ross Apr 13 '11 at 10:08
    
Interesting but why is it that logwatch --mailto info@example.com didn't work at the command-line? –  molidoli Apr 13 '11 at 10:10
    
I suspect that might be more to do with your mail server than Logwatch config. –  Jonathan Ross Apr 13 '11 at 10:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.