[ale] odd email issue

Lightner, Jeff JLightner at water.com
Wed Jun 15 09:21:22 EDT 2011


Usually if something runs differently from cron (or other automated
background process) than from command line it is an environmental
difference.   You might want to run "env" at command line and save its
output then set your cron job to run a script that first saves env
output then runs the mail command.  You can then compare the two env
outputs to see if there are different variables involved.

Most common issues are:
PATH is different and some command isn't being found or is being found
in a different location so isn't using the one you think.  (e.g. What is
the path to "date"?  "mail"?  any other commands you're using?

Lack of terminal.  Some things key off your TERM type or tty (pty) and
background processes don't have one so you have to be sure to have the
background process not using any command that might rely on this.  (This
usually causes ugly output in sourcing things like .bash_profile,
.bashrc, .profile, /etc/profile etc... but that ugly output itself isn't
usually a problem.)

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of
Geoffrey Myers
Sent: Wednesday, June 15, 2011 9:12 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] odd email issue

David Tomaschik wrote:
> On Wed, Jun 15, 2011 at 8:52 AM, Geoffrey Myers
> <lists at serioustechnology.com> wrote:
>> Robert Coggins wrote:
>>> On 6/15/2011 8:11 AM, Geoffrey Myers wrote:
>>>> So, I've got sendmail configured so it uses localhost for sending
email.
>>>>    As a normal user I can send email like this:
>>>>
>>>> date|mail email at domain
>>>>
>>>> Yet, I've recently configured /etc/aliases to send root email to my
>>>> personal email address:
>>>>
>>>> root:           email at domain
>>>>
>>>> But I get delayed email messages from 1and1, my domain host for
these
>>>> emails because my machine name (centsovm.serioustechnology.com) is
not
>>>> valid.
>>>>
>>>> So, how is this possible?
>>>>
>>> Maybe it has something to do with not being able to contact that
>>> server.  I cannot resolve that address.
>> The issue is, when I send it from the command line, it is apparently
>> using my localhost.  When the cron job runs and redirects email via
>> /etc/aliases, it appears to be using the mail server for my hosting
company.
>>
>> Why the inconsistency?
>>
>> Really, how is this even possible?
> 
> Do you have sendmail configured to use a relayhost?  Would you mind
> putting headers from the two different emails on a pastebin somewhere
> for comparison?

No relayhost.  I'll see if I can get some useful header info.  What 
baffles me is it appears that this one machine uses localhost from the 
command line and my hosting company mail server for cron output.

How is that even possible?


-- 
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson
_______________________________________________
Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
 
Proud partner. Susan G. Komen for the Cure.
 
Please consider our environment before printing this e-mail or attachments.
----------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------



More information about the Ale mailing list