Sending Bacula Status Mails With SMTP Authentication

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

16/8/2018 sending bacula status mails with smtp authentication

A new version of the Article Button plugin for Joomla 2.5 can be found here.

Home Impressum Login Kontakt Sitemap

Aktuelle Seite: Home Blogs IT-Blog sending bacula status mails with smtp authentication Suchen...

Main Menu sending bacula status mails with smtp authentication

Home Yesterday i decided to enable the mailing feature of bacula, to keep informed about backups that did not work.

Tätigkeitsbereiche
Normally you can easily configure that in the bacula-dir.conf file, by uncommenting/setting the mailcommand and the email-address.
Open-Source etc. The default entries look similar to this:

IT-Blog

Downloads 1 mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\"


-s \"Bacula: %t %e of %c %l\" %r"
Kontakt mail = root@localhost = all, !skipped
Links

The mailcommand bsmtp is a bacula-builtin and the %r gets replaced with the email-address from "mail".
In this example all mails except the skipped ones get sent to root@localhost.

In my case i could not use bsmtp because i need authentication on the smtp server to send mails, like gmail also needs.
So i had to look for an alternative and i found sendEmail that is also available as Debian package.
sendEmail is a very powerful smtp-command-line tool. The installation on Debian is quite simple.

1 apt-get install sendemail

Now i changed the mailcommand to the following: (you have to put it in one line!)

1 mailcommand = "/usr/bin/sendEmail -f fromaddress@mybackupserver.at -t


%r -u \"Bacula: %t %e of %c %l\" -m Intervention needed! -s
smtp.mymailserver.at -o tls=no -xu myusernamer -xp mypassword"

-f is the from address


-t is the target %r gets replaced by bacula with the mail-address defined
-u is the subject that will look like "Bacula: Backup ERROR of HostBacula Full" in the mail.
-m is the mail body, i really dont know how to put the errorlog for this one job in there...
-s is the mailserver
-o is the authentication, if you want it more secure you should use tls
-xu username
-xp password

I choose to use "MailOnError", because i check all jobs and logs on a regular base so i just want a quick inform if an error occured, if you
use "mail" then you get also informed about succesfully terminated jobs.

Iznatoraf

Posted at 2010-07-02 08:50:20

Very useful. Thank you so much!!!

https://www.fairtec.at/de/it-blog-mainmenu-16/153-sending-bacula-status-mails-with-smtp-authentication 1/2
16/8/2018 sending bacula status mails with smtp authentication
Auf Kommentar antworten

Robert Poehler Ledermüller

Posted at 2010-04-10 23:46:20

Thank you for that tip. I have tried to get statusmail working very long. With your solution it now works very well for me.

Auf Kommentar antworten

Gustavo A. Díaz

Posted at 2010-04-08 21:57:06

I was looking for this to, and you dont need to specify the -m, since bacula adds the body message by stdin. So, the way as example
should be:

mailcommand = "/usr/bin/sendEmail -s mail.example.com -xu mailsend@example.com -xp mailpasswd -f "(Bacula) " -u "Bacula: %t %e
of %c %l" -t %r"
operatorcommand = "/usr/bin/sendEmail -s mail.example.com -xu mailsend@example.com -xp mailpasswd -f "(Bacula) " -u "Bacula:
Intervention needed for %j" -t %r"

Cheers.

Auf Kommentar antworten

Veröffentlichen Sie ihre Kommentare ...

Name*

Email

Website

Ihr Kommentar*

Warning: Creating default object from empty value in


/www/htdocs/w0101274/www/fairtec.at/modules/mod_udjacomments/helper.php on line 387

Kommentar abschicken

Powered by Fairtec, valid XHTML and CSS

https://www.fairtec.at/de/it-blog-mainmenu-16/153-sending-bacula-status-mails-with-smtp-authentication 2/2

You might also like