citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

msgbase.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ma_info
 
struct  repl
 
struct  addresses_to_be_filed
 

Macros

#define HEADERS_ALL   0 /* Headers and body */
 
#define HEADERS_ONLY   1 /* Headers only */
 
#define HEADERS_NONE   2 /* Body only */
 
#define HEADERS_FAST   3 /* Headers only with no MIME info */
 
#define CM_KEY(Message, Which)   Message->cm_fields[Which], Message->cm_lengths[Which]
 
#define CM_RANGE(Message, Which)
 
#define QP_EADDR   (1<<0) /* quoted-printable encode email addresses */
 
#define CRLF   (1<<1)
 
#define ESC_DOT   (1<<2) /* output a line containing only "." as ".." instead */
 
#define SUPPRESS_ENV_TO   (1<<3) /* suppress Envelope-to: header (warning: destructive!) */
 

Typedefs

typedef void(* ForEachMsgCallback) (long MsgNumber, void *UserData)
 

Enumerations

enum  {
  MSGS_ALL , MSGS_OLD , MSGS_NEW , MSGS_FIRST ,
  MSGS_LAST , MSGS_GT , MSGS_EQ , MSGS_SEARCH ,
  MSGS_LT
}
 
enum  {
  MSG_HDRS_BRIEF = 0 , MSG_HDRS_ALL = 1 , MSG_HDRS_EUID = 4 , MSG_HDRS_BRIEFFILTER = 8 ,
  MSG_HDRS_THREADS = 9
}
 
enum  {
  om_ok , om_not_logged_in , om_no_such_msg , om_mime_error ,
  om_access_denied
}
 
enum  { ctdlsetseen_seen , ctdlsetseen_answered }
 

Functions

int GetFieldFromMnemonic (eMsgField *f, const char *c)
 
void memfmout (char *mptr, const char *nl)
 
void output_mime_parts (char *)
 
long send_message (struct CtdlMessage *)
 
void loadtroom (void)
 
long CtdlSubmitMsg (struct CtdlMessage *, struct recptypes *, const char *)
 
long quickie_message (const char *from, const char *fromaddr, const char *to, char *room, const char *text, int format_type, const char *subject)
 
void GetMetaData (struct MetaData *, long)
 
void PutMetaData (struct MetaData *)
 
void AdjRefCount (long, int)
 
void TDAP_AdjRefCount (long, int)
 
int TDAP_ProcessAdjRefCountQueue (void)
 
void simple_listing (long, void *)
 
int CtdlMsgCmp (struct CtdlMessage *msg, struct CtdlMessage *template)
 
int CtdlForEachMessage (int mode, long ref, char *searchstring, char *content_type, struct CtdlMessage *compare, ForEachMsgCallback CallBack, void *userdata)
 
int CtdlDeleteMessages (const char *, long *, int, char *)
 
long CtdlWriteObject (char *req_room, char *content_type, char *raw_message, off_t raw_length, struct ctdluser *is_mailbox, int is_binary, unsigned int flags)
 
struct CtdlMessageCtdlFetchMessage (long msgnum, int with_body)
 
struct CtdlMessageCM_Duplicate (struct CtdlMessage *OrgMsg)
 
int CM_IsEmpty (struct CtdlMessage *Msg, eMsgField which)
 
void CM_SetField (struct CtdlMessage *Msg, eMsgField which, const char *buf, long length)
 
void CM_SetFieldLONG (struct CtdlMessage *Msg, eMsgField which, long lvalue)
 
void CM_CopyField (struct CtdlMessage *Msg, eMsgField WhichToPutTo, eMsgField WhichtToCopy)
 
void CM_CutFieldAt (struct CtdlMessage *Msg, eMsgField WhichToCut, long maxlen)
 
void CM_FlushField (struct CtdlMessage *Msg, eMsgField which)
 
void CM_Flush (struct CtdlMessage *Msg)
 
void CM_SetAsField (struct CtdlMessage *Msg, eMsgField which, char **buf, long length)
 
void CM_SetAsFieldSB (struct CtdlMessage *Msg, eMsgField which, StrBuf **buf)
 
void CM_GetAsField (struct CtdlMessage *Msg, eMsgField which, char **ret, long *retlen)
 
void CM_PrependToField (struct CtdlMessage *Msg, eMsgField which, const char *buf, long length)
 
void CM_Free (struct CtdlMessage *msg)
 
void CM_FreeContents (struct CtdlMessage *msg)
 
int CM_IsValidMsg (struct CtdlMessage *msg)
 
void CtdlSerializeMessage (struct ser_ret *, struct CtdlMessage *)
 
struct CtdlMessageCtdlDeserializeMessage (long msgnum, int with_body, const char *Buffer, long Length)
 
void ReplicationChecks (struct CtdlMessage *)
 
int CtdlSaveMsgPointersInRoom (char *roomname, long newmsgidlist[], int num_newmsgs, int do_repl_check, struct CtdlMessage *supplied_msg, int suppress_refcount_adj)
 
int CtdlSaveMsgPointerInRoom (char *roomname, long msgid, int do_repl_check, struct CtdlMessage *msg)
 
long CtdlSaveThisMessage (struct CtdlMessage *msg, long msgid, int Reply)
 
char * CtdlReadMessageBody (char *terminator, long tlen, size_t maxlen, StrBuf *exist, int crlf)
 
StrBuf * CtdlReadMessageBodyBuf (char *terminator, long tlen, size_t maxlen, StrBuf *exist, int crlf)
 
int CtdlOutputMsg (long msg_num, int mode, int headers_only, int do_proto, int crlf, char *section, int flags, char **Author, char **Address, char **MessageID)
 
int CtdlOutputPreLoadedMsg (struct CtdlMessage *, int mode, int headers_only, int do_proto, int crlf, int flags)
 
void CtdlSetSeen (long *target_msgnums, int num_target_msgnums, int target_setting, int which_set, struct ctdluser *which_user, struct ctdlroom *which_room)
 
void CtdlGetSeen (char *buf, int which_set)
 
struct CtdlMessageCtdlMakeMessage (struct ctdluser *author, char *recipient, char *recp_cc, char *room, int type, int format_type, char *fake_name, char *my_email, char *subject, char *supplied_euid, char *preformatted_text, char *references)
 
struct CtdlMessageCtdlMakeMessageLen (struct ctdluser *author, char *recipient, long rcplen, char *recp_cc, long cclen, char *room, long roomlen, int type, int format_type, char *fake_name, long fnlen, char *my_email, long myelen, char *subject, long subjlen, char *supplied_euid, long euidlen, char *preformatted_text, long textlen, char *references, long reflen)
 
void AdjRefCountList (long *msgnum, long nmsg, int incr)
 

Variables

struct addresses_to_be_filedatbf
 

Macro Definition Documentation

◆ CM_KEY

#define CM_KEY (   Message,
  Which 
)    Message->cm_fields[Which], Message->cm_lengths[Which]

Definition at line 126 of file msgbase.h.

◆ CM_RANGE

#define CM_RANGE (   Message,
  Which 
)
Value:
Message->cm_fields[Which], \
Message->cm_fields[Which] + Message->cm_lengths[Which]

Definition at line 127 of file msgbase.h.

◆ CRLF

#define CRLF   (1<<1)

Definition at line 161 of file msgbase.h.

◆ ESC_DOT

#define ESC_DOT   (1<<2) /* output a line containing only "." as ".." instead */

Definition at line 162 of file msgbase.h.

◆ HEADERS_ALL

#define HEADERS_ALL   0 /* Headers and body */

Definition at line 39 of file msgbase.h.

◆ HEADERS_FAST

#define HEADERS_FAST   3 /* Headers only with no MIME info */

Definition at line 42 of file msgbase.h.

◆ HEADERS_NONE

#define HEADERS_NONE   2 /* Body only */

Definition at line 41 of file msgbase.h.

◆ HEADERS_ONLY

#define HEADERS_ONLY   1 /* Headers only */

Definition at line 40 of file msgbase.h.

◆ QP_EADDR

#define QP_EADDR   (1<<0) /* quoted-printable encode email addresses */

Definition at line 160 of file msgbase.h.

◆ SUPPRESS_ENV_TO

#define SUPPRESS_ENV_TO   (1<<3) /* suppress Envelope-to: header (warning: destructive!) */

Definition at line 163 of file msgbase.h.

Typedef Documentation

◆ ForEachMsgCallback

typedef void(* ForEachMsgCallback) (long MsgNumber, void *UserData)

Definition at line 90 of file msgbase.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MSGS_ALL 
MSGS_OLD 
MSGS_NEW 
MSGS_FIRST 
MSGS_LAST 
MSGS_GT 
MSGS_EQ 
MSGS_SEARCH 
MSGS_LT 

Definition at line 5 of file msgbase.h.

◆ anonymous enum

anonymous enum
Enumerator
MSG_HDRS_BRIEF 
MSG_HDRS_ALL 
MSG_HDRS_EUID 
MSG_HDRS_BRIEFFILTER 
MSG_HDRS_THREADS 

Definition at line 17 of file msgbase.h.

◆ anonymous enum

anonymous enum
Enumerator
om_ok 
om_not_logged_in 
om_no_such_msg 
om_mime_error 
om_access_denied 

Definition at line 28 of file msgbase.h.

◆ anonymous enum

anonymous enum
Enumerator
ctdlsetseen_seen 
ctdlsetseen_answered 

Definition at line 175 of file msgbase.h.

Function Documentation

◆ AdjRefCount()

◆ AdjRefCountList()

void AdjRefCountList ( long *  msgnum,
long  nmsg,
int  incr 
)

Definition at line 3423 of file msgbase.c.

References AdjRefCount().

Referenced by CtdlDeleteMessages(), and CtdlSaveMsgPointersInRoom().

◆ CM_CopyField()

void CM_CopyField ( struct CtdlMessage Msg,
eMsgField  WhichToPutTo,
eMsgField  WhichtToCopy 
)

◆ CM_CutFieldAt()

void CM_CutFieldAt ( struct CtdlMessage Msg,
eMsgField  WhichToCut,
long  maxlen 
)

◆ CM_Duplicate()

struct CtdlMessage * CM_Duplicate ( struct CtdlMessage OrgMsg)

Definition at line 334 of file msgbase.c.

References CM_DupField(), CtdlMessage::cm_fields, CM_Free(), CM_IsValidMsg(), and malloc().

◆ CM_Flush()

void CM_Flush ( struct CtdlMessage Msg)

Definition at line 184 of file msgbase.c.

References CM_FlushField(), and CM_IsValidMsg().

◆ CM_FlushField()

void CM_FlushField ( struct CtdlMessage Msg,
eMsgField  which 
)

◆ CM_Free()

◆ CM_FreeContents()

void CM_FreeContents ( struct CtdlMessage msg)

Definition at line 296 of file msgbase.c.

References CtdlMessage::cm_fields, CtdlMessage::cm_lengths, CtdlMessage::cm_magic, and free().

Referenced by CM_Free().

◆ CM_GetAsField()

void CM_GetAsField ( struct CtdlMessage Msg,
eMsgField  which,
char **  ret,
long *  retlen 
)

Definition at line 268 of file msgbase.c.

References CtdlMessage::cm_fields, and CtdlMessage::cm_lengths.

Referenced by CtdlOutputMsg(), and wiki_upload_beforesave().

◆ CM_IsEmpty()

◆ CM_IsValidMsg()

int CM_IsValidMsg ( struct CtdlMessage msg)

◆ CM_PrependToField()

void CM_PrependToField ( struct CtdlMessage Msg,
eMsgField  which,
const char *  buf,
long  length 
)

Definition at line 217 of file msgbase.c.

References CtdlMessage::cm_fields, CtdlMessage::cm_lengths, free(), and malloc().

Referenced by spam_assassin().

◆ CM_SetAsField()

void CM_SetAsField ( struct CtdlMessage Msg,
eMsgField  which,
char **  buf,
long  length 
)

◆ CM_SetAsFieldSB()

◆ CM_SetField()

◆ CM_SetFieldLONG()

void CM_SetFieldLONG ( struct CtdlMessage Msg,
eMsgField  which,
long  lvalue 
)

◆ CtdlDeleteMessages()

◆ CtdlDeserializeMessage()

struct CtdlMessage * CtdlDeserializeMessage ( long  msgnum,
int  with_body,
const char *  Buffer,
long  Length 
)

◆ CtdlFetchMessage()

◆ CtdlForEachMessage()

◆ CtdlGetSeen()

void CtdlGetSeen ( char *  buf,
int  which_set 
)

◆ CtdlMakeMessage()

struct CtdlMessage * CtdlMakeMessage ( struct ctdluser author,
char *  recipient,
char *  recp_cc,
char *  room,
int  type,
int  format_type,
char *  fake_name,
char *  my_email,
char *  subject,
char *  supplied_euid,
char *  preformatted_text,
char *  references 
)

◆ CtdlMakeMessageLen()

struct CtdlMessage * CtdlMakeMessageLen ( struct ctdluser author,
char *  recipient,
long  rcplen,
char *  recp_cc,
long  cclen,
char *  room,
long  roomlen,
int  type,
int  format_type,
char *  fake_name,
long  fnlen,
char *  my_email,
long  myelen,
char *  subject,
long  subjlen,
char *  supplied_euid,
long  euidlen,
char *  preformatted_text,
long  textlen,
char *  references,
long  reflen 
)

◆ CtdlMsgCmp()

int CtdlMsgCmp ( struct CtdlMessage msg,
struct CtdlMessage template 
)

Definition at line 365 of file msgbase.c.

References CtdlMessage::cm_fields, and CtdlMessage::cm_lengths.

Referenced by CtdlForEachMessage().

◆ CtdlOutputMsg()

◆ CtdlOutputPreLoadedMsg()

◆ CtdlReadMessageBody()

char * CtdlReadMessageBody ( char *  terminator,
long  tlen,
size_t  maxlen,
StrBuf *  exist,
int  crlf 
)

Definition at line 3032 of file msgbase.c.

References CtdlReadMessageBodyBuf().

Referenced by cmd_conf(), cmd_pibr(), and ical_putics().

◆ CtdlReadMessageBodyBuf()

StrBuf * CtdlReadMessageBodyBuf ( char *  terminator,
long  tlen,
size_t  maxlen,
StrBuf *  exist,
int  crlf 
)

Definition at line 2971 of file msgbase.c.

References CtdlClientGetLine(), and SIZ.

Referenced by CtdlMakeMessageLen(), CtdlReadMessageBody(), and smtp_data().

◆ CtdlSaveMsgPointerInRoom()

int CtdlSaveMsgPointerInRoom ( char *  roomname,
long  msgid,
int  do_repl_check,
struct CtdlMessage msg 
)

◆ CtdlSaveMsgPointersInRoom()

◆ CtdlSaveThisMessage()

long CtdlSaveThisMessage ( struct CtdlMessage msg,
long  msgid,
int  Reply 
)

◆ CtdlSerializeMessage()

◆ CtdlSetSeen()

void CtdlSetSeen ( long *  target_msgnums,
int  num_target_msgnums,
int  target_setting,
int  which_set,
struct ctdluser which_user,
struct ctdlroom which_room 
)

◆ CtdlSubmitMsg()

long CtdlSubmitMsg ( struct CtdlMessage msg,
struct recptypes recps,
const char *  force 
)

Definition at line 2598 of file msgbase.c.

References atbf, begin_critical_section(), recptypes::bounce_to, CC, CM_CopyField(), CtdlMessage::cm_fields, CM_FlushField(), CtdlMessage::cm_format_type, CM_IsEmpty(), CM_IsValidMsg(), CM_SetField(), CM_SetFieldLONG(), addresses_to_be_filed::collected_addresses, CtdlBumpNewMailCounter(), CtdlGetConfigInt(), CtdlGetConfigStr(), CtdlGetUser(), CtdlLockGetCurrentUser(), CtdlMailboxName(), CtdlOutputPreLoadedMsg(), CtdlPutCurrentUserLock(), CtdlSaveMsgPointerInRoom(), CtdlUserGoto(), DoesThisRoomNeedEuidIndexing(), eAuthor, eJournal, eMesageText, eMessagePath, end_critical_section(), eOriginalRoom, eTimestamp, eVltMsgNum, EVT_AFTERSAVE, EVT_AFTERUSRMBOXSAVE, EVT_BEFORESAVE, harvest_collected_addresses(), HEADERS_ALL, JournalBackgroundSubmit(), MAILROOM, malloc(), MetaData::meta_content_type, MetaData::meta_msgnum, MetaData::meta_refcount, MetaData::meta_rfc822_length, MT_RFC822, addresses_to_be_filed::next, recptypes::num_ignet, recptypes::num_internet, recptypes::num_local, recptypes::num_room, PerformMessageHooks(), PutMetaData(), QP_EADDR, recptypes::recp_local, recptypes::recp_room, ReplicationChecks(), addresses_to_be_filed::roomname, ROOMNAMELEN, S_ATBF, send_message(), SENTITEMS, SIZ, smi, SMTP_SPOOLOUT_ROOM, TWITDETECT, USERCONTACTSROOM, and ctdluser::usernum.

Referenced by cmd_ent0(), CtdlWriteObject(), flush_individual_conversation(), ical_send_a_reply(), ical_send_out_invitations(), ical_update_my_calendar_with_reply(), ical_write_to_cal(), imap_append(), inbox_do_redirect(), JournalRunQueueMsg(), listdeliver_do_msg(), pop3client_one_mailbox(), quickie_message(), rss_end_element(), smtp_aftersave(), smtp_data(), smtp_do_bounce(), smtp_process_one_msg(), store_this_ha(), wiki_rev(), and wiki_upload_beforesave().

◆ CtdlWriteObject()

long CtdlWriteObject ( char *  req_room,
char *  content_type,
char *  raw_message,
off_t  raw_length,
struct ctdluser is_mailbox,
int  is_binary,
unsigned int  flags 
)

◆ GetFieldFromMnemonic()

int GetFieldFromMnemonic ( eMsgField f,
const char *  c 
)

Definition at line 78 of file msgbase.c.

References msgKeyLookup.

Referenced by cmd_msgs().

◆ GetMetaData()

◆ loadtroom()

void loadtroom ( void  )

◆ memfmout()

void memfmout ( char *  mptr,
const char *  nl 
)

Definition at line 860 of file msgbase.c.

References client_write().

Referenced by cmd_gexp(), and CtdlOutputPreLoadedMsg().

◆ output_mime_parts()

void output_mime_parts ( char *  )

◆ PutMetaData()

void PutMetaData ( struct MetaData smibuf)

◆ quickie_message()

◆ ReplicationChecks()

◆ send_message()

long send_message ( struct CtdlMessage msg)

◆ simple_listing()

void simple_listing ( long  msgnum,
void *  userdata 
)

Definition at line 26 of file serv_messages.c.

References cprintf().

Referenced by cmd_msgs().

◆ TDAP_AdjRefCount()

void TDAP_AdjRefCount ( long  ,
int   
)

◆ TDAP_ProcessAdjRefCountQueue()

int TDAP_ProcessAdjRefCountQueue ( void  )

Variable Documentation

◆ atbf

struct addresses_to_be_filed* atbf
extern

Definition at line 33 of file msgbase.c.

Referenced by CtdlSubmitMsg(), and store_harvested_addresses().