BACULA: encrypt messages with gnupg and send them to bsmtp
Dear Readers
We like to pipe the bacula bsmtp-Messages through gpg because our backup-script run by the RunBeforeJob Option produces very sensitive information. Is there a possibility to do this ? # this works echo 'streng geheim' | gpg --encrypt --always-trust -a -r wgsupport@myhost.ch - | /usr/sbin/bsmtp -h mail.myhost.ch -f test@myhost.ch -s "test" dummy@myhost.ch # but inside bacula-dir.conf this fails : mailcommand = "gpg --encrypt --always-trust -a -r wgsupport@myhost.ch - | /usr/sbin/bsmtp -h mail.myhost.ch -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r" # and this one fails too mailcommand = " | gpg --encrypt --always-trust -a -r wgsupport@myhost.ch - | /usr/sbin/bsmtp -h mail.myhost.ch -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r" Thanks Denis |
Quote:
Code:
mailcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r" Code:
mailcommand = "/usr/bin/gpg --encrypt --always-trust -a -r wgsupport@myhost.ch - | /sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r" |
It doesn't work :
22-Jul 08:58 typhon-dir JobId 296: message.c:481 Mail prog: usage: gpg [options] --encrypt [filename] 22-Jul 08:58 typhon-dir JobId 296: Error: message.c:492 Mail program terminated in error. CMD=/usr/bin/gpg --encrypt --always-trust -a -r wgsupport@myhost.ch - | /usr/sbin/bsmtp -h mail.myhost.ch -f "(Bacula) wgsupport@myhost.ch" -s "Bacula: Backup OK of amd64-fd Incremental" wgsupport@myhost.ch ERR=Child exited with code 2 Any ideas ? The gpg-key is allready imported ;.) ... |
What happens if you run:
Code:
/usr/bin/gpg --encrypt --always-trust -a -r wgsupport@myhost.ch - | /usr/sbin/bsmtp -h mail.myhost.ch -f "(Bacula) wgsupport@myhost.ch" -s "Bacula: Backup OK of amd64-fd Incremental" wgsupport@myhost.ch |
All times are GMT -5. The time now is 11:05 AM. |