public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Cron & ssmtp timeouts
@ 2002-04-29  0:47 Gerrit Cap
  0 siblings, 0 replies; 3+ messages in thread
From: Gerrit Cap @ 2002-04-29  0:47 UTC (permalink / raw)
  To: jason, cygwin


>Gerrit,
>
>On Fri, Apr 26, 2002 at 02:03:56PM +0200, Gerrit Cap wrote:
> > I have a few batch jobs that I would like to schedule using cron and have
> > the output e-mailed. For small jobs this works fine but for jobs that run
> > for a period of time no e-mail is being sent. Instead after snooping 
> around
> > I found this error message in /var/log/cron.log:
> > /usr/sbin/ssmtp: connection lost in the middle of processing, exiting.
>
>I had similar problems.
>
> > Any ideas how to solve this ?
>
>Yes, if you are willing to use procmail and read the cron mail (only)
>locally, see the attached patch.  I have patched my cron to deliver mail
>via procmail instead of ssmtp in order to:
>
>     o solve the above problem
>     o prevent mail servers from removing the X-Cron-Env header fields
>     o remove the dependency of multiple mail hops just to send mail
>       to myself
>
>Jason

Jason,

Ok, thanx for the patch, but I solved it differently which gave me an extra 
bonus:
I created another batch script (batch-mail.sh) which launched the original 
batch program (batch.sh), redirected its output to batch.out and e-mails me 
that output. Problem solved and now I have as additional "feature" that my 
e-mails can be tuned to different mailboxes depending on the batch job.

Gerrit.

-------------------- Marble Consulting ----------------------
Gerrit Cap                      http://www.marble.be/
OO Solutions Engineer           mailto:Gerrit.Cap@marble.be
Marble Consulting
Blauwe Gaanweg, 53              tel : +32 475  72.94.36
B-9150 Kruibeke-Bazel           fax : +32 3   744.19.17
Belgium
-------------------- Marble Consulting ----------------------
There is only one thing in the world worse than being witty,
and thats not being witty.          (Monthy Python)



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Cron & ssmtp timeouts
  2002-04-26  6:40 Gerrit Cap
@ 2002-04-26  8:49 ` Jason Tishler
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Tishler @ 2002-04-26  8:49 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

Gerrit,

On Fri, Apr 26, 2002 at 02:03:56PM +0200, Gerrit Cap wrote:
> I have a few batch jobs that I would like to schedule using cron and have 
> the output e-mailed. For small jobs this works fine but for jobs that run 
> for a period of time no e-mail is being sent. Instead after snooping around 
> I found this error message in /var/log/cron.log:
> /usr/sbin/ssmtp: connection lost in the middle of processing, exiting.

I had similar problems.

> Any ideas how to solve this ?

Yes, if you are willing to use procmail and read the cron mail (only)
locally, see the attached patch.  I have patched my cron to deliver mail
via procmail instead of ssmtp in order to:

    o solve the above problem 
    o prevent mail servers from removing the X-Cron-Env header fields
    o remove the dependency of multiple mail hops just to send mail
      to myself

Jason

[-- Attachment #2: cron.patch --]
[-- Type: text/plain, Size: 564 bytes --]

--- config.h.orig	Tue Jan  8 10:22:06 2002
+++ config.h	Tue Jan  8 10:24:25 2002
@@ -41,8 +41,11 @@
 			 * (hint: MAILTO= was added for this reason).
 			 */
 
-#define MAILCMD _PATH_SENDMAIL					/*-*/
-#define MAILARGS "%s -FCronDaemon -odi -oem %s"			/*-*/
+#define MAILCMD "/usr/local/bin/procmail"
+#define MAILARGS "%s -d %s"
+
+/* #define MAILCMD _PATH_SENDMAIL					-*/
+/* #define MAILARGS "%s -FCronDaemon -odi -oem %s"			-*/
 			/* -Fx	 = set full-name of sender
 			 * -odi	 = Option Deliverymode Interactive
 			 * -oem	 = Option Errors Mailedtosender


[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Cron & ssmtp timeouts
@ 2002-04-26  6:40 Gerrit Cap
  2002-04-26  8:49 ` Jason Tishler
  0 siblings, 1 reply; 3+ messages in thread
From: Gerrit Cap @ 2002-04-26  6:40 UTC (permalink / raw)
  To: cygwin

Hello,

I have a few batch jobs that I would like to schedule using cron and have 
the output e-mailed. For small jobs this works fine but for jobs that run 
for a period of time no e-mail is being sent. Instead after snooping around 
I found this error message in /var/log/cron.log:
/usr/sbin/ssmtp: connection lost in the middle of processing, exiting.

It is very difficult if not impossible to split the job in smaller parts so 
each part could be launched in a seperate cron job.

Any ideas how to solve this ?

Gerrit.



-------------------- Marble Consulting ----------------------
Gerrit Cap                      http://www.marble.be/
OO Solutions Engineer           mailto:Gerrit.Cap@marble.be
Marble Consulting
Blauwe Gaanweg, 53              tel : +32 475  72.94.36
B-9150 Kruibeke-Bazel           fax : +32 3   744.19.17
Belgium
-------------------- Marble Consulting ----------------------
There is only one thing in the world worse than being witty,
and thats not being witty.          (Monthy Python)



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-04-29  6:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-29  0:47 Cron & ssmtp timeouts Gerrit Cap
  -- strict thread matches above, loose matches on Subject: below --
2002-04-26  6:40 Gerrit Cap
2002-04-26  8:49 ` Jason Tishler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).