Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cronjob sending Email successfully with exec failed. errno=2 on log

836793Feb 4 2011 — edited Feb 6 2011
Hi,

We are using a cron job to send emails about status. Due to security restrictions we are not running any SMTP client in the application server. In stead we are using a separate SMTP server and directly sending the mail content with from and to address to SMTP servers 25 port.

We are using the below code to achieve this.

exec 3<>/dev/tcp/$smtp/25
+ cat << EOF >&3+
HELLO `hostname`
MAIL From: <$from>
RCPT To: <$email>
RCPT To: <$email2>
DATA
Subject: $summary_subj
Reply-To: <$from>
+`mail_summary_body`+
+.+
QUIT
EOF
+ cat <&3+

It successfully executes to job and sends us emails.

However, in /var/cron/log it sends an error.

+> CMD: /mnt/xxxx/xxxxx/xxxx/xxxx.sh+
+> root 14286 c Fri Feb 4 06:33:00 2011+
+< root 14286 c Fri Feb 4 06:33:00 2011+
exec failed. errno=2.


Can you please let me know what is going on. Why am i seeing errors when the job is running just fine.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 6 2011
Added on Feb 4 2011
3 comments
705 views