| Sending mail | Sending mail from command line. |
sendmail -t << EOF From: FROMADDRANDNAME To: TOADDR Subject: SUBJECT BODY EOF
mail -s SUBJECT TOADDR << EOF BODY EOF
This example tries to follow RFC2015. It does not do that perfectly because you should convert from \n to \r\n before the gpg line.
apt-get install mime-constructmime-construct --subpart --type "text/plain; charset=iso-8859-1" --encoding quoted-printable --file testing.body > testing2.body gpg --armor --detach-sign --textmode --comment "" testing2.body mime-construct --multipart 'multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"' --to "ola@opal.dhs.org" --subject "Test signed." --subpart-file testing2.body --type application/pgp-signature --file testing2.body.ascA better RFC complant version should be this (it is not tested though):
mime-construct --subpart --type "text/plain; charset=iso-8859-1" --encoding quoted-printable --file testing.body > testing2.body perl -pi -e "s/\n/\r\n/g;" testing2.body gpg --armor --detach-sign --textmode --comment "" testing2.body mime-construct --multipart 'multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"' --to "ola@opal.dhs.org" --subject "Test signed." --subpart-file testing2.body --type application/pgp-signature --file testing2.body.asc
apt-get install mime-codecsqp-encode qp-decode base64-encode base64-decode
Instead of the standart mail(x) command you could install nail instead. It supports from address changing, attachments, etc.
apt-get install nail
Martin F Krafft sent me a mail with a Makefile that takes an FRC822 message and sign it to produce .msg. I have added it here for completeness.
Copyright © 2005 Ola Lundqvist |