Bacula-users

Re: [Bacula-users] How to send a mail after a Job ?

2009-06-11 02:21:20
Subject: Re: [Bacula-users] How to send a mail after a Job ?
From: Silver Salonen <silver AT ultrasoft DOT ee>
To: Tolj Mario <mario.tolj AT champittet DOT ch>
Date: Thu, 11 Jun 2009 09:18:13 +0300
On Thursday 11 June 2009 09:00:18 Tolj Mario wrote:
> Silver Salonen a écrit :
> > On Wednesday 10 June 2009 16:25:42 Willians Vivanco wrote:
> >   
> >> Tolj Mario wrote:
> >>     
> >>> Hello,
> >>>
> >>> Sorry if my english isn't very well.
> >>>
> >>> I'm trying to configure Bacula to send me a mail after a Job (Succes or 
> >>> Error, etc...). but i'm not sure how to configure that.
> >>>
> >>> My Linux server is in my windows Active Directory, so i try to send a 
> >>> mail to two of my Active Directory users (user1 AT test DOT ch and 
user2 AT test DOT ch)
> >>>
> >>> In the bacula-dir.conf i'have try to only put the email addresses in the 
> >>> Message ressource separated by a ";" but it doesn't work. I think it's a 
> >>> little bit more complicated than that :)
> >>>
> >>> Messages {
> >>>   Name = Standard
> >>>   mailcommand = "/usr/sbin/bsmtp -h *user1 AT test DOT ch;user2 AT test 
> >>> DOT ch* \ -f 
> >>> \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
> >>>   operatorcommand = "/usr/sbin/bsmtp -h *user1 AT test DOT ch;user2 AT 
> >>> test DOT ch \* 
> >>> -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
> >>>   console = all, !skipped, !saved
> >>>   append = "/var/lib/bacula/log" = all, !skipped
> >>> }
> >>>
> >>>   
> >>>       
> >> As simple as create an script that send the emails and call it from the 
> >> job resource using the "runAfterJob" attribute... This was my solution 
> >> and it works... Maybe isn't the best one. But it results for me.
> >>
> >> Regards
> >> Willians
> >>     
> >
> > I think the right way to do it would be to use the correct Messages 
resource, 
> > so let's try to fix it :)
> >
> > bsmtp's -h specifies host to use for sending mail, eg. localhost. If you 
want 
> > to send the e-mail to multiple adresses, specify them in "mail" parameter, 
eg:
> > Messages {
> >   ....
> >   mail = user1 AT test DOT ch, user2 AT test DOT ch = all, !skipped
> > }
> >
> >   
> I have try your solution, but it doesn't work, this message appears:
> 
> /11-jun 07:54 localhost-dir JobId 55: message.c:482 Mail prog: bsmtp: 
> bsmtp.c:435 Fatal connect error to localhost: ERR=Connexion refusée/  ( 
> in english : Connexion refused)

This means that your server does not deliver e-mails by itself, so you have to 
use some other server, eg: -h your.smtp.server.ch

-- 
Silver

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users