LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-06-2009, 08:44 AM   #1
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
Now to send encrypted mails with a script or mail command


Hello, Im trying to send monthly mails with the new root password to 2 mails of mine. Now reseting and sending the mail is done, its easy and with no issue, but how to send the mail more secure, encrypted or thru TLS or something.

How to tell the mail app or mail command to use TLS or to encrypt the mail?!

Please let me know if you have some ideas.

Thanks!
 
Old 03-06-2009, 09:45 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
One option is to gpg encrypt an ascii text file containing the sensitive data. Then send that encrypted file as an attachment. Example:
Code:
$ gpg --encrypt --armor -r <key_userid> <sensitive_file>
 
Old 03-06-2009, 09:47 AM   #3
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Hi,

this can be done easy in a script. Write the mail body to a file, encrypt the file using gpg and send the file via mail to recipient.
 
Old 03-06-2009, 12:55 PM   #4
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Original Poster
Rep: Reputation: 73
Hi, the idea works and is quite good, but when I do the encryption, gpg asks me if I'm sure, something like this:

gpg: 487B0AFD: There is no assurance this key belongs to the named user
Use this key anyway? (y/N).

How can I tell gpg to do it automatic without asking or just to remove the question and just do it?
 
Old 03-06-2009, 01:08 PM   #5
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Hi,

sign the key with
Code:
 gpg --sign-key KEYNAME
but be sure doing this, it will create a trust chain, so this means you should be sure the key belongs to the person named in the key. After that you should be no longer bothered with this question.
 
  


Reply



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
Incomming/outgoing mails+Send mail senthilvael Linux - Newbie 1 02-05-2009 09:03 AM
How to allow roaming mail client to send mails via its mail server satimis Linux - Server 0 01-28-2009 08:59 AM
evolution mail will not send mails claudiorollandin Linux - Newbie 3 10-30-2008 02:50 PM
To restrict a user to send mails only to 3 e-mails IDs using postfix mail server sharath41 Linux - Newbie 2 07-21-2008 07:38 PM
How to take capy of all outgoing mails in send mail parashar_singh8086 Linux - Server 4 09-26-2007 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:58 PM.

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