4 * Internet mail configurator for Citadel/UX
5 * see copyright.doc for copyright information
19 extern struct config config;
24 extern char ALIASES[128];
25 extern char CIT86NET[128];
26 extern char SENDMAIL[128];
27 extern char FALLBACK[128];
28 extern char GW_DOMAIN[128];
29 extern char TABLEFILE[128];
30 extern int RUN_NETPROC;
32 void StripLeadingAndTrailingWhitespace(char *str)
36 while (isspace(str[0]))
38 while (isspace(str[strlen(str) - 1]))
39 str[strlen(str) - 1] = 0;
42 void LoadInternetConfig(void)
44 char ParamName[SIZ], ParamValue[SIZ], buf[SIZ];
49 conf = fopen("network/internetmail.config", "r");
51 syslog(LOG_NOTICE, "Couldn't load internetmail.config");
54 while (fgets(buf, sizeof buf, conf) != NULL) {
56 buf[strlen(buf) - 1] = 0;
57 strcpy(ParamName, "");
58 strcpy(ParamValue, "");
61 for (a = strlen(buf); a >= 0; --a) {
66 strcpy(ParamName, buf);
68 strcpy(ParamValue, &buf[eqpos + 1]);
70 StripLeadingAndTrailingWhitespace(ParamName);
71 StripLeadingAndTrailingWhitespace(ParamValue);
73 if (!strcasecmp(ParamName, "aliases"))
74 strcpy(ALIASES, ParamValue);
75 if (!strcasecmp(ParamName, "cit86net spoolin"))
76 strcpy(CIT86NET, ParamValue);
77 if (!strcasecmp(ParamName, "sendmail"))
78 strcpy(SENDMAIL, ParamValue);
79 if (!strcasecmp(ParamName, "fallback"))
80 strcpy(FALLBACK, ParamValue);
81 if (!strcasecmp(ParamName, "gateway domain"))
82 strcpy(GW_DOMAIN, ParamValue);
83 if (!strcasecmp(ParamName, "table file"))
84 strcpy(TABLEFILE, ParamValue);
85 if (!strcasecmp(ParamName, "deliver local"))
86 strcpy(metoo[mecount++], ParamValue);
87 if (!strcasecmp(ParamName, "run netproc"))
88 RUN_NETPROC = atoi(ParamValue);
96 * returns nonzero if the specified host is listed as local
98 int IsHostLocal(char *WhichHost)
102 if (!strcasecmp(WhichHost, FQDN))
106 for (a = 0; a < mecount; ++a) {
107 if (!strcasecmp(WhichHost, metoo[a]))