aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-08-05 14:46:59 +0000
committerWerner Koch <[email protected]>2005-08-05 14:46:59 +0000
commit2ce542ad523910effbf5418e3c21550b4038924d (patch)
tree0dab523a7b3d1525a995315f732a1522e2b9a622 /g10/misc.c
parent* gpg-zip.in: Add --decrypt functionality. Fix quoting so filenames (diff)
downloadgnupg-2ce542ad523910effbf5418e3c21550b4038924d.tar.gz
gnupg-2ce542ad523910effbf5418e3c21550b4038924d.zip
auto retrieve keys from PKA. Thsi allows to specify an email address
so that gpg can get the key from DNS. This helps with opportunistic encryption. No integration with the trust modell yet.
Diffstat (limited to '')
-rw-r--r--g10/misc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c
index 88b7b2bb1..14848eed2 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -1088,6 +1088,20 @@ has_invalid_email_chars (const char *s)
}
+/* Check whether NAME represents a valid mailbox according to
+ RFC822. Returns true if so. */
+int
+is_valid_mailbox (const char *name)
+{
+ return !( !name
+ || !*name
+ || has_invalid_email_chars (name)
+ || string_count_chr (name,'@') != 1
+ || *name == '@'
+ || name[strlen(name)-1] == '@'
+ || name[strlen(name)-1] == '.'
+ || strstr (name, "..") );
+}
/* This is a helper function to load a Windows function from either of