Generic Mail Recipient #37

Parent #1Owner #29Flags read, fertileSource hellcore/hellcore.db

Aliases: Generic Mail Recipient

41 verbs · 31 properties · 6 children

Verbs

VerbSpecFlagsDefinerLines
set_aliasesthis none thisrxd#3722
look_selfthis none thisrxd#3750
is_writable_bythis none thisrxd#3715
is_readable_bythis none thisrxd#371
is_usable_bythis none thisrxd#376
mail_notifythis none thisrxd#375
mail_forwardthis none thisrxd#377
moderator_forwardthis none thisrxd#375
add_forwardthis none thisrxd#3726
delete_forwardthis none thisrxd#3728
add_notifythis none thisrxd#3719
delete_notifythis none thisrxd#3723
receive_messagethis none thisrxd#378
okthis none thisrxd#372
ok_writethis none thisrxd#372
parse_message_seq from_msg_seq %from_msg_seq to_msg_seq %to_msg_seq subject_msg_seq body_msg_seq kept_msg_seq unkept_msg_seq display_seq_headers display_seq_full messages_in_seq list_rmm new_message_num length_num_le length_date_le length_all_msgs exists_num_eq msg_seq_to_msg_num_list msg_seq_to_msg_num_stringthis none thisrxd#3724
length_date_gtthis none thisrxd#378
rm_message_seqthis none thisrxd#3710
undo_rmm expunge_rmm renumber keep_message_seqthis none thisrxd#3713
own_messages_filterthis none thisrxd#378
messagesthis none thisrxd#3712
date_sortthis none thisrxd#3724
_fix_last_msg_datethis none thisrxd#372
moderator_notifythis none thisrxd#371
msg_summary_linethis none thisrxd#371
__checkthis none thisrxd#374
__fixthis none thisrxd#3718
init_for_corethis none thisrxd#378
initializethis none thisrxd#374
mail_name short_mail_namethis none thisrxd#371
mail_namesthis none thisrxd#377
expire_old_messagesthis none thisrxd#3724
msg_full_textthis none thisrxd#375
@set_expirethis at/to anyrxd#3722
@register @netregisterthis at/to anyrxd#3742
@validatethis with/using anyrxd#3719
set_namethis none thisrxd#3716
extra_headersthis none thisrxd#371
folder_and_message fmthis none thisrxd#3720
folder_and_message_and_subject fmsthis none thisrxd#3740
convert_to_issue_listthis none thisrxd#3724

Properties

PropertyDefinerFlagsOwnerValue
moderator_notify#37rc#29{}
last_msg_date#37r#290
messages_going#37#29{}
moderated#37rc#29{}
moderator_forward#37rc#29"%n (%#) can't send to moderated list %t (%[#t]) directly."
writers#37rc#29{}
readers#37rc#29{}
mail_notify#37r#29{}
mail_forward#37r#29"%t (%[#t]) is a generic recipient."
expire_period#37r#292592000
last_used_time#37r#290
messages#37#29{}
rmm_own_msgs#37rc#291
guests_can_send_here#37rc#290
messages_kept#37r#29{}
registered_email#37#29""
email_validated#37#291
validation_password#37#29""
barcolor#37rc#29"white"
hidden_subjects#37rc#290
hidden_content#37rc#290
aliases#1r#29{"Generic Mail Recipient"}
description#1rc#29"This can either be a mailing list or a mail folder, depending on what mood you're in..."
object_size#1r#29{33807, 1298433815}
hidden_verbs#1rc#29<clear>
phelp_msg#1rc#29<clear>
weight#1rc#29<clear>
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

Ancestors (nearest first): #1 root

Children: #9 Generic Large-Capacity Mail Recipient, #23 New-Prog-Log, #28 Quota-Log, #53 News, #64 Site-Locks, #293 Generic Issue Tracking Mailing List

Call graph

calls n37_0 #37:set_aliases n42_0 #42:controls n37_0->n42_0 n1_4 #1:set_aliases n37_0->n1_4 n38_42 #38:reserved_pattern n37_0->n38_42 n107_43 #107:tell n37_0->n107_43 n38_9 #38:match n37_0->n38_9 n37_1 #37:look_self n37_1->n107_43 n37_30 #37:mail_names n37_1->n37_30 n20_5 #20:from_list n37_1->n20_5 n37_6 #37:mail_forward n37_1->n37_6 n37_2 #37:is_writable_by n37_1->n37_2 n37_3 #37:is_readable_by n37_1->n37_3 n37_4 #37:is_usable_by n37_1->n37_4 n1_8 #1:description n37_1->n1_8 n43_57 #43:fill_string n37_1->n43_57 n48_8 #48:suspend_if_needed n37_1->n48_8 n37_6->n37_4 n37_7 #37:moderator_forward n37_6->n37_7 n20_34 #20:pronoun_sub n37_6->n20_34 n37_2->n42_0 n37_3->n37_2 n38_1 #38:sends_to n37_3->n38_1 n37_4->n37_2 n45_5 #45:isa n37_4->n45_5 n37_5 #37:mail_notify n37_5->n37_4 n37_23 #37:moderator_notify n37_5->n37_23 n37_7->n20_34 n37_8 #37:add_forward n37_8->n42_0 n45_6 #45:ancestors n37_8->n45_6 n37_9 #37:delete_forward n37_9->n42_0 n37_10 #37:add_notify n37_10->n42_0 n37_10->n37_3 n37_11 #37:delete_notify n37_11->n42_0 n37_12 #37:receive_message n37_14 #37:ok_write n37_12->n37_14 n37_15 #37:parse_message_seq n37_12->n37_15 n37_14->n37_2 n37_13 #37:ok n37_15->n37_13 n37_13->n37_3 n37_16 #37:length_date_gt n37_16->n37_13 n37_17 #37:rm_message_seq n37_17->n37_14 n37_17->n37_13 n37_19 #37:own_messages_filter n37_17->n37_19 n37_19->n37_15 n37_18 #37:undo_rmm n37_18->n37_14 n37_20 #37:messages n37_20->n37_15 n37_20->n37_13 n37_21 #37:date_sort n37_21->n107_43 n37_21->n48_8 n37_21->n37_14 n37_21->n37_21 n47_14 #47:sort n37_21->n47_14 n47_1 #47:range n37_21->n47_1 n37_22 #37:_fix_last_msg_date n37_22->n37_15 n37_24 #37:msg_summary_line n38_22 #38:msg_summary_line n37_24->n38_22 n37_25 #37:__check n37_25->n48_8 n38_39 #38:__convert_new n37_25->n38_39 n37_26 #37:__fix n37_26->n37_14 n37_26->n38_39 n48_7 #48:running_out_of_time n37_26->n48_7 n6_9 #6:notify n37_26->n6_9 n37_27 #37:init_for_core n37_27->n37_22

Showing 48 of 75 verbs; 27 not shown.

Source

set_aliases

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1"For changing mailing list aliases, we check to make sure that none of the aliases match existing mailing list aliases.  Aliases containing spaces are not used in addresses and so are not subject to this restriction ($mail_agent:match will not match on them, however, so they only match if used in the immediate room, e.g., with match_object() or somesuch).";
2"  => E_PERM   if you don't own this";
3if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
4return E_PERM;
5elseif (this.location != $mail_agent)
6"... we don't care...";
7return pass(@args);
8else
9{newaliases} = args;
10for a in (aliases = newaliases)
11if (index(a, " "))
12"... we don't care...";
13elseif (rp = $mail_agent:reserved_pattern(a))
14player:tell("Mailing list name \"", a, "\" uses a reserved pattern: ", rp[1]);
15aliases = setremove(aliases, a);
16elseif (valid(p = $mail_agent:match(a, $nothing)) && ((p != this) && (a in p.aliases)))
17player:tell("Mailing list name \"", a, "\" in use on ", p.name, "(", p, ")");
18aliases = setremove(aliases, a);
19endif
20endfor
21return pass(aliases) && (newaliases == aliases);
22endif

look_self

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1"Returns full name and mail aliases for this list, read and write status by the player, and a short description. Calling :look_self(1) will omit the description.";
2{?brief = 0} = args;
3namelist = "*" + ((names = this:mail_names()) ? $string_utils:from_list(names, ", *") | tostr(this));
4if (typeof(fwd = this:mail_forward()) != LIST)
5fwd = {};
6endif
7if (this:is_writable_by(player))
8if (player in fwd)
9read = " [Writable/Subscribed]";
10else
11read = " [Writable]";
12endif
13elseif (this.readers == 1)
14read = tostr(" [Public", (player in fwd) ? "/Subscribed]" | "]");
15elseif (player in fwd)
16read = " [Subscribed]";
17elseif (this:is_readable_by(player))
18read = " [Readable]";
19else
20read = "";
21endif
22if (this:is_usable_by($no_one))
23mod = "";
24elseif (this:is_usable_by(player))
25mod = " [Approved]";
26else
27mod = " [Moderated]";
28endif
29if (player.programmer)
30player:tell(namelist, "  (", this, ")", read, mod);
31else
32player:tell(namelist, "  ", read, mod);
33endif
34if (!brief)
35d = this:description();
36if (typeof(d) == STR)
37d = {d};
38endif
39for l in (d)
40if (length(l) <= 75)
41ls = {l};
42else
43ls = $generic_editor:fill_string(l, 76);
44endif
45for line in (ls)
46player:tell("    ", line);
47$command_utils:suspend_if_needed(0);
48endfor
49endfor
50endif

is_writable_by

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1who = args[1];
2if (who.wizard)
3return 1;
4elseif (!this.writers)
5return $perm_utils:controls(who, this);
6elseif (typeof(this.writers) == INT)
7return this.writers;
8else
9for x in (this.writers)
10if (is_a(who, x))
11return 1;
12endif
13endfor
14endif
15return 0;

is_readable_by

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1return (typeof(this.readers) != LIST) || (((who = args[1]) in this.readers) || (this:is_writable_by(who) || $mail_agent:sends_to(1, this, who)));

is_usable_by

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1who = args[1];
2if (this.moderated)
3return `who in this.moderated ! E_TYPE' || (this:is_writable_by(who) || who.wizard);
4else
5return this.guests_can_send_here || (!$object_utils:isa(who, $guest));
6endif

mail_notify

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1if ((args && (!this:is_usable_by(args[1]))) && (!args[1].wizard))
2return this:moderator_notify(@args);
3else
4return this.(verb);
5endif

mail_forward

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1if ((args && (!this:is_usable_by(args[1]))) && (!args[1].wizard))
2return this:moderator_forward(@args);
3elseif (typeof(mf = this.(verb)) == STR)
4return $string_utils:pronoun_sub(mf, @args);
5else
6return mf;
7endif

moderator_forward

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1if (typeof(mf = this.(verb)) == STR)
2return $string_utils:pronoun_sub(mf, args ? args[1] | $player);
3else
4return mf;
5endif

add_forward

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1":add_forward(recip[,recip...]) adds new recipients to this list.  Returns a string error message or a list of results (recip => success, E_PERM => not allowed, E_INVARG => not a valid recipient, string => other kind of failure)";
2if (caller == $mail_editor)
3perms = player;
4else
5perms = caller_perms();
6endif
7result = {};
8forward_self = (!this.mail_forward) || (this in this.mail_forward);
9for recip in (args)
10if ((!valid(recip)) || ((!is_player(recip)) && (!($mail_recipient in $object_utils:ancestors(recip)))))
11r = E_INVARG;
12elseif ($perm_utils:controls(perms, this) || ((typeof(this.readers) != LIST) && $perm_utils:controls(perms, recip)))
13this.mail_forward = setadd(this.mail_forward, recip);
14r = recip;
15else
16r = E_PERM;
17endif
18result = listappend(result, r);
19endfor
20if ((length(this.mail_forward) > 1) && ($nothing in this.mail_forward))
21this.mail_forward = setremove(this.mail_forward, $nothing);
22endif
23if (forward_self)
24this.mail_forward = setadd(this.mail_forward, this);
25endif
26return result;

delete_forward

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1":delete_forward(recip[,recip...]) removes recipients to this list.  Returns a list of results (E_PERM => not allowed, E_INVARG => not on list)";
2if (caller == $mail_editor)
3perms = player;
4else
5perms = caller_perms();
6endif
7result = {};
8forward_self = (!this.mail_forward) || (this in this.mail_forward);
9for recip in (args)
10if (!(recip in this.mail_forward))
11r = E_INVARG;
12elseif (((!valid(recip)) || $perm_utils:controls(perms, recip)) || $perm_utils:controls(perms, this))
13if (recip == this)
14forward_self = 0;
15endif
16this.mail_forward = setremove(this.mail_forward, recip);
17r = recip;
18else
19r = E_PERM;
20endif
21result = listappend(result, r);
22endfor
23if (!(forward_self || this.mail_forward))
24this.mail_forward = {$nothing};
25elseif (this.mail_forward == {this})
26this.mail_forward = {};
27endif
28return result;

add_notify

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1":add_notify(recip[,recip...]) adds new notifiees to this list.  Returns a list of results (recip => success, E_PERM => not allowed, E_INVARG => not a valid recipient)";
2if (caller == $mail_editor)
3perms = player;
4else
5perms = caller_perms();
6endif
7result = {};
8for recip in (args)
9if ((!valid(recip)) || (recip == this))
10r = E_INVARG;
11elseif ($perm_utils:controls(perms, this) || (this:is_readable_by(perms) && $perm_utils:controls(perms, recip)))
12this.mail_notify = setadd(this.mail_notify, recip);
13r = recip;
14else
15r = E_PERM;
16endif
17result = listappend(result, r);
18endfor
19return result;

delete_notify

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1":delete_notify(recip[,recip...]) removes notifiees from this list.  Returns a list of results (E_PERM => not allowed, E_INVARG => not on list)";
2if (caller == $mail_editor)
3perms = player;
4else
5perms = caller_perms();
6endif
7result = {};
8rmthis = 0;
9for recip in (args)
10if (!(recip in this.mail_notify))
11r = E_INVARG;
12elseif ((!valid(recip)) || ($perm_utils:controls(perms, recip) || $perm_utils:controls(perms, this)))
13if (recip == this)
14rmthis = 1;
15endif
16this.mail_notify = setremove(this.mail_notify, recip);
17r = recip;
18else
19r = E_PERM;
20endif
21result = listappend(result, r);
22endfor
23return result;

receive_message

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1if (!this:ok_write(caller, caller_perms()))
2return E_PERM;
3else
4this.messages = {@this.messages, {new = this:new_message_num(), args[1]}};
5this.last_msg_date = args[1][1];
6this.last_used_time = time();
7return new;
8endif

ok

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1":ok(caller,callerperms) => true iff caller can do read operations";
2return (args[1] in {this, $mail_agent}) || (args[2].wizard || this:is_readable_by(args[2]));

ok_write

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1":ok_write(caller,callerperms) => true iff caller can do write operations";
2return ((args[1] in {this, $mail_agent}) || args[2].wizard) || this:is_writable_by(args[2]);

parse_message_seq from_msg_seq %from_msg_seq to_msg_seq %to_msg_seq subject_msg_seq body_msg_seq kept_msg_seq unkept_msg_seq display_seq_headers display_seq_full messages_in_seq list_rmm new_message_num length_num_le length_date_le length_all_msgs exists_num_eq msg_seq_to_msg_num_list msg_seq_to_msg_num_string

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1":parse_message_seq(strings,cur) => {msg_seq,@unused_strings} or string error";
2"";
3":from_msg_seq(olist)     => msg_seq of messages from those people";
4":%from_msg_seq(strings)  => msg_seq of messages with strings in the From: line";
5":to_msg_seq(olist)       => msg_seq of messages to those people";
6":%to_msg_seq(strings)    => msg_seq of messages with strings in the To: line";
7":subject_msg_seq(target) => msg_seq of messages with target in the Subject:";
8":body_msg_seq(target)    => msg_seq of messages with target in the body";
9":new_message_num()    => number that the next incoming message will receive.";
10":length_num_le(num)   => number of messages in folder numbered <= num";
11":length_date_le(date) => number of messages in folder dated <= date";
12":length_all_msgs()    => number of messages in folder";
13":exists_num_eq(num)   => index of message in folder numbered == num, or 0";
14"";
15":display_seq_headers(msg_seq[,cur])   display message summary lines";
16":display_seq_full(msg_seq[,preamble]) display entire messages";
17"            => number of final message displayed";
18":list_rmm() displays contents of .messages_going.";
19"            => the number of messages in .messages_going.";
20"";
21":messages_in_seq(msg_seq) => list of messages in msg_seq on folder";
22"";
23"See the corresponding routines on $mail_agent for more detail.";
24return this:ok(caller, caller_perms()) ? $mail_agent:(verb)(@args) | E_PERM;

length_date_gt

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1":length_date_le(date) => number of messages in folder dated > date";
2"";
3if (this:ok(caller, caller_perms()))
4date = args[1];
5return (this.last_msg_date <= date) ? 0 | $mail_agent:(verb)(date);
6else
7return E_PERM;
8endif

rm_message_seq

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1":rm_message_seq(msg_seq) removes the given sequence of from folder";
2"               => string giving msg numbers removed";
3"See the corresponding routine on $mail_agent.";
4if (this:ok_write(caller, caller_perms()))
5return $mail_agent:(verb)(@args);
6elseif (this:ok(caller, caller_perms()) && (seq = this:own_messages_filter(caller_perms(), @args)))
7return $mail_agent:(verb)(@listset(args, seq, 1));
8else
9return E_PERM;
10endif

undo_rmm expunge_rmm renumber keep_message_seq

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1":rm_message_seq(msg_seq) removes the given sequence of from folder";
2"               => string giving msg numbers removed";
3":list_rmm()    displays contents of .messages_going.";
4"               => number of messages in .messages_going.";
5":undo_rmm()    restores previously deleted messages from .messages_going.";
6"               => msg_seq of restored messages";
7":expunge_rmm() destroys contents of .messages_going once and for all.";
8"               => number of messages in .messages_going.";
9":renumber([cur])  renumbers all messages";
10"               => {number of messages,new cur}.";
11"";
12"See the corresponding routines on $mail_agent.";
13return this:ok_write(caller, caller_perms()) ? $mail_agent:(verb)(@args) | E_PERM;

own_messages_filter

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1":own_messages_filter(who,msg_seq) => subsequence of msg_seq consisting of those messages that <who> is actually allowed to remove (on the assumption that <who> is not one of the allowed writers of this folder.";
2if (!this.rmm_own_msgs)
3return E_PERM;
4elseif ((typeof(seq = this:from_msg_seq({args[1]}, args[2])) != LIST) || (seq != args[2]))
5return {};
6else
7return seq;
8endif

messages

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1"NOTE:  this routine is obsolete, use :messages_in_seq()";
2":messages(num) => returns the message numbered num.";
3":messages()    => returns the entire list of messages (can be SLOW).";
4if (!this:ok(caller, caller_perms()))
5return E_PERM;
6elseif (!args)
7return this:messages_in_seq({1, this:length_all_msgs() + 1});
8elseif (!(n = this:exists_num_eq(args[1])))
9return E_RANGE;
10else
11return this:messages_in_seq(n)[2];
12endif

date_sort

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1if (!this:ok_write(caller, caller_perms()))
2return E_PERM;
3endif
4date_seq = {};
5for msg in (this.messages)
6date_seq = {@date_seq, msg[2][1]};
7endfor
8msg_order = $list_utils:sort($list_utils:range(n = length(msgs = this.messages)), date_seq);
9newmsgs = {};
10for i in [1..n]
11if ($command_utils:suspend_if_needed(0))
12player:tell("...", i);
13endif
14newmsgs = {@newmsgs, {i, msgs[msg_order[i]][2]}};
15endfor
16if (length(this.messages) != n)
17"...shit, new mail received,... start again...";
18fork (0)
19this:date_sort();
20endfork
21else
22this.messages = newmsgs;
23this.last_used_time = newmsgs[$][2][1];
24endif

_fix_last_msg_date

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1mlen = this:length_all_msgs();
2this.last_msg_date = mlen && this:messages_in_seq(mlen)[2][1];

moderator_notify

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1return this.(verb);

msg_summary_line

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1return $mail_agent:msg_summary_line(@args);

__check

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1for m in (this.messages)
2$mail_agent:__convert_new(@m[2]);
3$command_utils:suspend_if_needed(0);
4endfor

__fix

Spec this none thisFlags rxdOwner #361Definer #37

Referenced by

none

Source

1if (!this:ok_write(caller, caller_perms()))
2return E_PERM;
3endif
4msgs = {};
5i = 1;
6for m in (oldmsgs = this.messages)
7msgs = {@msgs, {m[1], $mail_agent:__convert_new(@m[2])}};
8if ($command_utils:running_out_of_time())
9player:notify(tostr("...", i, " ", this));
10suspend(0);
11if (oldmsgs != this.messages)
12return 0;
13endif
14endif
15i = i + 1;
16endfor
17this.messages = msgs;
18return 1;

init_for_core

Spec this none thisFlags rxdOwner #361Definer #37

Referenced by

Source

1if (caller_perms().wizard)
2pass();
3if (!(this in {$mail_recipient, $big_mail_recipient}))
4"...generic mail recipients stay in #-1...";
5move(this, $mail_agent);
6this:_fix_last_msg_date();
7endif
8endif

initialize

Spec this none thisFlags rxdOwner #361Definer #37

Referenced by

none

Source

1if ($perm_utils:controls(caller_perms(), this))
2this.mail_forward = {};
3return pass(@args);
4endif

mail_name short_mail_name

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1return "*" + this.aliases[1];

mail_names

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1names = {};
2for a in (this.aliases)
3if (!index(a, " "))
4names = setadd(names, strsub(a, "_", "-"));
5endif
6endfor
7return names;

expire_old_messages

Spec this none thisFlags rxdOwner #361Definer #37

Referenced by

Source

1if (this:ok_write(caller, caller_perms()))
2"Passed security check...";
3set_task_perms($wiz_utils:random_wizard());
4for x in (this.mail_notify)
5if (!$object_utils:has_verb(x, "notify_mail"))
6"In theory I should call this:delete_notify but it's ugly and ticky as sin and I'm lazy.";
7this.mail_notify = setremove(this.mail_notify, x);
8endif
9endfor
10if (this.expire_period && (rmseq = $seq_utils:remove(this:unkept_msg_seq(), 1 + this:length_date_le(time() - this.expire_period))))
11"... i.e., everything not marked kept that is older than expire_period";
12if (this.registered_email && this.email_validated)
13format = this.owner:format_for_netforward(this:messages_in_seq(rmseq), " expired from " + $mail_agent:name(this));
14$network:sendmail(this.registered_email, @{format[2], @format[1]});
15"Do nothing if it bounces, etc.";
16endif
17this:rm_message_seq(rmseq);
18return this:expunge_rmm();
19else
20return 0;
21endif
22else
23return E_PERM;
24endif

msg_full_text

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

Source

1":msg_full_text(@msg) => list of strings.";
2"msg is a mail message (in the usual transmission format).";
3"display_seq_full calls this to obtain the actual list of strings to display.";
4return player:msg_text(@args);
5"default is to leave it up to the player how s/he wants it to be displayed.";

@set_expire

Spec this at/to anyFlags rxdOwner #29Definer #37

Referenced by

none

Source

1"Syntax:  @set_expire <recipient> to <time>";
2"         @set_expire <recipient> to";
3"";
4"Allows the list owner to set the expiration period of this mail recipient. This is the time messages will remain before they are removed from the list. The <time> given can be in english terms (e.g., 2 months, 45 days, etc.).";
5"Non-wizard mailing list owners are limited to a maximum expire period of 180 days. They are also prohibited from setting the list to non-expiring.";
6"Wizards may set the expire period to 0 for no expiration.";
7"The second form, leaving off the time specification, will tell you what the recipient's expire period is currently set to.";
8if ((caller_perms() != #-1) && (caller_perms() != player))
9return player:tell(E_PERM);
10elseif (!this:is_writable_by(player))
11return player:tell(E_PERM);
12elseif (!iobjstr)
13return player:tell(this.expire_period ? tostr("Messages will automatically expire from ", this:mail_name(), " after ", $time_utils:english_time(this.expire_period), ".") | tostr("Messages will not expire from ", this:mail_name()));
14elseif (typeof(time = $time_utils:parse_english_time_interval(iobjstr)) == ERR)
15return player:tell(time);
16elseif ((time == 0) && (!player.wizard))
17return player:tell("Only wizards may set a mailing list to not expire.");
18elseif ((time > (180 * 86400)) && (!player.wizard))
19return player:tell("Only a wizard may set the expiration period on a mailing list to greater than 180 days.");
20endif
21this.expire_period = time;
22player:tell("Messages will ", (time != 0) ? tostr("automatically expire from ", this:mail_name(), " after ", $time_utils:english_time(time)) | tostr("not expire from ", this:mail_name()), ".");

@register @netregister

Spec this at/to anyFlags rxdOwner #361Definer #37

Referenced by

none

Source

1"Syntax:   @register <recipient> to <email-address>";
2"alias     @netregister <recipient> to <email-address>";
3"          @register <recipient> to";
4"";
5"The list owner may use this command to set a registered email address for the mail recipient. When set, mail messages that expire off of the mail recipient will be mailed to that address.";
6"If you leave the email address off of the command, it will return the current registration and expiration information for that recipient if you own it.";
7"The owner may register a mail recipient to any email address. However, if the address does not match his registered email address, then a password will be generated and sent to the address specified when this command is used. Then, the owner may retrieve that password and verify the address with the command:";
8"";
9"  @validate <recipient> with <password>";
10"";
11"See *B:MailingListReform #98087 for full details.";
12if ((caller_perms() != #-1) && (caller_perms() != player))
13return player:tell(E_PERM);
14elseif (!$perm_utils:controls(player, this))
15return player:tell(E_PERM);
16elseif (!iobjstr)
17if (this.registered_email)
18player:tell(this:mail_name(), " is registered to ", this.registered_email, ". Messages will be sent there when they expire after ", (this.expire_period == 0) ? "never" | $time_utils:english_time(this.expire_period), ".");
19else
20player:tell(this:mail_name(), " is not registered to any address. Messages will be deleted when they expire after ", (this.expire_period == 0) ? "never" | $time_utils:english_time(this.expire_period), ".");
21player:tell("Usage:  @register <recipient> to <email-address>");
22endif
23return;
24elseif (iobjstr == $wiz_utils:get_email_address(player))
25this.registered_email = $wiz_utils:get_email_address(player);
26this.email_validated = 1;
27player:tell("Messages expired from ", this:mail_name(), " after ", (this.expire_period == 0) ? "never" | $time_utils:english_time(this.expire_period), " will be emailed to ", this.registered_email, " (which is your registered email address).");
28elseif (reason = $network:invalid_email_address(iobjstr))
29return player:tell(reason, ".");
30elseif (!$network.active)
31return player:tell("The network is not up at the moment. Please try again later or contact a wizard for help.");
32else
33password = $wiz_utils:random_password(5);
34result = $network:sendmail(iobjstr, tostr($network.MOO_Name, " mailing list verification"), @$generic_editor:fill_string(tostr("The mailing list ", this:mail_name(), " on ", $network.MOO_Name, " has had this address designated as the recipient of expired mail messages. If this is not correct, then you need do nothing but ignore this message. If this is correct, you must log into the MOO and type:  `@validate ", this:mail_name(), " with ", password, "' to start receiving expired mail messages."), 75));
35if (result != 0)
36return player:tell("Mail sending did not work: ", result, ". Address not set.");
37endif
38this.registered_email = iobjstr;
39this.email_validated = 0;
40this.validation_password = password;
41player:tell("Registration complete. Password sent to the address you specified. When you receive the email, log back in to validate it with the command:  @validate <recipient> with <password>. If you do not receive the password email, try again or notify a wizard if this is a recurring problem.");
42endif

@validate

Spec this with/using anyFlags rxdOwner #29Definer #37

Referenced by

none

Source

1"Syntax:  @validate <recipient> with <password>";
2"";
3"This command is used to validate an email address set to receive expired messages that did not match the list owner's registered email address. When using the @register command, a password was sent via email to the address specified. This command is to verify that the password was received properly.";
4if ((caller_perms() != #-1) && (caller_perms() != player))
5return player:tell(E_PERM);
6elseif (!$perm_utils:controls(player, this))
7return player:tell(E_PERM);
8elseif (!this.registered_email)
9return player:tell("No email address has even been set for ", this:mail_name(), ".");
10elseif (this.email_validated)
11return player:tell("The email address for ", this:mail_name(), " has already been validated.");
12elseif (!iobjstr)
13return player:tell("Usage:  @validate <recipient> with <password>");
14elseif (iobjstr != this.validation_password)
15return player:tell("That is not the correct password.");
16else
17this.email_validated = 1;
18player:tell("Password validated. Messages that expire after ", (this.expire_period == 0) ? "never" | $time_utils:english_time(this.expire_period), " from ", this:mail_name(), " will be emailed to ", this.registered_email, ".");
19endif

set_name

Spec this none thisFlags rxdOwner #29Definer #37

Referenced by

none

Source

1{name} = args;
2if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
3return E_PERM;
4elseif (this.location != $mail_agent)
5"... we don't care...";
6return pass(@args);
7elseif (index(name, " "))
8"... we don't care...";
9elseif (rp = $mail_agent:reserved_pattern(name))
10player:tell("Mailing list name \"", a, "\" uses a reserved pattern: ", rp[1]);
11return 0;
12elseif (valid(p = $mail_agent:match(name, $nothing)) && ((p != this) && (name in p.aliases)))
13player:tell("Mailing list name \"", name, "\" in use on ", p.name, "(", p, ")");
14return 0;
15endif
16return pass(name);

extra_headers

Spec this none thisFlags rxdOwner #361Definer #37

Referenced by

none

Source

1return {};

folder_and_message fm

Spec this none thisFlags rxdOwner #361Definer #37

Referenced by

Source

1{seq} = args;
2size = $seq_utils:size(seq);
3first_word = this.name;
4short_alias = this.aliases[$];
5if (length(short_alias) <= 6)
6first_word = short_alias;
7endif
8if (spc = index(first_word, " "))
9first_word = first_word[1..spc - 1];
10endif
11if (hyph = index(first_word, "-"))
12first_word = $su:smart_abbrev(first_word, 9);
13endif
14if (size == 1)
15seqnum = seq[1];
16msgnum = this.messages[seqnum][1];
17return tostr("*", first_word, "/", msgnum);
18else
19return tostr(size, " msgs on *", first_word);
20endif

folder_and_message_and_subject fms

Spec this none thisFlags rxdOwner #361Definer #37

Referenced by

Source

1{seq} = args;
2size = $seq_utils:size(seq);
3first_word = this.name;
4short_alias = this.aliases[$];
5if (length(short_alias) <= 6)
6first_word = short_alias;
7endif
8if (spc = index(first_word, " "))
9first_word = first_word[1..spc - 1];
10endif
11if (hyph = index(first_word, "-"))
12first_word = $su:smart_abbrev(first_word, 10);
13endif
14if (size == 1)
15seqnum = seq[1];
16{msgnum, m} = this.messages[seqnum];
17subj = m[4];
18if (length(subj) >= 30)
19subj = subj[1..25] + "...";
20endif
21if (!this.hidden_content)
22first_line = `m[11] ! E_RANGE => ""';
23if ((!subj) || (subj == " "))
24if (length(first_line) <= 30)
25subj = first_line;
26else
27subj = first_line[1..25] + "...";
28endif
29elseif (length(subj) < 20)
30if (length(first_line) >= 30)
31subj = ((subj + " - ") + first_line[1..25]) + "...";
32else
33subj = (subj + " - ") + first_line;
34endif
35endif
36endif
37return tostr("*", first_word, "/", msgnum, " ", subj);
38else
39return tostr(size, " messages on *", first_word);
40endif

convert_to_issue_list

Spec this none thisFlags rxdOwner #361Definer #37

Referenced by

none

Source

1if (is_a(this, $issue_list))
2player:tell("It already is an $issue_list.");
3return;
4endif
5if (!player.wizard)
6raise(E_PERM);
7endif
8player:tell("Are you sure you want to convert ", $su:nn(this), " to an $issue_list? There's no going back.");
9if (!$cu:yes_or_no())
10player:tell("Aborted.");
11return;
12endif
13player:tell("Starting conversion...");
14chparent(this, $issue_list);
15for i in [1..length(this.messages)]
16msg = this.messages[i][2];
17newmsg = {@msg[1..4], this.default_type, this.default_status, this.default_assigned, {{}, {}}, {}, "", @msg[5..$]};
18this.messages[i][2] = newmsg;
19if ((i % 1000) == 0)
20player:tell("[ Done ", i, " messages... ]");
21endif
22yield;
23endfor
24player:tell("Conversion complete. You'll still have to set up types, statuses, etc.");