<<< Date Index >>>     <<< Thread Index >>>

Re: How to send PGP-encrypted mail non-interactively?



Am 2007-05-10 16:58:12, schrieb Darrin Chandler:
> For the archives, I've got a method working well, though it's not very
> elegant. Here's what I've got going, in a shell snippet:

Why do you use mutt-monster to send such messages?

> ----------
> gpg --encrypt --armor --output foo.pgp $RECIPIENT < foo
> echo encrypted stuff attached | mutt -s Subject -a foo.pgp $RECIPIENT
> ----------


----8<-----------------------------------------------------------------
sendmail -t <<EOF
To: $(RECIPIENT)
From: $(FROM)
Subject: $(SUBJECT)
Date: $(date -R)
Message-Id: <$(date +%s)@$(hostname --fqdn)>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
        protocol="application/pgp-signature"; boundary="1234567890"
Content-Disposition: inline

--1234567890
$(cat foo.pgp)
--1234567890--
EOF
----8<-----------------------------------------------------------------

which works times faster then calling a full blown mutt and specialy if
you uses somehing lime ssmtp.

Note: I send per day nearly 37.000 messages of this kind from my server
      to the emplye of the french "Ministry of Defense" for which I am
      working.

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment: signature.pgp
Description: Digital signature