Mailinglisten-Archive |
Hallo Liste,
wie kann ich etwas geschickter eine Mail signieren?
Bis jetzt gehe ich folgendermassen vor:
######################################################
srand ((double) microtime()*1000000);
$tempfilename = "/tmp/NIKUK/".$domain."#".rand();
$tempoutname = "$tempfilename.asc";
$file = fopen ($tempfilename, "w");
fwrite ($file, $body);
fclose ($file);
exec(EscapeShellCmd ("./script.sh $tempfilename"));
if (file_exists ($tempoutname)) {
$file = _(at)_fopen ($tempoutname, "r");
if ($file) {
$body = fread ($file, 10000);
_(at)_fclose ($file);
if ($nomail != "yes") {
mail($email, $subject, $body);
}
}
}
_(at)_unlink ($tempfilename);
######################################################
Ich schreibe also den unsignierten Mailinhalt in eine temporäre Datei,
signiere und lese diese
Das Shellscript sieht etwa so aus:
######################################################
export GNUPGHOME=$GNUPGDIR
/usr/bin/sudo -u <user> /bin/bash -c \
"/bin/cat $GNUPGHOME/mymantra | /usr/bin/gpg -aq --yes --batch \
--no-tty --no-comment --no-version --passphrase-fd 0 -o \
$1.asc --clearsign $1"
######################################################
Gibt es also einen einfacheren Weg als über eine temporäre Datei, kann
ich also quasi den Inhalt einer Variablen signieren?
--
Mit freundlichen Grüßen
Marco Schumann
united-domains AG
Tel.: 0 81 51 / 3 68 67 - 0
Fax: 0 81 51 / 3 68 67 - 77
http://www.united-domains.de
mailto:schumann_(at)_united-domains.de
php::bar PHP Wiki - Listenarchive