TinyMUSH 3.3
TinyMUSH Server
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
mail.c File Reference

Module for penn-based mailer system. More...

#include "config.h"
#include "constants.h"
#include "typedefs.h"
#include "macros.h"
#include "externs.h"
#include "prototypes.h"
#include "mail.h"
#include <ctype.h>
#include <string.h>
Include dependency graph for mail.c:

Classes

struct  mod_mail_confstorage
 
struct  malias
 

Macros

#define MAIL_STATS   1 /* Mail stats */
 
#define MAIL_DSTATS   2 /* More mail stats */
 
#define MAIL_FSTATS   3 /* Even more mail stats */
 
#define MAIL_DEBUG   4 /* Various debugging options */
 
#define MAIL_NUKE   5 /* Nuke the post office */
 
#define MAIL_FOLDER   6 /* Do folder stuff */
 
#define MAIL_LIST   7 /* List @mail by time */
 
#define MAIL_READ   8 /* Read @mail message */
 
#define MAIL_CLEAR   9 /* Clear @mail message */
 
#define MAIL_UNCLEAR   10 /* Unclear @mail message */
 
#define MAIL_PURGE   11 /* Purge cleared @mail messages */
 
#define MAIL_FILE   12 /* File @mail in folders */
 
#define MAIL_TAG   13 /* Tag @mail messages */
 
#define MAIL_UNTAG   14 /* Untag @mail messages */
 
#define MAIL_FORWARD   15 /* Forward @mail messages */
 
#define MAIL_SEND   16 /* Send @mail messages in progress */
 
#define MAIL_EDIT   17 /* Edit @mail messages in progress */
 
#define MAIL_URGENT   18 /* Sends a @mail message as URGENT */
 
#define MAIL_ALIAS   19 /* Creates an @mail alias */
 
#define MAIL_ALIST   20 /* Lists @mail aliases */
 
#define MAIL_PROOF   21 /* Proofs @mail messages in progress */
 
#define MAIL_ABORT   22 /* Aborts @mail messages in progress */
 
#define MAIL_QUICK   23 /* Sends a quick @mail message */
 
#define MAIL_REVIEW   24 /* Reviews @mail sent to a player */
 
#define MAIL_RETRACT   25 /* Retracts @mail sent to a player */
 
#define MAIL_CC   26 /* Carbon copy */
 
#define MAIL_SAFE   27 /* Defines a piece of mail as safe. */
 
#define MAIL_REPLY   28 /* Replies to a message. */
 
#define MAIL_REPLYALL   29 /* Replies to all recipients of msg */
 
#define MAIL_TO   30 /* Set recipient list */
 
#define MAIL_BCC   31 /* Blind Carbon copy */
 
#define MAIL_QUOTE   0x100 /* Quote back original in the reply? */
 
#define MALIAS_DESC   1 /* Describes a mail alias */
 
#define MALIAS_CHOWN   2 /* Changes a mail alias's owner */
 
#define MALIAS_ADD   3 /* Adds a player to an alias */
 
#define MALIAS_REMOVE   4 /* Removes a player from an alias */
 
#define MALIAS_DELETE   5 /* Deletes a mail alias */
 
#define MALIAS_RENAME   6 /* Renames a mail alias */
 
#define MALIAS_LIST   8 /* Lists mail aliases */
 
#define MALIAS_STATUS   9 /* Status of mail aliases */
 
#define MALIAS_LEN   100
 

Functions

void add_folder_name (dbref, int, char *)
 
void check_mail (dbref, int, int)
 
struct mailmail_fetch (dbref, int)
 
char * get_mail_message (int number)
 
void do_mail_change_folder (dbref player, char *fld, char *newname)
 
void do_mail_tag (dbref player, char *msglist)
 
void do_mail_safe (dbref player, char *msglist)
 
void do_mail_clear (dbref player, char *msglist)
 
void do_mail_untag (dbref player, char *msglist)
 
void do_mail_unclear (dbref player, char *msglist)
 
void do_mail_file (dbref player, char *msglist, char *folder)
 
void do_mail_read (dbref player, char *msglist)
 
void do_mail_retract (dbref player, char *name, char *msglist)
 
void do_mail_review (dbref player, char *name, char *msglist)
 
void do_mail_list (dbref player, char *msglist, int sub)
 
void do_mail_purge (dbref player)
 
void do_mail_fwd (dbref player, char *msg, char *tolist)
 
void do_mail_reply (dbref player, char *msg, int all, int key)
 
void count_mail (dbref player, int folder, int *rcount, int *ucount, int *ccount)
 
void urgent_mail (dbref player, int folder, int *ucount)
 
void do_mail_nuke (dbref player)
 
void do_mail_debug (dbref player, char *action, char *victim)
 
void do_mail_stats (dbref player, char *name, int full)
 
void do_mail_stub (dbref player, char *arg1, char *arg2)
 
void do_mail (dbref player, dbref cause __attribute__((unused)), int key, char *arg1, char *arg2)
 
void mod_mail_dump_database (FILE *fp)
 
void mod_mail_load_database (FILE *fp)
 
void set_player_folder (dbref player, int fnum)
 
void check_mail_expiration (void)
 
void do_malias_switch (dbref player, char *a1, char *a2)
 
void do_malias (dbref player, dbref cause __attribute__((unused)), int key, char *arg1, char *arg2)
 
struct maliasget_malias (dbref player, char *alias)
 
void do_malias_create (dbref player, char *alias, char *tolist)
 
void do_malias_list (dbref player, char *alias)
 
void do_malias_list_all (dbref player)
 
void load_malias (FILE *fp)
 
void save_malias (FILE *fp)
 
void malias_read (FILE *fp)
 
void malias_write (FILE *fp)
 
void do_mail_quick (dbref player, char *arg1, char *arg2)
 
void do_prepend (dbref player, dbref cause __attribute__((unused)), int key __attribute__((unused)), char *text)
 
void do_postpend (dbref player, dbref cause __attribute__((unused)), int key __attribute__((unused)), char *text)
 
void do_malias_desc (dbref player, char *alias, char *desc)
 
void do_malias_chown (dbref player, char *alias, char *owner)
 
void do_malias_add (dbref player, char *alias, char *person)
 
void do_malias_remove (dbref player, char *alias, char *person)
 
void do_malias_rename (dbref player, char *alias, char *newname)
 
void do_malias_delete (dbref player, char *alias)
 
void do_malias_adminlist (dbref player)
 
void do_malias_status (dbref player)
 
void fun_mail (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs, char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused)))
 
void fun_mailfrom (char *buff, char **bufc, dbref player, dbref caller __attribute__((unused)), dbref cause __attribute__((unused)), char *fargs[], int nfargs, char *cargs[] __attribute__((unused)), int ncargs __attribute__((unused)))
 
void mod_mail_announce_connect (dbref player, char *reason __attribute__((unused)), int num __attribute__((unused)))
 
void mod_mail_announce_disconnect (dbref player, char *reason __attribute__((unused)), int num __attribute__((unused)))
 
void mod_mail_destroy_player (dbref player __attribute__((unused)), dbref victim)
 
void mod_mail_cleanup_startup (void)
 
void mod_mail_init (void)
 

Variables

MODVER mod_mail_version
 
HASHTAB mod_mail_msg_htab
 
MODHASHES mod_mail_nhashtable []
 
struct mod_mail_confstorage mod_mail_config
 
CONF mod_mail_conftable []
 
int ma_size = 0
 
int ma_top = 0
 
struct malias ** malias
 
FUN mod_mail_functable []
 
NAMETAB mail_sw []
 
NAMETAB malias_sw []
 
CMDENT mod_mail_cmdtable []
 

Detailed Description

Module for penn-based mailer system.

Author
TinyMUSH development team (https://github.com/TinyMUSH)
Version
3.3
Date
2020-12-28
Note
This code was taken from Kalkin's DarkZone code, which was originally taken from PennMUSH 1.50 p10, and has been heavily modified since being included in MUX (and then being imported wholesale into 3.0).

Variable Documentation

◆ malias_sw

NAMETAB malias_sw[]
Initial value:
= {
{(char *)"desc", 1, CA_NO_SLAVE | CA_NO_GUEST, MALIAS_DESC},
{(char *)"chown", 1, CA_NO_SLAVE | CA_NO_GUEST, MALIAS_CHOWN},
{(char *)"add", 1, CA_NO_SLAVE | CA_NO_GUEST, MALIAS_ADD},
{(char *)"remove", 1, CA_NO_SLAVE | CA_NO_GUEST, MALIAS_REMOVE},
{(char *)"delete", 1, CA_NO_SLAVE | CA_NO_GUEST, MALIAS_DELETE},
{(char *)"rename", 1, CA_NO_SLAVE | CA_NO_GUEST, MALIAS_RENAME},
{(char *)"list", 1, CA_NO_SLAVE | CA_NO_GUEST, MALIAS_LIST},
{(char *)"status", 1, CA_NO_SLAVE | CA_NO_GUEST, MALIAS_STATUS},
{NULL, 0, 0, 0}}
#define CA_NO_GUEST
Definition: constants.h:389
#define CA_NO_SLAVE
Definition: constants.h:387

◆ mod_mail_cmdtable

CMDENT mod_mail_cmdtable[]
Initial value:
= {
{(char *)"@mail", mail_sw, CA_NO_SLAVE | CA_NO_GUEST, 0, CS_TWO_ARG | CS_INTERP, NULL, NULL, NULL, {do_mail}},
{(char *)"@malias", malias_sw, CA_NO_SLAVE | CA_NO_GUEST, 0, CS_TWO_ARG | CS_INTERP, NULL, NULL, NULL, {do_malias}},
{(char *)"-", NULL, CA_NO_GUEST | CA_NO_SLAVE | CF_DARK, 0, CS_ONE_ARG | CS_INTERP | CS_LEADIN, NULL, NULL, NULL, {do_postpend}},
{(char *)"~", NULL, CA_NO_GUEST | CA_NO_SLAVE | CF_DARK, 0, CS_ONE_ARG | CS_INTERP | CS_LEADIN, NULL, NULL, NULL, {do_prepend}},
{(char *)NULL, NULL, 0, 0, 0, NULL, NULL, NULL, {NULL}}}
#define CS_INTERP
Definition: constants.h:354
#define CS_LEADIN
Definition: constants.h:362
#define CS_TWO_ARG
Definition: constants.h:351
#define CF_DARK
Definition: constants.h:415
#define CS_ONE_ARG
Definition: constants.h:350

◆ mod_mail_conftable

CONF mod_mail_conftable[]
Initial value:
= {
{(char *)"mail_expiration", cf_int, CA_GOD, CA_PUBLIC, &mod_mail_config.mail_expiration, 0},
{NULL, NULL, 0, 0, NULL, 0}}
CF_Result cf_int(int *vp, char *str, long extra, dbref player, char *cmd)
Set integer parameter.
Definition: conf.c:483
#define CA_PUBLIC
Command permission flags.
Definition: constants.h:373
#define CA_GOD
Definition: constants.h:374

◆ mod_mail_functable

FUN mod_mail_functable[]
Initial value:
= {
{"MAIL", fun_mail, 0, FN_VARARGS, CA_PUBLIC, NULL},
{"MAILFROM", fun_mailfrom, 0, FN_VARARGS, CA_PUBLIC, NULL},
{NULL, NULL, 0, 0, 0, NULL}}
#define FN_VARARGS
Definition: constants.h:765

◆ mod_mail_nhashtable

MODHASHES mod_mail_nhashtable[]
Initial value:
= {
{"Mail messages", &mod_mail_msg_htab, 50, 8},
{NULL, NULL, 0, 0}}