LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-21-2008, 08:57 AM   #1
Red Pantyhose
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Rep: Reputation: 0
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

Last edited by Red Pantyhose; 07-21-2008 at 09:13 AM.
 
Old 07-21-2008, 10:39 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
# 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"
This should work, it might be that the bacula user doesn't know where gpg is located, so putting full path might work. This is what the original looks like:

Code:
mailcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
Try something like this:

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"
The second one you posted wouldn't work cause well, why would you start off with a | (pipe) for the command?

Last edited by trickykid; 07-21-2008 at 10:45 AM.
 
Old 07-22-2008, 02:00 AM   #3
Red Pantyhose
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Original Poster
Rep: Reputation: 0
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 ;.) ...

Last edited by Red Pantyhose; 07-22-2008 at 02:10 AM.
 
Old 07-22-2008, 07:03 AM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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
Manually from the command?
 
  


Reply

Tags
bacula, bsmtp, email, encrypt, gnupg, gpg, mail, messages



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to send and receive "Net Send" messages in Linux? Avatar Linux - Networking 16 07-11-2010 09:42 PM
encrypt and decrypt using encrypt(char block[64], int edflag) rockwell_001 Linux - Security 3 08-30-2009 09:16 AM
LXer: Encrypt and sign Gmail messages with FireGPG LXer Syndicated Linux News 0 06-04-2007 07:31 PM
send messages bong.mau Linux - Networking 2 05-27-2007 08:48 PM
How to send messages through TCP/IP? shassouneh Linux - Networking 1 09-26-2002 03:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration