Core Utility Help

$mail_agent

$mail_agent

This object contains a two distinct sets of routines:

1. utilities for performing basic mailsystem functions, e.g.,

matching on recipient names, resolving mail forwarding,

formatting messages, sending messages

Recipient Matching

match - match on a $mail_recipient

match_recipient - match on either a $mail_recipient or a player

match_failed - print angry messages to the user for $failed/ambiguous_match

look_self - provides a list of available $mail_recipients

check_names

touch

accept

Message Format

make_message - produces a message in the canonical transmission format

name - single recipient => string for address field

name_list - list of recipients => string for address field

parse_address_field - address field string => object list

Sending Messages

send_message - advertised message sending routine.

raw_send - raw message sending routine

(only called by $mail_editor:send and this:send_message)

resolve_addr - converts a given list recipients into a list of actual

recipients and objects to be notified.

sends_to - Does X forward (transitively) to Y

Mail Options

option

option_verbose

2. canonical versions of mail_recipient verbs

Ideally, the verbs to perform operations on a given mail recipient would be located on the recipient itself, except for the fact that these verbs also need to be located on players, which for various reasons, shouldn't be children of $mail_recipient. Multiple inheritance would solve our problems, but we don't have it yet. Ergo, both $mail_recipient and $player refer to the following verbs here:

display_seq_full print entire text of messages (@read)

display_seq_headers print headers of messages (@mail)

rm_message_seq remove messages (@rmm)

undo_rmm undo last rm_message_seq (@unrmm)

expunge_rmm flush removed messages (@unrmm expunge)

list_rmm list removed messages (@unrmm list)

renumber renumber messages (@renumber)

msg_summary_line msg header => display_seq_headers/list_rmm summary line

parse_message_seq command line msg sequence spec => message sequence

new_message_num => message number of next new message

length_all_msgs => number of messages (total)

length_num_le => number of messages numbered <= some number

length_date_le => number of messages dated <= some date

exists_num_eq => true iff there exists a messsage with the given number

from_msg_seq => message sequence of msgs from given sender(s)

to_msg_seq => message sequence of msgs to given recipient(s)

subject_msg_seq => message sequence of msgs with subjects containing text

body_msg_seq => message sequence of msgs with bodies containing text

messages_in_seq => list of {message number, message} pairs

messages == :messages_in_seq(1,:length_all_msgs()+1) (obsolete)

The $mail_agent versions of these verbs are set_task_perms(caller_perms()) and perform their operations on caller, which in turn is assumed to have done any necessary security checks.