Lots of changes. They aren't visible though.
[egate.git] / kernel / eti.c
index 1aaaf71..de0634b 100644 (file)
  * Europagate, 1995
  *
  * $Log: eti.c,v $
- * Revision 1.15  1995/07/03 12:59:28  adam
+ * Revision 1.18  1996/03/01 14:25:28  adam
+ * Email gateway obeys 'Reply-To:' in header.
+ *
+ * Revision 1.17  1995/12/20  16:27:24  adam
+ * Extra parameter block to gw_db_open.
+ *
+ * Revision 1.16  1995/07/11  11:49:11  adam
+ * LINE_MAX renamed to STR_LINE_MAX.
+ *
+ * Revision 1.15  1995/07/03  12:59:28  adam
  * New option for eti: -c dir to chdir before start.
  * Setting change: gw.max.show defaults to 100.
  *
 #include <gip.h>
 #include <strqueue.h>
 
-#define LINE_MAX 1024
+#define STR_LINE_MAX 1024
 
 static char *module = "eti";
 static jmp_buf retry_jmp;
@@ -139,6 +148,8 @@ static int email_header (struct str_queue *sq,
             return 0;
         if (memcmp (msg, "From ", 5) == 0)
             sscanf (msg+4, "%s", from_str);
+        if (memcmp (msg, "Reply-To: ", 10) == 0)
+            sscanf (msg+10, "%s", from_str);
         if (memcmp (msg, "Subject: ", 9) == 0 &&
             sscanf (msg+9, "%s", subject_str+1) == 1)
             strcpy (subject_str, msg+9);
@@ -193,9 +204,9 @@ static void deliver (struct str_queue *sq, GIP gip, const char *msg)
 
 int main (int argc, char **argv)
 {
-    char from_str[LINE_MAX+1];
-    char subject_str[LINE_MAX+1];
-    char line_str[LINE_MAX+1];
+    char from_str[STR_LINE_MAX+1];
+    char subject_str[STR_LINE_MAX+1];
+    char line_str[STR_LINE_MAX+1];
     char msg[20];
     GW_DB user_db;
     GIP  gip;
@@ -279,7 +290,7 @@ int main (int argc, char **argv)
         gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, module, "str_queue_mk");
         exit (1);
     }
-    while (fgets (line_str, LINE_MAX, stdin))
+    while (fgets (line_str, STR_LINE_MAX, stdin))
         str_queue_enq (queue, line_str);
 
     r = email_header (queue, from_str, subject_str);
@@ -289,7 +300,7 @@ int main (int argc, char **argv)
         exit (1);
     }
     gw_log (GW_LOG_STAT, module, "Mail from %s", from_str);
-    user_db = gw_db_open ("user.db", 1);
+    user_db = gw_db_open ("user.db", 1, 1);
 
     r = gw_db_lookup (user_db, from_str, strlen(from_str),
                       &user_info, &info_length);