\GPGMailer
Mailer that encrypts contents of email using GPG. Encrypting HTML is not implemented, quite difficult and requires a very simple HTML template that can be encrypted and re-wrapped in body tags.
Necessary to provide keyring files via Crypt_GPG options in YAML.
Synopsis
class GPGMailer
extends Mailer
{
- // methods
- public void __construct()
- private void setOptions()
- public mixed sendPlain()
- public mixed sendHTML()
- public string encodeFileForEmail()
- public void validEmailAddr()
Hierarchy
Extends
- Mailer
Tasks
Line | Task |
---|---|
23+ | HTML encryption if possible, look into PGP/MIME |
23+ | Ability to add additional encryption and signing keys |
23+ | correct headers for Content-Transfer-Encoding, should be base64 for ASCII armor? Only accepts binary|8bit|7bit not quoted-printable|base64 http://en.wikipedia.org/wiki/MIME#Content-Transfer-Encoding http://www.techopedia.com/definition/23150/ascii-armor https://tools.ietf.org/html/rfc3156 http://docs.roguewave.com/sourcepro/11.1/html/protocolsug/10-1.html https://www.gnupg.org/documentation/manuals/gnupg/Input-and-Output.html "Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation." |
23+ | Content-Type header to include protocol="application/pgp-encrypted" https://tools.ietf.org/html/rfc3156 |
116+ | conversion of BCC -> Bcc necessary in this method as well as sendHTML()? |
254+ | test with filename instead of array passed as $file, see Email::attachFile() and ::attachFileFromString() |
254+ | test with $destFilename |
254+ | test with disposition set to inline |
254+ | test with contentLocation param, see Mailer::encodeFileForEmail() |
284 | Need to test with contentLocation param |
304 | Need to test with contentLocation param |
Members
private
- $gpg
—
Crypt_GPG
Instance of Crypt_GPG - $options
—
array
Options for Crypt_GPG - $sign
—
boolean
Whether to sign the email also
Methods
private
- setOptions() — Set options for Crypt_GPG.
public
- __construct() — Set options for Crypt_GPG and add encrypting and signing keys.
- encodeFileForEmail() — Encode file for email, encryption results in ASCII armored data which removed need for base 64 encoding step.
- sendHTML() — Encrypting HTML emails does not work so this method triggers a warning and sends using sendPlain() and plaintext version of the HTML content.
- sendPlain() — Encrypt and send plain text email, large amount of copy paste from Mailer::sendPlain().
- validEmailAddr() — Handle the renaming of the validEmailAddr method in silverstripe-framework 3.2.0.