From 9eeabb6a32d7bc2d25648f55e78b00cae8f71d8e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 10 Dec 1999 23:58:25 +0000 Subject: [PATCH] * internet_addressing.c: added. (Internet address to Citadel mapping) --- citadel/ChangeLog | 4 +++ citadel/Makefile.in | 5 ++-- citadel/internet_addressing.c | 50 +++++++++++++++++++++++++++++++++++ citadel/internet_addressing.h | 1 + citadel/serv_smtp.c | 21 +-------------- 5 files changed, 59 insertions(+), 22 deletions(-) create mode 100644 citadel/internet_addressing.c create mode 100644 citadel/internet_addressing.h diff --git a/citadel/ChangeLog b/citadel/ChangeLog index f4fce1e14..0e1528ecc 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 1.428 1999/12/10 23:58:25 ajc +* internet_addressing.c: added. (Internet address to Citadel mapping) + Revision 1.427 1999/12/10 21:34:19 ajc * serv_smtp: implemented RFC821 "VRFY" and "EXPN" commands @@ -1489,3 +1492,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/Makefile.in b/citadel/Makefile.in index e00c9d2aa..686a3fe92 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -71,7 +71,7 @@ SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \ support.c sysdep.c tools.c user_ops.c userlist.c serv_expire.c \ whobbs.c sendcommand.c mime_parser.c base64.c qpdecode.c getutline.c \ auth.c chkpwd.c client_icq.c html.c vcard.c serv_upgrade.c \ - serv_smtp.c + serv_smtp.c internet_addressing.c DEP_FILES=$(SOURCES:.c=.d) @@ -107,7 +107,8 @@ netpoll: netpoll.o config.o ipc_c_tcp.o tools.o $(LIBOBJS) SERV_OBJS = citserver.ro user_ops.ro support.ro room_ops.ro file_ops.ro \ msgbase.ro config.ro sysdep.ro locate_host.ro housekeeping.ro \ database.ro control.ro logging.ro policy.ro dynloader.ro tools.ro \ - mime_parser.ro html.ro $(AUTH) $(LIBOBJS:.o=.ro) + mime_parser.ro html.ro internet_addressing.ro \ + $(AUTH) $(LIBOBJS:.o=.ro) citserver: $(SERV_OBJS) $(CC) $(SERV_OBJS) $(LDFLAGS) $(SERVER_LDFLAGS) $(LIBS) $(NETLIBS) $(GDBM) -o citserver diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c new file mode 100644 index 000000000..2965f1297 --- /dev/null +++ b/citadel/internet_addressing.c @@ -0,0 +1,50 @@ +/* + * $Id$ + * + * This file contains functions which handle the mapping of Internet addresses + * to users on the Citadel system. + */ + +#include "sysdep.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "citadel.h" +#include "server.h" +#include +#include "sysdep_decls.h" +#include "citserver.h" +#include "support.h" +#include "config.h" +#include "tools.h" +#include "internet_addressing.h" + +/* + * Return 0 if a given string fuzzy-matches a Citadel user account + * + * FIX ... this needs to be updated to match any and all ways of addressing + * a user. It may even be appropriate to move this out of SMTP and + * into the server core. + */ +int fuzzy_match(struct usersupp *us, char *matchstring) { + int a; + + for (a=0; afullname); ++a) { + if (!strncasecmp(&us->fullname[a], + matchstring, strlen(matchstring))) { + return 0; + } + } + return -1; +} + + diff --git a/citadel/internet_addressing.h b/citadel/internet_addressing.h new file mode 100644 index 000000000..7a5841670 --- /dev/null +++ b/citadel/internet_addressing.h @@ -0,0 +1 @@ +int fuzzy_match(struct usersupp *us, char *matchstring); diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index 687ccd0e4..2829c3341 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -29,6 +29,7 @@ #include "database.h" #include "msgbase.h" #include "tools.h" +#include "internet_addressing.h" struct citsmtp { int command_state; @@ -157,26 +158,6 @@ void smtp_auth(char *argbuf) { } -/* - * Return 0 if a given string fuzzy-matches a Citadel user account - * - * FIX ... this needs to be updated to match any and all ways of addressing - * a user. It may even be appropriate to move this out of SMTP and - * into the server core. - */ -int fuzzy_match(struct usersupp *us, char *matchstring) { - int a; - - for (a=0; afullname); ++a) { - if (!strncasecmp(&us->fullname[a], - matchstring, strlen(matchstring))) { - return 0; - } - } - return -1; -} - - /* * Back end for smtp_vrfy() command */ -- 2.30.2