Bacula-users

[Bacula-users] Getting email notifications to work in Bacula 5.2.13

2013-06-20 14:16:15
Subject: [Bacula-users] Getting email notifications to work in Bacula 5.2.13
From: Mohd Shukri <7141175 AT gmail DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 21 Jun 2013 02:13:22 +0800
Hi Phil,
 Noted and thank you for your reply. I will look into mutt now.
 At the same time, I also found out that if I comment out the mailcommand directive, then I do receive email notifications with the subject "Bacula Message" and the body containing the output from the job ran. Based on the documentation, this means that the command used was:
 mail -s ”Bacula Message” <recipients>
   However, I do not have the mail command installed. Any insights as to how the mail was sent?
  My MTA is mail-mta/ssmtp-2.64-r2.

On 06/19/13 15:47, Mohd Shukri wrote:
> Hi,
> 
>  I am not able to get the email notifications to work. I can't use bsmtp
> as I want to use my gmail account to send it so I have decided to use
> sendmail.
> 
>  I am able to send emails using sendmail from the command line and as
> the user 'bacula'. I have tried the suggestions in the Problem
> Resolution Guide
> <http://www.bacula.org/5.2.x-manuals/en/problems/problems/index.html> but nothing
> seems to work. Also, I tried using sendEmail by following this guide
> <http://www.fairtec.at/en/it-blog-mainmenu-16/153> and that too dd not work.
> 
>  So, either I am missing something obvious or the mailcommand directive
> in the Message resource does not work. My message Resource is as follows:
> 
>   Messages {
>   Name = Standard
>   mailcommand = "echo hello | sendmail %r"
>   operatorcommand = "echo hello | sendmail %r"
>   mail = myaddr <at> hotmail.com <mailto:myaddr <at> hotmail.com> = all, !skipped
>            
>   operator = myaddr <at> hotmail.com <mailto:myaddr <at> hotmail.com> = mount
>   console = all, !skipped, !saved
>   append = "/var/lib/bacula/bacula.log" = all, !skipped
>   catalog = all
> }
> 
> 
>  My system info is as follows:
> 
>   1. OS : Gentoo Linux
> 
>   2. Bacula version: 5.2.13
> 
>     Please advise.

My advice?  Try something like this:

  mailcommand = "/usr/bin/mutt -F /root/.muttrc-bacula -s \"\(Bacula\)
\<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/bin/mutt -F /root/.muttrc-bacula -s
\"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"

where .muttrc-bacula looks something like this:

#
# Mutt configuration file for Bacula (we hardly need anything)
#
set alias_file="~/aliases"
set from="Bacula <bacula <at> babcom.com>"
set realname="Bacula Storage Management System"
set use_8bitmime=yes

I don't know what MTA you have installed (my server, which also runs
Gentoo, uses Postfix), but a direct pipe to sendmail is seldom the best
way to deliver mail, and in fact, on Gentoo it is almost certain that a
direct unformatted pipe to /usr/sbin/sendmail without additional options
will not work as you probably intend.

(Note that /usr/sbin/sendmail is almost certainly NOT going to be the
Sendmail MTA, mail-mta/sendmail, unless you manually chose to replace
the system MTA with Sendmail yourself, and if you knew enough Sendmail
to make that decision, you probably wouldn't be asking this question in
the first place.)

-- 
  Phil Stracchino, CDK#2     DoD#299792458     ICBM: 43.5607, -71.355
  alaric <at> caerllewys.net   alaric <at> metrocast.net   phil <at> co.ordinate.org
  Renaissance Man, Unix ronin, Perl hacker, SQL wrangler, Free Stater
                 It's not the years, it's the mileage.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users