From 2ce542ad523910effbf5418e3c21550b4038924d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 5 Aug 2005 14:46:59 +0000 Subject: 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. --- g10/misc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'g10/misc.c') 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 -- cgit