Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a client requirement to encrypt all outgoing email from a linux server. This can be done using any software, sendmail/postfix etc. They have given me the key they want to use, and want all forms (using php) to be encrpyted. Can I set sendmail/etc to encrypt all emails? This could be done with the same key for all mail.

Thanks

share|improve this question
    
Do you mean encrypt or sign? Encrypting emails usually means having the public key of the recipients... Otherwise, how are the recipients be able to decrypt the messages? –  chmeee May 14 '10 at 10:30
    
chmeee: Where did you see anyone mentioning asymmetric encryption? AliGibbs: What kind of key/encryption are we talking about? Are Web-form-submissions the only thing which need to be encrypted, or are there other mails as well? –  andol May 14 '10 at 10:40
    
Chmeee: Sorry- I mean encrypt, using the public key of the recipents. Andol: I thought about using something like GPG, it is only web form submissions (into our content management system). However from a time prospective, it would be easier (I hope) to encrpyt all mails than change other code. –  AliGibbs May 14 '10 at 11:06
add comment

2 Answers

up vote 2 down vote accepted

If you want to encrypt your outgoing mail using GnuPG, without involving your PHP code, then GNU Anubis might be what you are looking for. It can sit in-front of your SMTP server and (among other things) apply GnuPG encryption to your mails.

The potential issue here is that Anubis both accepts and submits mail using SMTP. While there obviously isn't any problem with using SMTP to pass the mails along to Postfix, PHP tend to use the local sendmail binary. One possible solution, which I haven't tried myself, is to point PHP:s sendmail_path= toward the Anubis helper script msg2smtp.pl

Of course, if there's multiple Postfixes involved, one on your web server as well as one on your companies designated mail server, then there really isn't any problem. In that case all you have to do is simply plug Anubis in between.

share|improve this answer
add comment

If by encrypt you mean that all mail should be sent with SSL/TLS, with postfix then you can simply set smtp_enforce_tls to yes. You can tweak the SSL/TLS settings, check all the smtp_tls_* options.

If you want to encrypt the mail with pgp/gpg/smime, then you probably have to write a filter for that and specify it with content_filter.

share|improve this answer
1  
In modern version of Postfix (2.3+) smtp_tls_security_level= is preferred over smtp_enforce_tls=. –  andol May 14 '10 at 10:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.