/*
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2015 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
*/
#include "user_ops.h"
#include "database.h"
#include "msgbase.h"
+#include "room_ops.h"
#include "internet_addressing.h"
#include "serv_imap.h"
#include "imap_tools.h"
return;
}
- strcpy(new_message_flags, "");
+ *new_message_flags = '\0';
if (num_parms >= 5) {
for (i=3; i<num_parms; ++i) {
strcat(new_message_flags, Params[i].Key);
IUnbuffer ();
- client_read_blob(Imap->TransmittedMessage, literal_length, config.c_sleeping);
+ client_read_blob(Imap->TransmittedMessage, literal_length, CtdlGetConfigInt("c_sleeping"));
if ((ret < 0) || (StrLength(Imap->TransmittedMessage) < literal_length)) {
IReply("NO Read failed.");
if (Imap->selected) {
strcpy(savedroom, CCC->room.QRname);
}
- CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+ 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. 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.
+ * show up as the real sender. (Configurable setting)
*/
if (CCC->logged_in) {
- 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, config.c_nodename, strlen(config.c_nodename));
- CM_SetField(msg, eHumanNode, config.c_humannode, strlen(config.c_humannode));
- }
+ 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")));
+ }
}
/*
* our happy day without violent explosions.
*/
if (Imap->selected) {
- CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+ CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
}
/* We don't need this buffer anymore */
- CtdlFreeMessage(msg);
+ CM_Free(msg);
- if (new_message_flags != NULL) {
+ if (IsEmptyStr(new_message_flags)) {
imap_do_append_flags(new_msgnum, new_message_flags);
}
}