Accidentally merged the configdb branch into master. Reverting.
[citadel.git] / citadel / modules / imap / imap_misc.c
index 3665264554ddc574840d88acef5e64017c857a31..f4d501c9d3853dd56c8895e804ac0c5d943755ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1987-2015 by the citadel.org team
+ * Copyright (c) 1987-2011 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 
@@ -337,7 +341,7 @@ void imap_append(int num_parms, ConstStr *Params) {
        
        IUnbuffer ();
 
-       client_read_blob(Imap->TransmittedMessage, literal_length, CtdlGetConfigInt("c_sleeping"));
+       client_read_blob(Imap->TransmittedMessage, literal_length, config.c_sleeping);
 
        if ((ret < 0) || (StrLength(Imap->TransmittedMessage) < literal_length)) {
                IReply("NO Read failed.");
@@ -373,15 +377,19 @@ void imap_append(int num_parms, ConstStr *Params) {
        CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /* If the user is locally authenticated, FORCE the From: header to
-        * show up as the real sender.  (Configurable setting)
+        * show up as the real sender.  FIXME do we really want to do this?
+        * Probably should make it site-definable or even room-definable.
+        *
+        * For now, we allow "forgeries" if the room is one of the user's
+        * private mailboxes.
         */
        if (CCC->logged_in) {
-               if ( ((CCC->room.QRflags & QR_MAILBOX) == 0) && (CtdlGetConfigInt("c_imap_keep_from") == 0))
-               {
-                       CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
-                       CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
-                       CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
-               }
+          if ( ((CCC->room.QRflags & QR_MAILBOX) == 0) && (config.c_imap_keep_from == 0)) {
+
+               CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
+               CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
+               CM_SetField(msg, eHumanNode, CFG_KEY(c_humannode));
+           }
        }
 
        /*