]> code.citadel.org Git - citadel.git/commitdiff
Removed whitespace to left and right of '@' in netmail recipients
authorArt Cancro <ajc@citadel.org>
Sun, 6 Dec 1998 04:27:18 +0000 (04:27 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 6 Dec 1998 04:27:18 +0000 (04:27 +0000)
citadel/ChangeLog
citadel/msgbase.c

index 7ecaa690731fc670d4147682ee56cb2084976dda..6d63dc925350872f58c717179696bcf740ef5e98 100644 (file)
@@ -1,5 +1,6 @@
 Sat Dec  5 01:24:03 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Added a new type of module hook for adding logging functions
+       * Removed whitespace to left and right of '@' in netmail recipients
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * setup.c: create citadel.config with mode 0600
index 4785df0a6f760484d96acf72dea3ba87cd0553a8..b08fa07a13c7e48fe7446aa9080edcfeef722367 100644 (file)
 extern struct config config;
 
 
+/*
+ * This function is self explanatory.
+ * (What can I say, I'm in a weird mood today...)
+ */
+void remove_any_whitespace_to_the_left_or_right_of_at_symbol(char *name) {
+       int i;
+
+       for (i=0; i<strlen(name); ++i) if (name[i]=='@') {
+               if (i>0) if (isspace(name[i-1])) {
+                       strcpy(&name[i-1], &name[i]);
+                       i = 0;
+                       }
+               while (isspace(name[i+1])) {
+                       strcpy(&name[i+1], &name[i+2]);
+                       }
+               }
+       }
+
+
 /*
  * Aliasing for network mail.
  * (Error messages have been commented out, because this is a server.)
@@ -43,6 +62,8 @@ int alias(char *name)         /* process alias and routing info for mail */
        char aaa[300],bbb[300];
 
        lprintf(9, "alias() called for <%s>\n", name);
+
+       remove_any_whitespace_to_the_left_or_right_of_at_symbol(name);
        
        fp=fopen("network/mail.aliases","r");
        if (fp==NULL) fp=fopen("/dev/null","r");