$Log$
+ Revision 605.40 2003/04/28 16:56:51 ajc
+ * Added a site-configurable setting to suppress the automatic correction of
+ forged From: lines from authenticated SMTP users, for those who prefer
+ strict RFC compliance instead of common sense.
+
Revision 605.39 2003/04/26 21:55:15 ajc
* Anytime a socket connect() fails, CLOSE THE SOCKET before erroring out.
Not doing so causes a file descriptor leak.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
int c_max_workers; /* Upper limit on number of threads */
int c_pop3_port; /* POP3 listener port (usually 110) */
int c_smtp_port; /* SMTP listener port (usually 25) */
- int c_unused_1; /* Nothin' here anymore... */
+ int c_rfc822_strict_from; /* 1 = don't correct From: forgeries*/
int c_aide_zap; /* Are Aides allowed to zap rooms? */
int c_imap_port; /* IMAP listener port (usually 143) */
time_t c_net_freq; /* how often to run the networker */
cprintf("%d\n", config.c_max_workers);
cprintf("%d\n", config.c_pop3_port);
cprintf("%d\n", config.c_smtp_port);
- cprintf("0\n"); /* position 25 no longer exists */
+ cprintf("%d\n", config.c_rfc822_strict_from);
cprintf("%d\n", config.c_aide_zap);
cprintf("%d\n", config.c_imap_port);
cprintf("%ld\n", config.c_net_freq);
case 24:
config.c_smtp_port = atoi(buf);
break;
- /* case 25 no longer exists */
+ case 25:
+ config.c_rfc822_strict_from = atoi(buf);
+ break;
case 26:
config.c_aide_zap = atoi(buf);
if (config.c_aide_zap != 0)
snprintf(sc[26], sizeof sc[26], "%d", (boolprompt(
"Allow Aides to Zap (forget) rooms",
atoi(&sc[26][0]))));
- snprintf(sc[30], sizeof sc[29], "%d", (boolprompt(
+ snprintf(sc[30], sizeof sc[30], "%d", (boolprompt(
"Allow system Aides access to user mailboxes",
atoi(&sc[30][0]))));
*/
strprompt("How often to run network jobs (in seconds)", &sc[28][0], 5);
- strprompt("SMTP server port (-1 to disable)", &sc[24][0], 5);
strprompt("POP3 server port (-1 to disable)", &sc[23][0], 5);
strprompt("IMAP server port (-1 to disable)", &sc[27][0], 5);
+ strprompt("SMTP server port (-1 to disable)", &sc[24][0], 5);
+
+ /* This logic flips the question around, because it's one of those
+ * situations where 0=yes and 1=no
+ */
+ a = atoi(sc[25]);
+ a = (a ? 0 : 1);
+ a = boolprompt("Correct forged From: lines during authenticated SMTP",
+ a);
+ a = (a ? 0 : 1);
+ snprintf(sc[25], sizeof sc[25], "%d", a);
/* Expiry settings */
strprompt("Default user purge time (days)", &sc[16][0], 5);
/* If the user is locally authenticated, FORCE the From: header to
* show up as the real sender. Yes, this violates the RFC standard,
- * but IT MAKES SENSE. Comment it out if you don't like this behavior.
+ * but IT MAKES SENSE. If you prefer strict RFC adherence over
+ * common sense, you can disable this in the configuration.
*
* We also set the "message room name" ('O' field) to MAILROOM
* (which is Mail> on most systems) to prevent it from getting set
* to something ugly like "0000058008.Sent Items>" when the message
* is read with a Citadel client.
*/
- if (CC->logged_in) {
+ if ( (CC->logged_in) && (config.c_rfc822_strict_from == 0) ) {
if (msg->cm_fields['A'] != NULL) phree(msg->cm_fields['A']);
if (msg->cm_fields['N'] != NULL) phree(msg->cm_fields['N']);
if (msg->cm_fields['H'] != NULL) phree(msg->cm_fields['H']);
}
+/*
+ * This field was originally used for something else, so when we upgrade
+ * we have to initialize it to 0 in case there was trash in that space.
+ */
+void initialize_c_rfc822_strict_from(void) {
+ get_config();
+ config.c_rfc822_strict_from = 0;
+ put_config();
+}
if (CitControl.version < 555) do_pre555_usersupp_upgrade();
if (CitControl.version < 591) bump_mailbox_generation_numbers();
+ if (CitControl.version < 606) initialize_c_rfc822_strict_from();
CitControl.version = REV_LEVEL;
put_control();
23. Maximum number of worker threads
24. Port number for POP3 service
25. Port number for SMTP service
- 26. (unused)
+ 26. Flag (0 or 1) - strict RFC822 adherence - don't correct From: forgeries
27. Flag (0 or 1) - allow Aides to zap (forget) rooms
28. Port number for IMAP service
29. How often (in seconds) to run the networker