[Pgp-tools-commit] r98 - trunk/caff

Peter Palfrader weasel at costa.debian.org
Thu Jun 30 15:15:04 UTC 2005


Author: weasel
Date: 2005-06-30 15:15:03 +0000 (Thu, 30 Jun 2005)
New Revision: 98

Modified:
   trunk/caff/caff
Log:
Prepare uat handling

Modified: trunk/caff/caff
===================================================================
--- trunk/caff/caff	2005-06-30 15:13:34 UTC (rev 97)
+++ trunk/caff/caff	2005-06-30 15:15:03 UTC (rev 98)
@@ -869,7 +869,7 @@
 			} else {
 				debug("keep it.");
 				$have_one = 1;
-				$this_uid_text = ($type eq 'uid') ? $uidtext : 'attribute';
+				$this_uid_text = ($type eq 'uid') ? $uidtext : '[attribute]';
 				$is_uat = $type eq 'uat';
 			};
 			$i++;
@@ -930,7 +930,7 @@
 			print KEY $asciikey;
 			close KEY;
 
-			push @UIDS, { text => $this_uid_text, key => $asciikey, serial => $uid_number };
+			push @UIDS, { text => $this_uid_text, key => $asciikey, serial => $uid_number, "is_uat" => $is_uat };
 
 			info("$longkeyid $uid_number $this_uid_text done.");
 		} else {
@@ -946,7 +946,10 @@
 		my @attached;
 		for my $uid (@UIDS) {
 			trace("UID: $uid->{'text'}\n");
-			unless ($uid->{'text'} =~ /@/) {
+			if ($uid->{'is_uat'}) {
+				my $attach = ask("UID $uid->{'text'} is an attribute UID, attach it to every email sent?", 1);
+				push @attached, $uid if $attach;
+			} elsif ($uid->{'text'} !~ /@/) {
 				my $attach = ask("UID $uid->{'text'} is no email address, attach it to every email sent?", 1);
 				push @attached, $uid if $attach;
 			};
@@ -954,7 +957,7 @@
 
 		notice("Key has no encryption capabilities, mail will be sent unencrypted") unless $can_encrypt;
 		for my $uid (@UIDS) {
-			if ($uid->{'text'} =~ /@/) {
+			if (!$uid->{'is_uat'} && ($uid->{'text'} =~ /@/)) {
 				my $address = $uid->{'text'};
 				$address =~ s/.*<(.*)>.*/$1/;
 				if ($CONFIG{'mail'} or ask("Send mail to '$address' for $uid->{'text'}?", 1)) {





More information about the Pgp-tools-commit mailing list