Re: bsmtp authentication

Bill Arlofski via Bacula-users <[email protected]>
Newsgroups gmane.comp.bacula.user
Message-ID <[email protected]>
On 3/26/25 5:25 AM, Mehrdad Ravanbod wrote:
 >
 > Hi guys
 >
 > I am trying to set up the messaging part of bacula to send alerts and
 > using the built in bsmtp, but running into problems
 >
 > The SMTP server that we are using needs authentication for the senders
 > adress, and it seems like bsmtp does not handle this, i.e there is no
 > way to send a password for the sender to the smtp-server, am i correct
 > or did i miss something??

You are correct.  bsmtp is a simple one-shot SMTP client with no authentication mechanisms.


 > And if this is the case, what is the alernative aside from using another program instead of bsmtp??

One alternative is to use another SMTP client like `mailx` or whatever you are comfortable with.

Also, something to recognize is that the `mailcommand` setting in Messages{} resources can be used to call any command or 
script you like. And, said script can do whatever you want to happen when Bacula sends an email - ie: send custom stat
us 
messages to slack, or to other monitoring tools, etc. The `mailcommand` does not have to just send email. :)

And, since bsmtp is a "one-shot" SMTP client, if the mail server is unreachable in the moment Bacula is trying to send an 
email, the message will be lost.

Due to this, I always recommend setting up a simple Postfix (a real MTA) installation on the Bacula Director system that will 
store and forward the email messages from Bacula - retying as necessary in the case of networking issues or mail server being 
temporarily offline - so your Bacula email messages do not get lost.

You can then safely have your `mailcommand` still call `bsmtp` to send emails to `-h localhost` on whatever port you 
configure the local Postfix to listen on. Then simply configure Postfix to accept messages from localhost with no 
authentication/encryption, and then relay the email messages to your mail server using any necessary SMTP authentication 
required by your email server.


H
ope this helps,
Bill

-- 
Bill Arlofski
[email protected]

_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users
signature.asc (application/pgp-signature, 583 B)
-----BEGIN PGP SIGNATURE-----
Version: ProtonMail

wsCpBAEBCABdBYJn5A5eCZBIDTDab9XDQDUUAAAAAAAcABBzYWx0QG5vdGF0
aW9ucy5vcGVucGdwanMub3Jn3IxKIYBJoSWosHGGYfG0hxYhBMuLnlBaSQiu
SUbb6UgNMNpv1cNAAADfFwf7BWCfkkjfSRpCYWzeI1RBfm+EqwWYlwLaC7VY
raGlWG114OlSrMPNHFnKF6VUnTzumCSnas5KEc27f+zNC59rAN22wNUGFdgW
dhQF8+laIuDQYHOvl+3sm098XMCRhLvRIzkQS7ryXX5Fm6oCRDtkm/pAAF5O
R4BDYPD3rWID3o4eGfbw/1Evzuafe0Elrb+x0vm6WW/dkaJbgptpOGI8p3ec
RVogrie4Vxz0H1z+FIAeiyvFhp10kRRcX6sEzThWyG3/uVgdi8sScBhctFbE
JzmseVEQnLk5GT8Zkwep9Scv9hk7EgXeAnSWps/1dFC/z5unCMebOd0fior3
4j87/A==
=7bFt
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.