[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] Help with condor_mail.exe on Windows

Thanks Matt, that's exactly what I was looking for :-)

For the record, I submit a batch file to Condor (windows .bat...), in
which I set different environment variables and launch an executable. At
the end, I call condor_mail in order to send a custom notification. This
allowed me to turn off the Notify_User option in the condor submit file
(that notification became some kind of an annoyance to the users since
it does not give them useful information from their perspective). I used
the syntax:

$ echo some message body | condor_mail -relay mySmtpSever -subject
"Email Subject" dest@xxxxxxxxxx

Would have been nice if we could specify the 'from' field too, but I
can't really complain, it's working great now!



-----Original Message-----
From: Matt Hope
Sent: Wednesday, May 07, 2008 4:02 AM
To: Condor-Users Mail List
Subject: Re: [Condor-users] Help with condor_mail.exe on Windows

On Tue, May 6, 2008 at 9:09 PM, Rahal, Youcef wrote:
> Hi,
> I am trying to get the 'condor_mail' executable send a confirmation
email to
> users at the end of a job (mainly because there is no way of
customizing the
> default email sent by Condor, and I want to be able to put specific
info for
> each job/user).
> So far, I wasn't able to successfully run the binary. It does not come
> command-line help, and the manual does not contain any info on it.
> did not help either. A few attempts to mimic the 'mail' UNIX command
> miserably ;-) [Yup, the machines are all running Windows...]

Download the source and take a look at condor_mail/main.cpp
Sorry, that's how I worked it out. I believe there is a message
floating around in the archives which detailed it (albeit from an
older source).

A-ha the wonders of google mail it's one of mine:

$MAIL -s $SUBJECT [-relay $SMTP_SERVER] ADR1 [ADR2] [ADR3] ...[ADRn]

Where $MAIL is your MAIL parameter. and ADRx is the address list
(guaranteed to be at least one)

-relay SMTP_SERVER only applies on windows so you shouldn't get it
passed to you

Then your mailer should accept the body of the email on it's stdin (I
don't know my C well enough to determine if you are meant to spot a
null on the stream as end of message or detect your stdin closed).

Various variables are inserted into the environment for use by the
process such as LOGNAME - since these are not documented in anyway I
suggest you do not rely on them.

This is from a very quick scan of the code - someone might correct any
glaring errors I have made I hope :)

Hope that helps