* internet_addressing.c: added. (Internet address to Citadel mapping)
authorArt Cancro <ajc@citadel.org>
Fri, 10 Dec 1999 23:58:25 +0000 (23:58 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 10 Dec 1999 23:58:25 +0000 (23:58 +0000)
citadel/ChangeLog
citadel/Makefile.in
citadel/internet_addressing.c [new file with mode: 0644]
citadel/internet_addressing.h [new file with mode: 0644]
citadel/serv_smtp.c

index f4fce1e14741ea44b048cb73f93fde47001ad316..0e1528ecc705c18a8a486599909c82a6051628d2 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
+
index e00c9d2aa03daedfdb8757034c1c450e891d08c6..686a3fe9240b705d2eaee0067f55db304b0ca11a 100644 (file)
@@ -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 (file)
index 0000000..2965f12
--- /dev/null
@@ -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 <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <pwd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <string.h>
+#include <limits.h>
+#include "citadel.h"
+#include "server.h"
+#include <time.h>
+#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; a<strlen(us->fullname); ++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 (file)
index 0000000..7a58416
--- /dev/null
@@ -0,0 +1 @@
+int fuzzy_match(struct usersupp *us, char *matchstring);
index 687ccd0e482f862f6c4a6f5768e2b3f0777e2dc6..2829c3341a25f2e4e524d47bb2031c7c9d526f59 100644 (file)
@@ -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; a<strlen(us->fullname); ++a) {
-               if (!strncasecmp(&us->fullname[a],
-                  matchstring, strlen(matchstring))) {
-                       return 0;
-               }
-       }
-       return -1;
-}
-
-
 /*
  * Back end for smtp_vrfy() command
  */