LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   cron email notification, status 0x0045 (https://www.linuxquestions.org/questions/fedora-35/cron-email-notification-status-0x0045-590466/)

jovie 10-09-2007 04:16 AM

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

jovie 10-09-2007 06:49 AM

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.

jovie 10-10-2007 02:24 AM

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. :):D:cool:

shafty023 10-10-2007 10:46 AM

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

jovie 10-11-2007 03:37 AM

Thanks

Quote:

Originally Posted by shafty023 (Post 2919782)
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 ;)

shafty023 10-11-2007 09:56 AM

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.


All times are GMT -5. The time now is 05:44 AM.