LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 10-09-2007, 05:16 AM   #1
jovie
Member
 
Registered: May 2006
Posts: 54

Rep: Reputation: 15
cron email notification, status 0x0045


Hi,

I'm not getting email notifications from my cron jobs. According to the log they're being sent but there's an error...

Code:
[root@localhost html]# tail /var/log/cron
Oct  9 09:45:01 localhost crond[22752]: (jovie) CMD (/home/ann/bin/screen_scraper.pl aaa )
Oct  9 09:45:01 localhost crond[22751]: (jovie) MAIL (mailed 56338 bytes of output but got status 0x0045 )
Oct  9 09:50:01 localhost crond[22786]: (jovie) CMD (/home/ann/bin/screen_scraper.pl aaa )
Oct  9 09:50:01 localhost crond[22785]: (jovie) MAIL (mailed 56338 bytes of output but got status 0x0045 )
So can anyone tell me what status 0x0045 means?

I'm using fredora7.

Thanks
 
Old 10-09-2007, 07:49 AM   #2
jovie
Member
 
Registered: May 2006
Posts: 54

Original Poster
Rep: Reputation: 15
A bit further forward. I found this command to test the mailer...
Code:
[root@localhost html]# echo "test" | mail -v -s test joe.bloggs@somewhere.co.uk
joe.bloggs@somewhere.co.uk... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.14.1/8.14.1; Tue, 9 Oct 2007 11:35:43 +0100
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you
250 ENHANCEDSTATUSCODES
>>> MAIL From:<root@localhost.localdomain>
550 5.0.0 Access denied
root... Using cached ESMTP connection to [127.0.0.1] via relay...
>>> RSET
250 2.0.0 Reset state
>>> MAIL From:<>
550 5.0.0 Access denied
postmaster... Using cached ESMTP connection to [127.0.0.1] via relay...
>>> RSET
250 2.0.0 Reset state
>>> MAIL From:<>
550 5.0.0 Access denied
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection
[root@localhost html]# gedit /etc/hosts.allow &
[1] 23194
[root@localhost html]#
and I found this http://www.linuxquestions.org/questi...s-denied-5893/ thread which says fix it by adding sendmail : ALL to my hosts.allow file. That solves the access denied issue But is it safe?.

Now when I do...
Code:
[joe@localhost Music]$ echo "test" | mail -v -s test joe.bloggs@somewhere.co.uk
joe.bloggs@somewhere.co.uk... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.14.1/8.14.1; Tue, 9 Oct 2007 12:23:37 +0100
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<joe@localhost.localdomain> SIZE=44 AUTH=joe@localhost.localdomain
250 2.1.0 <joe@localhost.localdomain>... Sender ok
>>> RCPT To:<joe.bloggs@somewhere.co.uk>
>>> DATA
250 2.1.5 <joe.bloggs@somewhere.co.uk>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 l99BNb4t023621 Message accepted for delivery
joe.bloggs@somewhere.co.uk... Sent (l99BNb4t023621 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection

Which looks good to me but I don't get an email to the address used. I do get a message in /var/spool/mail/joe which says...
Code:
From MAILER-DAEMON@localhost.localdomain  Tue Oct  9 12:23:37 2007
Return-Path: <MAILER-DAEMON@localhost.localdomain>
Received: from localhost (localhost)
	by localhost.localdomain (8.14.1/8.14.1) id l99BNb4t023623;
	Tue, 9 Oct 2007 12:23:37 +0100
Date: Tue, 9 Oct 2007 12:23:37 +0100
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost.localdomain>
Message-Id: <200710091123.l99BNb4t023623@localhost.localdomain>
To: <joe@localhost.localdomain>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
	boundary="l99BNb4t023623.1191929017/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--l99BNb4t023623.1191929017/localhost.localdomain

The original message was received at Tue, 9 Oct 2007 12:23:37 +0100
from localhost.localdomain [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<joe.bloggs@somewhere.co.uk>
    (reason: 553 5.1.8 <joe.bloggs@somewhere.co.uk>... Domain of sender address joe@localhost.localdomain does not exist)

   ----- Transcript of session follows -----
... while talking to renko.ucs.ed.ac.uk.:
>>> DATA
<<< 553 5.1.8 <joe.bloggs@somewhere.co.uk>... Domain of sender address joe@localhost.localdomain does not exist
550 5.1.1 <joe.bloggs@somewhere.co.uk>... User unknown
<<< 503 5.0.0 Need RCPT (recipient)

--l99BNb4t023623.1191929017/localhost.localdomain
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Tue, 9 Oct 2007 12:23:37 +0100

Final-Recipient: RFC822; joe.bloggs@somewhere.co.uk
Action: failed
Status: 5.1.8
Remote-MTA: DNS; renko.ucs.ed.ac.uk
Diagnostic-Code: SMTP; 553 5.1.8 <joe.bloggs@somewhere.co.uk>... Domain of sender address joe@localhost.localdomain does not exist
Last-Attempt-Date: Tue, 9 Oct 2007 12:23:37 +0100

--l99BNb4t023623.1191929017/localhost.localdomain
Content-Type: message/rfc822

Return-Path: <joe@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.14.1/8.14.1) with ESMTP id l99BNb4t023621
	for <joe.bloggs@somewhere.co.uk>; Tue, 9 Oct 2007 12:23:37 +0100
Received: (from joe@localhost)
	by localhost.localdomain (8.14.1/8.14.1/Submit) id l99BNbIx023620
	for joe.bloggs@somewhere.co.uk; Tue, 9 Oct 2007 12:23:37 +0100
Date: Tue, 9 Oct 2007 12:23:37 +0100
From: joe@localhost.localdomain
Message-Id: <200710091123.l99BNbIx023620@localhost.localdomain>
To: joe.bloggs@somewhere.co.uk
Subject: test

test

--l99BNb4t023623.1191929017/localhost.localdomain--
Now I'm stuck what does it mean "Domain of sender address joe@localhost.localdomain does not exist"?

I have these jobs set up on another machine and the sender address is joe@machineID.co.uk so why does this setup use localhost and how do I change it?

Many thanks for a response.
 
Old 10-10-2007, 03:24 AM   #3
jovie
Member
 
Registered: May 2006
Posts: 54

Original Poster
Rep: Reputation: 15
solved

This is the sendmail config HOWTO I used.
http://www.linuxhomenetworking.com/w...x_Mail_Servers

But all I had to do was edit the /etc/hosts file from
127.0.0.1 localhost.localdomain localhost
to
127.0.0.1 machineID.co.uk localhost.localdomain localhost machineID

and all is now working.
 
Old 10-10-2007, 11:46 AM   #4
shafty023
Member
 
Registered: Oct 2007
Distribution: OSX
Posts: 248

Rep: Reputation: 31
You could either do this:
echo "test" | mail -v -s test joe.bloggs@somewhere.co.uk -- -fUSER@DOMAIN.COM

Where USER@DOMAIN.COM is a valid e-mail address. Notice there is NOT a space after "-f".

Now are you wanting your scripts to send the e-mails or your CRON entries to send standard and error output to an e-mail address?
So:
* * * * * /path/to/executable

where any output standard/error from executable will be sent to user@localhost. Now if you had a .forward file setup for "user" then you could specify an external e-mail address. Please provide more details
 
Old 10-11-2007, 04:37 AM   #5
jovie
Member
 
Registered: May 2006
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks

Quote:
Originally Posted by shafty023 View Post
Now are you wanting your scripts to send the e-mails or your CRON entries to send standard and error output to an e-mail address?
I wanted CRON to send standard and error output to an email address. I got CRON mailing user@localhost using the fix in post#2 then got it mailing an e-mail address by putting
127.0.0.1 machineID.co.uk localhost.localdomain localhost machineID
in the /etc/hosts file.

I don't understand the details of what I did, I just know it's worked. If anyone wants to point out that I just made a gaping hole in security that would be good
 
Old 10-11-2007, 10:56 AM   #6
shafty023
Member
 
Registered: Oct 2007
Distribution: OSX
Posts: 248

Rep: Reputation: 31
Well the issue you were having is the mail server you were attempting to connect to was doing a domain verification. And what you had before "localhost" is not exactly a valid domain so it was denying the msg from going through. Most mail servers perform this kind of check. Domain names can be spoofed as can e-mail addresses so the whole structure of e-mail is technically a security hole.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Email Notification - Perl Script jamesyreid Programming 3 07-21-2009 08:56 AM
Daily Status/Security/Info script.. email notification? JakeX Linux - Software 5 07-04-2006 04:27 PM
cron e-mail notification adm1329 Linux - Newbie 1 06-20-2004 08:27 PM
Suppress mail notification of cron event? jecoltrin Linux - General 2 02-02-2004 01:37 PM
Cron Email Notification(?) jamesyreid Linux - General 2 12-17-2001 11:30 AM


All times are GMT -5. The time now is 10:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration