* Added "instant expunge" and "allow spoofing" site config options.
authorArt Cancro <ajc@citadel.org>
Wed, 10 Aug 2005 21:47:42 +0000 (21:47 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 10 Aug 2005 21:47:42 +0000 (21:47 +0000)
citadel/ChangeLog
citadel/citadel.h
citadel/config.h
citadel/control.c
citadel/docs/citadel.html
citadel/imap_store.c
citadel/routines2.c
citadel/serv_smtp.c
citadel/serv_vandelay.c
citadel/techdoc/protocol.txt

index 239bd95de0b6725e1333ee96b513783e9c6e9ab8..026c2d7d62af2a2449d97047fdb9430265052a03 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 654.10  2005/08/10 21:47:41  ajc
+* Added "instant expunge" and "allow spoofing" site config options.
+
 Revision 654.9  2005/08/10 21:10:54  ajc
 * moved "instant expunge" to imap_do_store() so that it gets called from
   both STORE and UID STORE commands.
@@ -7025,3 +7028,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index ced109b9addd7f4a207e091b29068ec49f7b79cc..2a631747ff46df4c8accbb3cb5227a6ec073c97c 100644 (file)
@@ -47,7 +47,7 @@ extern "C" {
  */
 #define REV_LEVEL      655             /* This version */
 #define REV_MIN                591             /* Oldest compatible database */
-#define EXPORT_REV_MIN 652             /* Oldest compatible export files */
+#define EXPORT_REV_MIN 655             /* Oldest compatible export files */
 
 #define SERVER_TYPE 0  /* zero for stock Citadel; other developers please
                           obtain SERVER_TYPE codes for your implementations */
index 09e0b8be99a028fbc9844efdc1bef6fc996be02a..7c7cb254f5a10a111bd06cc8077337198f8c16ad 100644 (file)
@@ -67,6 +67,8 @@ struct config {
        int c_pop3s_port;               /* POP3S listener port (usually 995)*/
        int c_smtps_port;               /* SMTPS listener port (usually 465)*/
        char c_auto_cull;               /* Cull db logs automatically?      */
+       char c_instant_expunge;         /* IMAP instant expunge deleted msgs*/
+       char c_allow_spoofing;          /* SMTP allow spoofing of my domains*/
 };
 
 
index bad2a68d3ab893c4765d66f77af0072fe5df6fd6..bbf3bf6ef8310b8f23b0d27b031c9765bbe34b16 100644 (file)
@@ -228,6 +228,8 @@ void cmd_conf(char *argbuf)
                cprintf("%d\n", config.c_smtps_port);
                cprintf("%d\n", config.c_enable_fulltext);
                cprintf("%d\n", config.c_auto_cull);
+               cprintf("%d\n", config.c_instant_expunge);
+               cprintf("%d\n", config.c_allow_spoofing);
                cprintf("000\n");
        }
 
@@ -408,6 +410,12 @@ void cmd_conf(char *argbuf)
                        case 43:
                                config.c_auto_cull = atoi(buf);
                                break;
+                       case 44:
+                               config.c_instant_expunge = atoi(buf);
+                               break;
+                       case 45:
+                               config.c_allow_spoofing = atoi(buf);
+                               break;
                        }
                        ++a;
                }
index 616bf26eac756166f7c825c4f629a724276ca6f2..1c3fbedf709252b0829e7234b0b724c0682d86af 100644 (file)
@@ -1642,7 +1642,7 @@ database logs affect your ability to reliably backup your Citadel
 system.<br>
 </p>
 <p>The next set of options affect how Citadel behaves on a network.</p>
-<pre>Server IP address (0.0.0.0 for 'any') [0.0.0.0]:<br>POP3 server port (-1 to disable) [110]:<br>POP3S server port (-1 to disable) [995]:<br>IMAP server port (-1 to disable) [143]:<br>IMAPS server port (-1 to disable) [993]:<br>SMTP MTA server port (-1 to disable) [25]:<br>SMTP MSA server port (-1 to disable) [587]:<br>SMTPS server port (-1 to disable) [465]:<br>Correct forged From: lines during authenticated SMTP [Yes]:<br></pre>
+<pre>Server IP address (0.0.0.0 for 'any') [0.0.0.0]:<br>POP3 server port (-1 to disable) [110]:<br>POP3S server port (-1 to disable) [995]:<br>IMAP server port (-1 to disable) [143]:<br>IMAPS server port (-1 to disable) [993]:<br>SMTP MTA server port (-1 to disable) [25]:<br>SMTP MSA server port (-1 to disable) [587]:<br>SMTPS server port (-1 to disable) [465]:<br>Correct forged From: lines during authenticated SMTP [Yes]:<br>Allow unauthenticated SMTP clients to spoof my domains [No]: No<br>Instantly expunge deleted IMAP messages [No]: Yes<br></pre>
 <p>"Server IP address" refers to the IP address on <span
  style="font-style: italic;">your server</span> to which Citadel's
 protocol services should be bound.&nbsp; Normally you will leave this
@@ -1711,7 +1711,27 @@ sense dictates that this is a good idea. Nevertheless, if you want to
 suppress
 this behavior, answer 'No' at the prompt (the default is 'Yes') and the
 headers
-will never be altered.<br>
+will never be altered.</p>
+<p>&quot;Instant expunge&quot; affects what happens when IMAP users delete
+messages.  As you may already know, messages are not <i>truly</i> deleted
+when an IMAP client sends a delete command; they are only <i>marked for
+deletion</i>.  The IMAP client must also send an &quot;expunge&quot; command
+to actually delete the message.  The Citadel server automatically expunges
+messages when the client logs out or selects a different folder, but if you
+select the Instant Expunge option, an expunge operation will automatically
+follow any delete operation (and the client will be notified, preventing any
+mailbox state problems).  This is a good option to select, for example, if you
+have users who leave their IMAP client software open all the time and are
+wondering why their deleted messages show up again when they log in from a
+different location (such as WebCit).</p>
+<p>&quot;Allow spoofing&quot; refers to the security level applied to
+non-authenticated SMTP clients.  Normally, when another host connects to
+Citadel via SMTP to deliver mail, Citadel will reject any attempt to send
+mail whose sender (From) address matches one of your host's own domains.  This
+forces your legitimate users to authenticate properly, and prevents foreign
+hosts (such as spammers) from forging mail from your domains.  If, however,
+this behavior is creating a problem for you, you can select this option to
+bypass this particular security check.<br>
 <span style="font-family: monospace;"><br>
 Connect this Citadel to an LDAP directory [No]: No</span><br>
 </p>
index 0c40e430d6c915f7897295a2d726d23986ef1e5b..49784cc13dadd0092cb7f0180f917cf516b41d99 100644 (file)
@@ -163,14 +163,13 @@ void imap_do_store(int num_items, char **itemlist) {
                }
        }
 
-#ifdef INSTANT_EXPUNGE
        /*
-        * The following two commands implement "instant expunge"
-        * which is experimental.
+        * The following two commands implement "instant expunge" if enabled.
         */
-       imap_do_expunge();
-       imap_rescan_msgids();
-#endif /* INSTANT_EXPUNGE */
+       if (config.c_instant_expunge) {
+               imap_do_expunge();
+               imap_rescan_msgids();
+       }
 
 }
 
index 0248095359cb5037f04069b5b6a0354b9c0f84df..731586bef25638a291b7dd80219910cb6c168478 100644 (file)
@@ -644,7 +644,7 @@ void read_bio(CtdlIPC *ipc)
 void do_system_configuration(CtdlIPC *ipc)
 {
 
-#define NUM_CONFIGS 44
+#define NUM_CONFIGS 46
 
        char buf[SIZ];
        char sc[NUM_CONFIGS][256];
@@ -753,6 +753,12 @@ void do_system_configuration(CtdlIPC *ipc)
                a);
        a = (a ? 0 : 1);
        snprintf(sc[25], sizeof sc[25], "%d", a);
+       snprintf(sc[45], sizeof sc[45], "%d", (boolprompt(
+               "Allow unauthenticated SMTP clients to spoof my domains",
+               atoi(&sc[45][0]))));
+       snprintf(sc[44], sizeof sc[44], "%d", (boolprompt(
+               "Instantly expunge deleted IMAP messages",
+               atoi(&sc[44][0]))));
 
        /* LDAP settings */
        if (ipc->ServInfo.supports_ldap) {
index 91e8ed50ad9b1083aeba9bec33b493884dbd0caf..bb996538ad0374b00fea482a47ae31e6acac4829 100644 (file)
@@ -562,9 +562,9 @@ void smtp_mail(char *argbuf) {
        }
 
        /* Otherwise, make sure outsiders aren't trying to forge mail from
-        * this system.
+        * this system (unless, of course, c_allow_spoofing is enabled)
         */
-       else {
+       else if (config.c_allow_spoofing == 0) {
                process_rfc822_addr(SMTP->from, user, node, name);
                if (CtdlHostAlias(node) != hostalias_nomatch) {
                        cprintf("550 5.1.8 "
index 30c30a0ee4efad01a79d1a0af977044be15b5098..5f4de4aca0d0c01ae168569fa484cc38747f2919 100644 (file)
@@ -310,6 +310,8 @@ void artv_do_export(void) {
        cprintf("%s\n", config.c_baseroom);
        cprintf("%s\n", config.c_aideroom);
        cprintf("%d\n", config.c_auto_cull);
+       cprintf("%d\n", config.c_instant_expunge);
+       cprintf("%d\n", config.c_allow_spoofing);
 
        /* Export the control file */
        get_control();
@@ -385,6 +387,8 @@ void artv_import_config(void) {
        client_getln(config.c_baseroom, sizeof config.c_baseroom);
        client_getln(config.c_aideroom, sizeof config.c_aideroom);
        client_getln(buf, sizeof buf);  config.c_auto_cull = atoi(buf);
+       client_getln(buf, sizeof buf);  config.c_instant_expunge = atoi(buf);
+       client_getln(buf, sizeof buf);  config.c_allow_spoofing = atoi(buf);
        config.c_enable_fulltext = 0;   /* always disable */
        put_config();
        lprintf(CTDL_INFO, "Imported config file\n");
index 01c417ee62314054a149c7333bddeff576fc4e07..525a7eeeaaab25de40eea148bff1a5f828a4f651 100644 (file)
@@ -1833,6 +1833,9 @@ fails for any reason, ERROR is returned.
  41. Port number for POP3S (SSL-encrypted POP3)
  42. Port number for SMTPS (SSL-encrypted SMTP)
  43. Flag (0 or 1) - enable full text search index
+ 44. Flag (0 or 1) - automatically cull database log files
+ 45. Flag (0 or 1) - enable IMAP "instant expunge" of deleted messages
+ 46. Flag (0 or 1) - allow unauthenticated SMTP clients to spoof my domains
 
  CONF also accepts two additional commands: GETSYS and PUTSYS followed by an
 arbitrary MIME type (such as application/x-citadel-internet-config) which