Perl Scripts using sendmail fails | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Perl Scripts using sendmail fails

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-18-2013
dedwinson dedwinson is offline
Registered User
 
Join Date: Jul 2013
Last Activity: 19 July 2013, 12:45 PM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Perl Scripts using sendmail fails

Here's the deal. I have about 60 Perl scripts that run at various times during the month, most run daily. Each script is run via CRON under a service ID account.

All of the scripts create email notifications when they are complete, have errors, deliver files etc. This has been working for years but we just did a patch at the end of June and now the emails don't work.

I have confirmed sendmail DOES work via command line. I also confirmed that the portions of the perl script that composes and sends email DOES work IF you are signed in under the service account ID.

For years we have other scripts that run via command line submission by users that also generate email notices. We have found that IF the user is still logged into the Unix box at the time of script completion, an email will appear in their MS Exchange email box. HOWEVER, if they log out and let the script run "nohup" there will be NO email delivered.

It seems to me that something has happened after the latest patch that changed and made the service account behave like an ordinary user account.

What I am looking for is WHAT would the setting(s) be that would cause any account to behave in this way and hopefully I can reverse what happened to our service account. These notifications are critical to our business.
Sponsored Links
    #2  
Old 07-19-2013
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 20 April 2014, 7:41 PM EDT
Location: NM
Posts: 10,058
Thanks: 251
Thanked 756 Times in 711 Posts
It sounds like sendmail was affected, probably not perl since the other functionality of perl would have come into question by now.

The way to deal with this is what you seem to be starting to do. Isolate sendmail into a single, simple perl script and then instrument the heck out of it. Subject it to all kinds of environments.

So: please,
What OS & version, version of perl are you running?
What patch?
Sponsored Links
    #3  
Old 07-19-2013
dedwinson dedwinson is offline
Registered User
 
Join Date: Jul 2013
Last Activity: 19 July 2013, 12:45 PM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Here's some of the version info:


Code:
SunOS 5.10 Generic_141444-09   -> patched to:  SunOS 5.10 Generic_147440-27
perl 5, version 16, subversion 0 (v5.16.0) built for sun4-solaris-64int

I guess I am having a hard time figuring out what about sendmail would allow the service ID to always send email (logged in or not), but ordinary IDs only send email if logged in.

I am begining to wonder if the service ID, in the past, was always "active" or "logged in" somehow and I never knew it, and now after the patch it isn't. Or maybe something is different with CRON now in how it actually executes the jobs.

Moderator's Comments:
Please use [code] tags to mark up code, not [font] tags.

Last edited by Corona688; 07-19-2013 at 12:33 PM..
    #4  
Old 07-19-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 17 April 2014, 6:29 PM EDT
Location: Saskatchewan
Posts: 18,531
Thanks: 681
Thanked 3,036 Times in 2,856 Posts
Quote:
Originally Posted by dedwinson View Post
I guess I am having a hard time figuring out what about sendmail would allow the service ID to always send email (logged in or not), but ordinary IDs only send email if logged in.
Could it be a PATH issue? Sometimes a service account gets a different default PATH than a normal login.
Sponsored Links
    #5  
Old 07-19-2013
dedwinson dedwinson is offline
Registered User
 
Join Date: Jul 2013
Last Activity: 19 July 2013, 12:45 PM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Just checked the paths. Slightly different, but close enough. Also noted earlier that via command line sendmail works just fine. If pathing was off too much sendmail wouldn't work at all, or I'd get errors in my logs that it couldn't execute sendmail.

The issue only happens when the ID is NOT logged in.
Sponsored Links
    #6  
Old 07-20-2013
MadeInGermany MadeInGermany is offline Forum Advisor  
Registered User
 
Join Date: May 2012
Last Activity: 20 April 2014, 12:29 PM EDT
Posts: 1,598
Thanks: 90
Thanked 452 Times in 409 Posts
sendmail logs via syslog, and syslog.conf normally has /var/log/syslog for that loglevel.
Every outgoing mail is in there, stating success or failure.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Replacing char in filename scripts fails SailingDreams UNIX for Dummies Questions & Answers 6 09-09-2012 06:11 PM
Sendmail fails receiving mail since the IP changed on Redhat Server lamoul Red Hat 3 09-26-2009 12:13 AM
Scripts fails if you change its code during the execution. Klashxx Shell Programming and Scripting 4 07-04-2007 06:43 AM
Need to know why Perl fails. whatsup Shell Programming and Scripting 0 07-12-2006 10:43 PM
SendMail scripts unknown2205 Shell Programming and Scripting 0 03-06-2006 04:35 AM



All times are GMT -4. The time now is 10:02 PM.