Koozali.org: home of the SME Server

mail sent from cron; wrong to address

Amanda

mail sent from cron; wrong to address
« on: August 20, 2003, 03:16:37 PM »
How do I set up the To: email address for Cron. I keep getting bounced messages.
My server is called server3, and the domain is home, and only services the internal Lan. I have user email accounts setup, which are fed by fetchmail from my ISP.
The original email, minus all the bounce headers, is as follows;

Return-Path:
Received: (qmail 10902 invoked by uid 0); 19 Aug 2003 18:05:15 -0000
Date: 19 Aug 2003 18:02:03 -0000
Message-ID: <20030819180203.10650.qmail@home>
From: root@home.home (Cron Daemon)
To: admin@home.home
Subject: Cron run-parts /etc/cron.daily
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:

/etc/cron.daily/backup_expenses:

full backup expenses
tar: Removing leading /' from member names
full dump of database
backup finished

Kees Vonk

Re: mail sent from cron; wrong to address
« Reply #1 on: August 22, 2003, 12:02:52 AM »
> X-Cron-Env:

I don't see how you get bounced messages, it looks like it automatically sends mails to the admin account on the local machine: admin@. and that should not bounce as far as I know, not unless you forward the admin mail to an non existant address.

You could try changing your crontab line to something like:

* * * * * root   export MAILTO=some@email.address; backup_expenses

but that is just an educated guess, I have never tried that.

Kees

Amanda

Re: mail sent from cron; wrong to address
« Reply #2 on: August 22, 2003, 01:46:52 AM »
I should have explained it clearer. The admin account is admin@home, but cron is sending email to admin@home.home

This then gets bounced, with mails going to root@home.home and anonymous@home.home

qmail eventually gives up, and sends a failure notice (correctly) to admin@home

Amanda

James Pybus

Re: mail sent from cron; wrong to address
« Reply #3 on: August 22, 2003, 10:24:13 PM »
I have noticed the same thing recently on my box, only because I had a connectivty issue and looked into the mail queue and there were around 400 of these messages bouncing around saying it could not connect to my pop3 server to collect mail.

The only thing I can possibly relate it to is that I have recentlly installed the multi-pop add on.....

Still not solved the issue so if anyone can shed some light that would be great.

James.

Kees Vonk

Re: mail sent from cron; wrong to address
« Reply #4 on: August 23, 2003, 09:30:45 AM »
I am not an expert on these things, but you might be able to at least solve the symptoms of this problem but changing the MAILTO variable in /etc/e-smith/templates/etc/crontab/template-begin from 'root' to 'root@home'. (Make sure you run '/sbin/e-smith/expand-template /etc/crontab' after that, to propagate the changes.)

I am not sure what would cause the problem, the only think I can think of is that 'home' is not a valid domain name as there is no top level domain specified, but again this is just speculation.

Hope this helps, as this is the only thing I can think off,

Kees

Michiel Blotwijk

Re: mail sent from cron; wrong to address
« Reply #5 on: August 23, 2003, 01:39:31 PM »
What does the command 'hostname' say (from the command-line)?

Amanda

Re: mail sent from cron; wrong to address
« Reply #6 on: August 23, 2003, 02:09:32 PM »
I tried changing the MAILTO= line in the template to admin@home.

Mail still got sent to admin@home.home.

the command "hostname" from the command line returns server3.

So I've changed the MAILTO=
to admin@server3.home.

Hopefully this will work.

Amanda