Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Mail::Sender MAIL FROM: does not end with localhost.localdomain

by walkingthecow (Friar)
on Jun 21, 2013 at 14:19 UTC ( #1040179=note: print w/ replies, xml ) Need Help??


in reply to Mail::Sender MAIL FROM: does not end with localhost.localdomain

Are you able to check the logs for the mail server? It sounds to me like the mail server is not set up as an open relay, thus when the cronjob tries to send the email, the server is saying no, because the server's hostname is localhost.localdomain, and the @domain.com does not match that. I.e., you're not spoofing an email on this server...

Odd that it would work when not run as a cronjob... Who does the email come from in the actual header when not run as a cronjob? Does it match the address that you're using as the from address in the script?

Also, you may want to edit out those @xerox.com email addresses. I doubt those people want their email addresses put on here.


Comment on Re: Mail::Sender MAIL FROM: does not end with localhost.localdomain
Re^2: Mail::Sender MAIL FROM: does not end with localhost.localdomain
by essej1 (Novice) on Jun 21, 2013 at 15:26 UTC

    The debug output file eventually pointed me where I should have gone. It turns out that the Mail::Sender module calls 'gethostbyname' which apparently yields the server name when run from the command line but returns "localhost.localdomain" when using cron. Not sure why though. The fix is to add a 'client' line in the new method.

    my $sender = new Mail::Sender ( { smtp => 'a.relay.server.com', from => 'userx@.xyz.com', client => 'linux.server.com', debug => $DEBUG, debug_level => 4, });

    All works now.

    Paradise: Florida, full tank of gas, no appointments.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040179]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (14)
As of 2014-12-17 20:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (33 votes), past polls