FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 08-09-2010, 08:02 PM
Terry Polzin
 
Default Sendmail question

Is there a way to configure sendmail NOT to send messages with empty
bodies?

I have cron jobs that I want stderr and stdout to be mailed to users IF
there is any stderr or stdout from the script. But if there are no
messages, I (root) receive a "null body" error message and the users
receive a blank message. The norm is NOT to have any messages or
errors. My goal is to capture the abnormal conditions and mail those
messages to the proper parties and not rely on root to forward them.

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-09-2010, 08:26 PM
 
Default Sendmail question

Terry Polzin <foxec208@wowway.com> writes:
> Is there a way to configure sendmail NOT to send messages with empty
> bodies?

Sendmail is an MTA. It isn't a good idea for the MTA to second guess
intentions. Yes, some other OS's might do things that way, but that
isn't the un*x way. If you have a program that sometimes generates
output that should be mailed off you can easily have it capture the
output in a file and only mail that file if the file is no-zero.

programname > /tmp/log$$ 2>&1
if [ -n /tmp/log$$ ]
then
/bin/mail -s "programname run at $(date)" username
fi
/bin/rm /tmp/log$$

--
Wolfgang S. Rupprecht http://www.wsrcc.com/wolfgang/ (IPv6-only)
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-09-2010, 08:26 PM
Kwan Lowe
 
Default Sendmail question

On Mon, Aug 9, 2010 at 4:02 PM, Terry Polzin <foxec208@wowway.com> wrote:
> Is there a way to configure sendmail NOT to send messages with empty
> bodies?
>
> I have cron jobs that I want stderr and stdout to be mailed to users IF
> there is any stderr or stdout from the script. *But if there are no
> messages, I (root) receive a "null body" error message and the users
> receive a blank message. *The norm is NOT to have any messages or
> errors. My goal is to capture the abnormal conditions and mail those
> messages to the proper parties and not rely on root to forward them.

It's better to do this on the script side rather than modifying
sendmail configuration.

You could, for example, send stderr and stdout to a file. If the file
is non-zero, send the files, otherwise just exit.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-09-2010, 08:47 PM
Terry Polzin
 
Default Sendmail question

On Mon, 2010-08-09 at 13:26 -0700, Wolfgang S. Rupprecht wrote:
> Terry Polzin <foxec208@wowway.com> writes:
> > Is there a way to configure sendmail NOT to send messages with empty
> > bodies?
>
> Sendmail is an MTA. It isn't a good idea for the MTA to second guess
> intentions. Yes, some other OS's might do things that way, but that
> isn't the un*x way. If you have a program that sometimes generates
> output that should be mailed off you can easily have it capture the
> output in a file and only mail that file if the file is no-zero.
>
> programname > /tmp/log$$ 2>&1
> if [ -n /tmp/log$$ ]
> then
> /bin/mail -s "programname run at $(date)" username
> fi
> /bin/rm /tmp/log$$
>
> --
> Wolfgang S. Rupprecht http://www.wsrcc.com/wolfgang/ (IPv6-only)
yes, I figured this might be the responses I would get. But I (root)
doesn't "own" the script. It's a (poorly) written user script <sigh>.
I'm not allowed (at work) to control the users or the programmers
<another sigh>

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 08-10-2010, 08:55 AM
JB
 
Default Sendmail question

Terry Polzin <foxec208 <at> wowway.com> writes:

>
> Is there a way to configure sendmail NOT to send messages with empty
> bodies?
>
Hi,
How about using a proxy ?

http://en.wikipedia.org/wiki/SMTP_proxy
...
When SMTP proxies are placed on the outgoing network, they typically are used to
intercept all SMTP connections to make sure that unauthorized e-mail, spam,
e-mail worms, etc. are not sent from the network.
...
JB




--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 10:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org