4 * Internet mail configurator for Citadel/UX
5 * see copyright.doc for copyright information
14 #if TIME_WITH_SYS_TIME
15 # include <sys/time.h>
19 # include <sys/time.h>
30 extern struct config config;
35 extern char ALIASES[128];
36 extern char CIT86NET[128];
37 extern char SENDMAIL[128];
38 extern char FALLBACK[128];
39 extern char GW_DOMAIN[128];
40 extern char TABLEFILE[128];
41 extern int RUN_NETPROC;
43 void StripLeadingAndTrailingWhitespace(char *str)
47 while (isspace(str[0]))
49 while (isspace(str[strlen(str) - 1]))
50 str[strlen(str) - 1] = 0;
53 void LoadInternetConfig(void)
55 char ParamName[SIZ], ParamValue[SIZ], buf[SIZ];
60 conf = fopen("network/internetmail.config", "r");
62 syslog(LOG_NOTICE, "Couldn't load internetmail.config");
65 while (fgets(buf, sizeof buf, conf) != NULL) {
67 buf[strlen(buf) - 1] = 0;
68 strcpy(ParamName, "");
69 strcpy(ParamValue, "");
72 for (a = strlen(buf); a >= 0; --a) {
77 strcpy(ParamName, buf);
79 strcpy(ParamValue, &buf[eqpos + 1]);
81 StripLeadingAndTrailingWhitespace(ParamName);
82 StripLeadingAndTrailingWhitespace(ParamValue);
84 if (!strcasecmp(ParamName, "aliases"))
85 strcpy(ALIASES, ParamValue);
86 if (!strcasecmp(ParamName, "cit86net spoolin"))
87 strcpy(CIT86NET, ParamValue);
88 if (!strcasecmp(ParamName, "sendmail"))
89 strcpy(SENDMAIL, ParamValue);
90 if (!strcasecmp(ParamName, "fallback"))
91 strcpy(FALLBACK, ParamValue);
92 if (!strcasecmp(ParamName, "gateway domain"))
93 strcpy(GW_DOMAIN, ParamValue);
94 if (!strcasecmp(ParamName, "table file"))
95 strcpy(TABLEFILE, ParamValue);
96 if (!strcasecmp(ParamName, "deliver local"))
97 strcpy(metoo[mecount++], ParamValue);
98 if (!strcasecmp(ParamName, "run netproc"))
99 RUN_NETPROC = atoi(ParamValue);
107 * returns nonzero if the specified host is listed as local
109 int IsHostLocal(char *WhichHost)
113 if (!strcasecmp(WhichHost, FQDN))
117 for (a = 0; a < mecount; ++a) {
118 if (!strcasecmp(WhichHost, metoo[a]))