[Evolution-hackers] mail address validation
- From: Roberto -MadBob- Guido <bob4mail gmail com>
- To: evolution-hackers <evolution-hackers gnome org>
- Subject: [Evolution-hackers] mail address validation
- Date: Thu, 21 Jan 2010 13:41:10 +0100
I was re-working the patch at
https://bugzilla.gnome.org/show_bug.cgi?id=213724 after reading the
comment from Milan Crha (that I just now saw, with a pair of months of
delay :-P ), but it is unclear to me now to validate a mail address
using camel_*address_* functions.
Here a little test I've done:
//////////////////////////////////////////////////////
#include <stdio.h>
#include <camel/camel.h>
static void test (const gchar *address) {
int ret;
CamelInternetAddress *addr;
addr = camel_internet_address_new ();
ret = camel_address_decode (CAMEL_ADDRESS (addr), address);
if (ret == -1)
printf ("%s: FAIL!\n", address);
else
printf ("%s: OK\n", address);
}
int main () {
g_type_init ();
g_thread_init (NULL);
test ("madbob");
test ("2345678");
test ("madbob example org");
exit (0);
}
//////////////////////////////////////////////////////
The test results always positive, with any string I submit, I'm sure I'm
missing something but don't know what.
Suggestions?
Thanks :-)
--
Roberto -MadBob- Guido
http://claimid.com/madbob
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]