"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/savsrv.c" between
mailfromd-8.11.tar.xz and mailfromd-8.12.tar.xz

About: Mailfromd is a general-purpose mail filtering daemon for Sendmail, Postfix and MeTA1 (interfaces with the MTA using Milter or PMilter protocols).

savsrv.c  (mailfromd-8.11.tar.xz):savsrv.c  (mailfromd-8.12.tar.xz)
skipping to change at line 366 skipping to change at line 366
} }
int int
cmd_get(FILE *fp, int argc, char **argv) cmd_get(FILE *fp, int argc, char **argv)
{ {
int i; int i;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
char *attr = argv[i]; char *attr = argv[i];
char *val; char *val;
if (!strcasecmp(attr, "ehlo")) if (!mu_c_strcasecmp(attr, "ehlo"))
val = ehlo_domain; val = ehlo_domain;
else if (!strcasecmp(attr, "mailfrom")) else if (!mu_c_strcasecmp(attr, "mailfrom"))
val = mailfrom_address; val = mailfrom_address;
/* FIXME: Timeouts */ else if (!mu_c_strcasecmp(attr, "transcript"))
else val = smtp_transcript ? "ON" : "OFF";
else /* FIXME: Timeouts */
val = NULL; val = NULL;
if (val) if (val)
writeout(fp, "* %s=%s\r\n", attr, val); writeout(fp, "* %s=%s\r\n", attr, val);
} }
writeout(fp, "OK\r\n"); writeout(fp, "OK\r\n");
return 0; return 0;
} }
int int
cmd_set(FILE *fp, int argc, char **argv)
{
int i;
for (i = 1; i < argc; i++) {
char *val = strchr(argv[i], '=');
if (!val) {
writeout(fp, "NO bad assignment %s\n", argv[i]);
return 1;
}
if (!mu_c_strncasecmp(argv[i], "ehlo", 4) ||
!mu_c_strncasecmp(argv[i], "mailfrom", 8)) {
/* OK */;
} else if (!mu_c_strncasecmp(argv[i], "transcript", 10)) {
val++;
if (mu_c_strcasecmp(val, "ON") &&
mu_c_strcasecmp(val, "OFF")) {
writeout(fp, "NO bad assignment %s\n", argv[i]);
return 1;
}
} else {
writeout(fp, "NO bad assignment %s\n", argv[i]);
return 1;
}
}
for (i = 1; i < argc; i++) {
char *attr = argv[i];
char *val = strchr(attr, '=') + 1;
if (!mu_c_strncasecmp(attr, "ehlo", 4)) {
free(ehlo_domain);
ehlo_domain = mu_strdup(val);
} else if (!mu_c_strncasecmp(attr, "mailfrom", 8)) {
free(mailfrom_address);
mailfrom_address = mu_strdup(val);
} else if (!mu_c_strncasecmp(attr, "transcript", 10))
smtp_transcript = mu_c_strcasecmp(val, "ON") == 0;
}
writeout(fp, "OK\r\n");
return 0;
}
int
cmd_sid(FILE *fp, int argc, char **argv) cmd_sid(FILE *fp, int argc, char **argv)
{ {
if (session_id) if (session_id)
free(session_id); free(session_id);
session_id = mu_strdup(argv[1]); session_id = mu_strdup(argv[1]);
defproctitle(); defproctitle();
writeout(fp, "OK\r\n"); writeout(fp, "OK\r\n");
return 0; return 0;
} }
skipping to change at line 475 skipping to change at line 520
int int
cmd_quit(FILE *fp, int argc, char **argv) cmd_quit(FILE *fp, int argc, char **argv)
{ {
writeout(fp, "OK bye\r\n"); writeout(fp, "OK bye\r\n");
return 1; return 1;
} }
static struct callout_command callout_command_tab[] = { static struct callout_command callout_command_tab[] = {
{ "VRFY", 2, 0, cmd_vrfy }, { "VRFY", 2, 0, cmd_vrfy },
{ "GET", 2, 0, cmd_get }, { "GET", 2, 0, cmd_get },
/* FIXME: SET */ { "SET", 2, 0, cmd_set },
{ "SID", 2, 2, cmd_sid }, { "SID", 2, 2, cmd_sid },
{ "TIMEOUT", SMTP_NUM_TIMEOUT+1, SMTP_NUM_TIMEOUT+1, cmd_timeout }, { "TIMEOUT", SMTP_NUM_TIMEOUT+1, SMTP_NUM_TIMEOUT+1, cmd_timeout },
{ "RUN", 1, 1, cmd_run }, { "RUN", 1, 1, cmd_run },
{ "QUIT", 1, 1, cmd_quit }, { "QUIT", 1, 1, cmd_quit },
{ "DROP", 2, 2, cmd_drop }, { "DROP", 2, 2, cmd_drop },
{ NULL } { NULL }
}; };
static struct callout_command * static struct callout_command *
find_command(const char *input) find_command(const char *input)
 End of changes. 5 change blocks. 
5 lines changed or deleted 50 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)