Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for Brandy Mailer 1.4

###############################################################################
# code written by Brandy@CrystalMUSH
# for MUSH 2.2 or later *ONLY*
#
# NOTES AND CAUTIONS: This file should only be installed on systems
# that do not currently have my mailer installed, or on systems already
# running version 13 (since 13 has been out more than a year, this shouldn't
# be a hardship).
#
# Notes on the formating of this file:
# - is used to separate attributes
# # in the first column means a comment
# all leading blanks should be stripped, but tailing ones should not
#
# This +mail code is available via anonymous FTP from
# ftp.tinymush.org (205.226.195.2) in file:
# /pub/mud/tinymush/mushcode/mail/brandy_mailer.14
#
# A tool that parses this format is available in the same directory in file:
# amolitor_mush_unformatter.c
#
# Carol
# a.k.a Brandy@CrystalMUSH
#
# MAILING LIST:
#
# To be kept abreast of patches and upgrades, or if you just want to
# make comments/suggestions whatever, subscribe to brandy-mail@lupine.org
# by sending an email message to listserv@lupine.org, with
# 'subscribe brandy-mail MyNameHere' in the body of the mail message.
#
###############################################################################
# Possibilities for the future:
#
# fix 'store' to not have dested player in held and dist from alias
# example: michael was dested, but was still in either the singer or
# the rp_coordinator alias
#
###############################################################################
#
# Version 14:
#
# Misc:
# Updated to use new 2.2 functions:
# last(), squish, ulocal, default, hasattr
# use %q<number> instead of r(<number>)
#
# Bug fixes.
# MAJOR BUG fix for +destroy mailbox command
# fixed bug in +set mail default separator
# fixed bug in +read, cc line not showing if set
# fixed bug in +remove filter
# fixed bug in +status of mail sent to <name>, time read was wrong
# +edit global aliases and +edit personal alias now filters out
# non-player names BEFORE attempting to edit, without bitching about it.
# fixed +list folders to not crap out on big mailboxes with lots of folders
# (used to get function limit exceeded)
# restructured 'expand_letter_range' some to avoid function limit exceeded
# when +skim author:<name> is done on very large mailboxes.
# changed 'snag_dbrefs' to verify each dbref is a player
# (had a mailbox inconsistency problem when an alias had a player
# who had an autoforward to someone who wasn't a player anymore)
# Fixed bug where vacation messages would loop of the mush default
# switch for @swi is '/all'.
# Added a restriction for global mail aliases to 14 chars to avoid a
# server bug
# Added a restriction for personal mail aliases to 25 chars to avoid a
# server bug
#
# Features:
# forwarded mail now shows up with a FORWARDED flag on a +read, and
# a F on a skim (request so that people can't fake forwarded messages)
#
# show 'a' for mailboxes with autoforward set in +mail status
#
# spell check subject and text when +proof is done (if +spell is installed)
# (See Andrew Molitor if you're interested in the spell robot)
#
# +include <letter number or keyword> (while +replying or writing mail)
#
# added a debug attribute
#
# revamped +help per request of Ambar
#
# removed 'mode' option. Slimmed enter/finish messages.
#
# added '+check mail/all' command
#
# If 'null' is specified as the folder on a mail filter, automatically
# toss it
#
# New command: +set mail option filter reject = <text>.
# This command comes into play if one or more mail filters have been
# defined that point to the 'null' (discard) folder. If 'filter reject'
# text is registered, mail containing that text is sent to the originator.
# (Note that this differs from the pre-existing 'reject' text in that
# that is when ALL mail is being refused).
#
# New command: +verify mail config
# verifies that @admin space_compress=yes
# verifies that @swi/first works (don't laugh, I've been called on
# games to fix 'bugs' where it turned out that certain cases of
# @swi/first were busted. :P)
# verifies that @attribute/access mail_config_options=wizard
# verifies that mail system does not have I or W flags
# verifies that Wiz-Inherit Object is owned by a wizard and I or W
# verifies that the mail system is parented to the parent mail object
# verifies that the mail system is allowed to @create objects
# NOTE: I would *like* to verify that 1) remote @pemit's are allowed,
# 2) @attribute/access mail_config_options=!private and 3)
# @attribute/access mail_sig=!private, but I can't figure out how to
# do that automatically on generic systems, so y'all will just have to
# verify that yourself.
#
# Changed +mail status to show warning message if mailbox is owned by
# the wrong player.
#
# Changed hidden command '+sanity check' to automatically fix detected
# problems
#
# Added timeout of 'mail-in-progress' stuff (assumes attribute 'last'
# is not private, see @list attr_permissions)
#
# New command: +set mail option RGA = yes | no
# (RGA stands for Restrict Global Aliases. If set to 'yes', only wizards
# may create global aliases. Default is no restrictions)
#
# Added a @startup for the Master Mailbox to automatically clean out
# dbrefs that no longer are players in global aliases.
#
###############################################################################
#
# The following are the mapping of dbref to object in this file.
#
# #300 - Mail System
# #25 - Wiz-Inherit Object
# #7 - Master Mailbox
# #13 - Help Text
# #4167 - Parent Mail Object
#
# To modify this file for use on another MUSH, basically, 5 vi commands
# must be used to change the dbrefs to the ones for the matching objects
# on the MUSH this is being installed on. Then run it through Andrew
# Molitor's MUSH code unformatter. It is then ready for quoting in via
# tf or whatever. (For first time installations, see instructions below).
#
# (brief instructions)
# create the objects needed
# edit brandy_mailer.14 to reference the relevant dbrefs
# compile the unformatter: cc amolitor_mush_unformatter.c
# then run the mailer through it: a.out brandy_mailer.14 >mailer
# and install via tf: /quote -5 'mailer
#
# (vi commands to change dbrefs through the file)
#
# :1,$s/#300/<the dbref on your MUSH for the mail system object>/g
# :1,$s/#25/<the dbref on your MUSH for the wiz-inherit object>/g
# :1,$s/#7/<the dbref on your MUSH for the master mailbox object>/g
# :1,$s/#13/<the dbref on your MUSH for the help text object>/g
# :1,$s/#4167/<the dbref on your MUSH for the parent mail object>/g
#
# NOTE:
#
# The personal mail option commands won't work on #1, since there
# are permission problems with setting attributes on 'god'. If
# 'god' is so inclined to use +mail and wants personal options
# set, s/he will need to set the &mail_config_options attribute
# on him/herself.
#
###############################################################################
#
# For those installing it for the first time....
#
# @create Mail System (must reside in the master room)
# @create Wiz-Inherit Object
# (Note: must reside in the master room, this object holds the few mail
# commands that need wiz powers)
# @create Master Mailbox
# @create Help Text
# @create Parent Mail Object
#
# @parent Mail System = Parent Mail Object
#
# @set Wiz-Inherit Object=inherit
# (Note: the other objects need not and indeed
# should not be set inherit)
#
# &mail_config_options me=soft
# &mail_config_options me=
# ^_____(just to get that attribute in the list of user attributes)
#
# &mail_sig me=something
# &mail_sig me=
# ^_____(just to get that attribute in the list of user attributes)
#
# @attribute/access mail_config_options=wizard (must be done by god(#1))
# @attribute/access mail_config_options=!private (must be done by god(#1))
# @attribute/access mail_sig=!private (must be done by god(#1))
#
# The Mail System object and the Wiz-Inherit Object must reside
# in the Master Room. The remaining objects should not be in the
# master room. Just stick them in a bag somewhere and forget about them. ;)
#
# CAUTION: In order for the +mailer to work, space compression
# MUST be turned on (@admin space_compress=yes). This shouldn't
# present a problem since most (all?) MUSHes run this way.
#
# Also, remote @pemit's must be allowed.
#
# The mail system needs to be able to create objects.
#
-
#
# Set the MAILBOXES_NUM_OF_ATTRIBUTEs, only if not previously set by
# a prior installation.
#


@swi hasattr(#7, mailboxes_num_of_attributes) = 0,&mailboxes_num_of_attributes #7=1
@swi hasattr(#4167, SPELL_CHECKER_AVAILABLE) = 0,&SPELL_CHECKER_AVAILABLE #4167 = 0
@swi hasattr(#7, DEFAULT_RGA_OPTION) = 0,&DEFAULT_RGA_OPTION #7 = 0
@swi hasattr(#7, DEFAULT_DELETE_OPTION) = 0,&DEFAULT_DELETE_OPTION #7 = soft
@swi hasattr(#7, DELETE_WHEN_EMPTY) = 0,&DELETE_WHEN_EMPTY #7 = 1
@swi hasattr(#7, DEFAULT_TIMEOUT_OPTION) = 0,&DEFAULT_TIMEOUT_OPTION #7 = 1209600
@swi hasattr(#7, DEFAULT_PURGE_TIME) = 0,&DEFAULT_PURGE_TIME #7 = Wednesday 04:00
@swi hasattr(#7, DEFAULT_FORMAT_OPTION) = 0,&DEFAULT_FORMAT_OPTION #7 = standard
@swi hasattr(#7, DEFAULT_SAVE_OPTION) = 0,&DEFAULT_SAVE_OPTION #7 = enabled
@swi hasattr(#7, DEFAULT_SEPARATOR_OPTION) = 0,&DEFAULT_SEPARATOR_OPTION #7 = space
&DELIVERY_NOTIFICATION #4167=A light blinks on your wrist unit indicating that a new message has been received from [name(%0)] in folder '%5'[switch(or(%1, %2, %3, %4), 1, {%b([switch(%1, 1, %b[v(mail_flag_u)])][switch(%2, 1, %b[v(mail_flag_p)])][switch(%3, 1, %b[v(mail_flag_rr)])][switch(%4, 1, %b[v(mail_flag_r)])]%b).}, .)]
&PICKUP_NOTIFICATION #4167=The mail has been sent.
&FORWARD_NOTIFICATION #4167=Letter %1 in folder '%0' has been forwarded.
&TEXT_ADDED_NOTIFICATION #4167 = Text added.
&MAIL_VERSION #4167=Thu Mar 6, 1997
@VM #4167 = #7
@VM #25 = #7
&MAIL_SYSTEM #4167=#300
&MAIL_SYSTEM #25=#300
@drain #7
@no #7
&EQUAL_LINE #4167=repeat(=, 78)
&DASH_LINE #4167=repeat(-, 78)
&MAIL_FLAG_RR #4167=REPLY REQUESTED
&MAIL_FLAG_P #4167=PRIVATE
&MAIL_FLAG_U #4167=URGENT
&MAIL_FLAG_R #4167=REGISTERED
&MAIL_FLAG_D #4167=MARKED FOR DELETION
&MAIL_FLAG_T #4167=TIMEOUT WARNING
&MAIL_FLAG_S #4167=SAVED
&MAIL_FLAG_M #4167=MARKED
&MAIL_FLAG_F #4167=FORWARDED
&SECONDS_IN_DAY #4167 = 86400
&SECONDS_IN_DAY #25 = 86400
&ENTER_MSG #4167=You may now enter the message text.%b%bTo see options, type '-'.
&ENTER_MSG_VERBOSE #4167=
&ENTER_MSG_TERSE #4167=
&FINISH_MSG_VERBOSE #4167=
&FINISH_MSG_TERSE #4167=
&FINISH_MSG #4167=Options: %b+proof, +send, +toss, +cc, +bcc, +edit <part>=<old>/<new> or %r+set mail flag \[!\]<flag>.%b%bTo see expanded option help, type '-'.
&NOMAIL #4167=There is no mail in folder '[secure(%0)]'.
&NO_SENT_MAIL #4167 = There is no mail from you remaining in the mail system.
&NOFUNC #4167=I'm sorry, but function calls are not allowed within an input parameter.
&NOT_PLAYER #4167 = You must be a player to use the mail system.
&NOT_WRITING_MAIL #4167 = There is not a mail message in progress.
&NO_MATCH #4167 = %0:%b%bNo letter matches the specified criteria%1 in folder '%2'.
&NO_MAIL_FROM_YOU #4167 = There is no mail from you in %0's mailbox.
&overflow_point #7=3900
&percent_r #4167=%r
&temp_cmd #300=$setnewline *:&newline #4167=%0
setnewline %r
&temp_cmd #300=
&CHECK_MAIL_COMMAND #300=$+check mail: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strlen(%q0),{@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +check mail; @pemit %# = [setq(1, u(get_folder_in_list, %q0))][setq(2, u(get_active_folder, %q0))][setq(3, switch(words(%q1), 0, 0, words(filter(mail_not_read, %q1))))][switch(0, words(%q1),u(nomail, %q2), %q3, You do not have unread mail in your '%q2' mail folder., You have %q3 unread mail message(s) out of a total of [words(%q1)] in your '%q2' mail folder.)][switch(get(%q0/mail-in-progress),true, %b%b(Warning:%b Your mail in progress flag is set))]; @no %q0}}
&CHECK_MAIL_ALL_COMMAND #300=$+check mail/a*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER), {@pemit %# = u(not_player)}, strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))}, {@wait %q0 = {&debug_mail %q0 = +check mail/all; @dolist get(%q0/folder-list) = {@pemit %# = [setq(1, get(%q0/in-list-##))][setq(2, secure(##))][setq(3,switch(words(%q1), 0, 0, words(filter(mail_not_read, %q1))))][switch(0, words(%q1),,%q3,,You have %q3 unread message(s) out of [words(%q1)] in mail folder '%q2'.)]}; @swi 1 = 1, {@pemit %# = [switch(get(%q0/mail-in-progress),true, %b%b(Warning:%b Your mail in progress flag is set))]; @no %q0}}}
&MAIL_NOT_READ #4167 = strmatch(get(%q0/in-%0-time_read), 0)
&SKIM_COMMAND #300=$+skim*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)),{@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +skim%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, u(get_folder_current_letter, %q0))][setq(3, u(grab_timeout_value, get(%q0/message_timeout), get(%vm/default_timeout_option)))][setq(9, u(get_format_option, get(%#/mail_config_options)))]1 = eq(words(%q1), 0), {@pemit %# = [u(nomail, u(get_active_folder, %q0))][switch(get(%q0/mail-in-progress), true,%b(Warning:%b Your mail in progress flag is set))]; @no %q0},eq(words(%0), 0),{@pemit %# = [switch(%q9, standard,{[u(equal_line)]%r%r[space(27)]List of Mail Messages%r%r})][space(9)]Sender[space(12)]Subject[space(22)]Size%b%bReceived%r[space(9)]------[space(12)]-------[space(22)]----%b%b--------; @dolist %q1 ={@pemit %# = ulocal(skim_bulk, %#, ##, %q0, %q1, %q2, %q3, u(get_src_dbref, %q0, ##), u(get_src_num, %q0, ##))};@swi 1 = 1,{@pemit %# =[setq(1, u(get_active_folder, %q0))][setq(2, squish(remove(remove(get(%q0/folder-list), edit(%q1, %b, $)), null)))]%rSelected folder:%b%b%q1[switch(words(%q2), 0,, %rOther folders:%b%b[u(secure_names, %q2)])][switch(%q9, standard,%r%r[u(equal_line)])]; @no %q0}},{@swi/first [setq(4, ulocal(expand_letter_range, %0, %q1, u(get_folder_current_letter, %q0)))]1 = strmatch(%q4, *ABORT*),{@pemit %# = after(before(%q4, ENDABORT), ABORT); @no %q0},eq(words(%q4), 0),{@pemit %# = u(no_match, +skim, ulocal(format_request, trim(%0)), u(get_active_folder, %q0)); @no %q0},{@pemit %# = [switch(%q9, standard,{[u(equal_line)]%r%r[space(27)]List of Mail Messages%r%r})][space(9)]Sender[space(12)]Subject[space(22)]Size%b%bReceived%r[space(9)]------[space(12)]-------[space(22)]----%b%b--------; @dolist [setq(4, u(filter_list, setunion(%q4, ), %q1))]%q4 = {@pemit %# = ulocal(skim_bulk, %#, ##, %q0, %q1, %q2, %q3, u(get_src_dbref, %q0, ##), u(get_src_num, %q0, ##))};@swi 1 = 1,{@pemit %# = [setq(1, u(get_active_folder, %q0))][setq(2, squish(remove(remove(get(%q0/folder-list), edit(%q1, %b, $)), null)))]%rSelected folder:%b%b%q1[switch(words(%q2), 0,, %rOther folders:%b%b[u(secure_names, %q2)])][switch(%q9, standard,%r%r[u(equal_line)])]; @no %q0}}}}}
&SKIM_BULK #4167=[setq(4, get(%2/in-%1-flags))][setq(5, member(%3, %1))][setq(6, default(%6/out-%7-sender, get(%6/owner_dbref)))][setq(6, switch(type(%q6), PLAYER, name(%q6), destroyed player))][setq(7, trim(get(%6/out-%7-subject)))][setq(8, get(%2/in-%1-time_read))][switch(%1, %4, +, %b)][switch([gt(match(%q4, m), 0)]+[gt(match(%q4, d), 0)]+[gt(match(%q4, s), 0)]+[gt(match(%q4, f), 0)]+%q8+[gte(sub(secs(), switch(%q8, 0, convtime(get(%6/out-%7-time_sent)), convtime(%q8))), div(%5, 2))], 1+*+*+*+*+*, M, *+1+*+*+*+*, D, *+*+1+*+*+*, S, 0+0+0+*+*+1, T, 0+0+0+*+0+*, U, *+*+*+1+*+*, F, %b)][switch(hasattr(%2, in-%1-note), 0, %b, n)][rjust(%q5\)%b%b, 6)][ljust(mid(%q6, 0, min(16, strlen(%q6))), 18)][ljust(mid(%q7, 0, min(27, strlen(%q7))), 29)][ljust(strlen(u(%6/out-%7-text)), 6)][mid(get(%6/out-%7-time_sent), 0, 16)]
&READ_COMMAND #300=$+read*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)),{@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +read%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, u(get_active_folder, %q0))][setq(9, u(get_format_option, get(%#/mail_config_options)))]0 = words(%q1), {@pemit %# = [u(nomail, %q2)][switch(get(%q0/mail-in-progress), true,%b(Warning:%b Your mail in progress flag is set))]; @no %q0},strlen(%0), {@pemit %# = [setq(3, switch(words(%q1), 0, 0, words(filter(mail_not_read, %q1))))][switch([words(%q1)]+%q3, 0+*, u(nomail, %q2), *+0,You do not have unread mail in your '%q2' mail folder., You have %q3 unread mail message(s) out of a total of [words(%q1)] in your '%q2' mail folder.)][switch(get(%q0/mail-in-progress),true, %b%b(Warning:%b Your mail in progress flag is set))]; @no %q0},{@swi/first [setq(3, ulocal(expand_letter_range,%0,%q1, u(get_folder_current_letter, %q0)))]1 = strmatch(%q3, *ABORT*),{@pemit %# = after(before(%q3, ENDABORT), ABORT); @no %q0},eq(words(%q3), 0),{@pemit %# = u(no_match, +read, ulocal(format_request, trim(%0)), %q2); @no %q0},{@dolist [setq(3, u(filter_list, setunion(%q3, ), %q1))][setq(4, u(grab_timeout_value, get(%q0/message_timeout), get(%vm/default_timeout_option)))]%q3 ={@pemit %# = ulocal(read_bulk, %#, %q2, ##, %q1, %q9, %q0, %q4, u(get_src_dbref, %q0, ##), u(get_src_num, %q0, ##)); @tr me/check_if_registered = %#, %q0, ##, u(get_src_dbref, %q0, ##), u(get_src_num, %q0, ##)}; @swi 1 = 1, {&[u(which_current_letter, %q0)] %q0 = last(%q3); @swi 1 = 1,{@no %q0}}}}}}
&READ_BULK #4167=[setq(5, match(%3, %2))][setq(6, get(%7/out-%8-cc))][setq(7, get(%5/in-%2-flags))][setq(8, get(%5/in-%2-time_read))][switch(%4, standard, {[u(equal_line)]%r})][ljust(Message:%b%b%q5/[words(%3)] in folder %1, 43)]Received:%b%b[get(%7/out-%8-time_sent)]%rFrom:[space(5)][setq(9, default(%7/out-%8-sender, get(%7/owner_dbref)))][switch(type(%q9), PLAYER, name(%q9), destroyed player)]%rTo:[space(7)][trim(get(%7/out-%8-to))][switch(words(%q6), 0,,%rCc:[space(7)][trim(%q6)])][switch(match(get(%7/out-%8-bcc-expanded), %0),0,,%rBcc:[space(6)][name(%0)])]%rSubject:%b%b[trim(get(%7/out-%8-subject))][switch(%q7, *A*,%b\( autoforwarded from [name(after(before(%q7, AEND), A))] \))][switch(words(setinter(%q7, RR P U R D S M F)), 0,, %rFlags:%b%b%b%b)][switch(match(%q7, u), 0,, [v(mail_flag_u)]%b%b)][switch(match(%q7, rr), 0,, [v(mail_flag_rr)]%b%b)][switch(match(%q7, r), 0,, [v(mail_flag_r)]%b%b)][switch(match(%q7, p), 0,, [v(mail_flag_p)]%b%b)][switch(match(%q7, d), 0,, [v(mail_flag_d)]%b%b)][switch(match(%q7, m), 0,, [v(mail_flag_m)]%b%b)][switch(match(%q7, s), 0,, [v(mail_flag_s)]%b%b)][switch(match(%q7, f), 0,, [v(mail_flag_f)]%b%b)][switch(%4, standard, {%r[u(dash_line)]%r%r},%rText:[space(5)])][u(%7/out-%8-text)][switch(hasattr(%5, in-%2-note), 1,{[switch(%4, standard, {%r%r[u(dash_line)]})]%rNote:[space(5)][get_eval(%5/in-%2-note)]})][switch(%4, standard, {%r%r[u(equal_line)]})]%rOptions:%b +add note=<text>, +delete, +forward, +move, +reply, +replyall, +save
&CHECK_IF_REGISTERED #4167=&in-%2-time_read %1 = [setq(6, get(%1/in-%2-time_read))]time(); @swi/first [setq(5, default(%3/out-%4-sender, get(%3/owner_dbref)))]1 = and(strmatch(%q6, 0), sign(match(get(%1/in-%2-flags), r))), {@tr me/store_letter = %1, Receipt Notification, name(%q5), %q5, , , , , , {[name(%0)] has read the message which had a subject line of "[trim(get(%3/out-%4-subject))]" which was originally sent by you on [get(%3/out-%4-time_sent)].}}
&UNREAD_COMMAND #300=$+unread*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +unread%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_letter_range, %0, %q1, u(get_folder_current_letter, %q0)))]1 = eq(words(%q1), 0), {@pemit %# = u(nomail, u(get_active_folder, %q0)); @no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},eq(words(%q2), 0),{@pemit %# = u(no_match, +unread, ulocal(format_request, trim(%0)), u(get_active_folder, %q0)); @no %q0},{@dolist [setq(2, u(filter_list, setunion(%q2, ), %q1))]%q2 ={&in-##-time_read %q0 = 0}; @swi 1 = 1, {&[u(which_current_letter, %q0)] %q0 = last(%q2); @pemit %# = Letter(s) [u(convert_nums, %q2, %q1)][ulocal(format_request, trim(%0))] marked as 'unread' in folder '[u(get_active_folder, %q0)]'.;@no %q0}}}}
&ADD_NOTE_COMMAND #300=$+add note to *=*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +add note to %0=%1; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_single_letter_range, trim(%0), %q1, u(get_folder_current_letter, %q0)))]1 = eq(words(%q1), 0), {@pemit %# = u(nomail, u(get_active_folder, %q0));@no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},eq(words(%q2), 0), {@pemit %# = u(no_match, +add note, ulocal(format_request, trim(%0)), u(get_active_folder, %q0)); @no %q0},{&in-%q2-note %q0 = u(clean_text, %1); &[u(which_current_letter, %q0)] %q0 = %q2;@pemit %# = Note [switch(words(%1), 0, removed from, added to)] message [u(convert_nums, %q2, %q1)][ulocal(format_request, trim(%0))] in folder '[u(get_active_folder, %q0)]'.;@no %q0}}}
&ADD_NOTE_2_COMMAND #300=$+add note=*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +add note=%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, u(get_folder_current_letter, %q0)))]1 = eq(words(%q1), 0), {@pemit %# = u(nomail, u(get_active_folder, %q0));@no %q0},{&in-%q2-note %q0 = u(clean_text, %0); @pemit %# = Note [switch(strlen(%0), 0, removed from, added to)] message [u(convert_nums, %q2, %q1)] (%bcurrent%b) in folder '[u(get_active_folder, %q0)]'.;@no %q0}}}
&ADD_NOTE #300 = $+add note: @pemit %# = The syntax is +add note to <number>=<text>.
&DELETE_COMMAND #300=$+delete*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +delete%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(6, u(get_delete_option, %#))][setq(2, ulocal(expand_letter_range, %0, %q1, u(get_folder_current_letter, %q0)))][setq(5, u(get_active_folder, %q0))]1 = eq(words(%q1), 0), {@pemit %# = u(nomail, %q5);@no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},eq(strlen(%q0), 0), {@pemit %# = u(no_match, +delete, ulocal(format_request, trim(%0)), %q5); @no %q0},{@dolist [setq(2, u(filter_list, setunion(%q2, ), %q1))][setq(3, squish(u(filter_list, setdiff(%q1, %q2), %q1)))][setq(3, switch(%q6, soft, last(%q2), switch(last(%q2), last(%q1), first(%q3), extract(%q1, add(match(%q1, last(%q2)), 1), 1))))][setq(4, u(convert_nums, %q2, %q1))]%q2 = {@swi/first %q6 = soft, {&in-##-flags %q0 = setunion(get(%q0/in-##-flags) D, )}, {@tr me/remove_letter = u(get_src_dbref, %q0, ##), u(get_src_num, %q0, ##), %#, %q0, ##, edit(%q5, %b, $), +delete*}}; @swi 1 = 1,{&current_letter-%q5 %q0 = %q3; @pemit %# = Message(s) %q4[ulocal(format_request, trim(%0))] [switch(u(get_delete_option, %#), hard, deleted from, marked for deletion in)] folder '%q5'.; @no %q0}}}}
&UNDELETE_COMMAND #300=$+undelete*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +undelete%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_letter_range, %0, %q1, u(get_folder_current_letter, %q0)))]1 = eq(words(%q1), 0), {@pemit %# = u(nomail, u(get_active_folder, %q0));@no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},eq(words(%q2), 0), {@pemit %# = u(no_match, +undelete, ulocal(format_request, trim(%0)), u(get_active_folder, %q0)); @no %q0},{@dolist [setq(2, u(filter_list, setunion(%q2, ), %q1))]%q2 = {&in-##-flags %q0 = squish(remove(get(%q0/in-##-flags), D))}; @swi 1 = 1, {&[u(which_current_letter, %q0)] %q0 = last(%q2); @pemit %# = 'Marked for deletion' flag(s) removed from message(s) [u(convert_nums, %q2, %q1)][ulocal(format_request, trim(%0))] in folder '[u(get_active_folder, %q0)]'.; @no %q0}}}}
&CLEAR_COMMAND #300=$+clear*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +clear%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_letter_range, %0, %q1, u(get_folder_current_letter, %q0)))][setq(5, u(get_active_folder, %q0))][setq(6, u(get_delete_option, %#))]1 = eq(words(%q1), 0), {@pemit %# = u(nomail, %q5);@no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},eq(strlen(%q0), 0), {@pemit %# = u(no_match, +clear, ulocal(format_request, trim(%0)), %q5); @no %q0},{@dolist [setq(2, u(filter_list, setunion(%q2, ), %q1))][setq(3, squish(u(filter_list, setdiff(%q1, %q2), %q1)))][setq(3, switch(%q6, soft, last(%q2), switch(last(%q2), last(%q1), first(%q3), extract(%q1, add(match(%q1, last(%q2)), 1), 1))))][setq(4, u(convert_nums, %q2, %q1))]%q2 = {@swi/first %q6 = soft, {&in-##-flags %q0 = setunion(get(%q0/in-##-flags) D, )}, {@tr me/remove_letter = u(get_src_dbref, %q0, ##), u(get_src_num, %q0, ##), %#, %q0, ##, edit(%q5, %b, $), +clear*}}; @swi 1 = 1,{&current_letter-%q5 %q0 = %q3; @pemit %# = Message(s) %q4[ulocal(format_request, trim(%0))] [switch(u(get_delete_option, %#), hard, cleared from, marked for deletion in)] folder '%q5'.; @no %q0}}}}
&FLUSH_COMMAND #300=$+flush: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strlen(%q0),{@pemit %# = There is no mail marked for deletion in folder '[ulocal(get_inbox, %#)]'.},{@wait %q0 = {&debug_mail %q0 = +flush; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(5, u(find_letters_to_flush, %q0, %q1))][setq(8, u(get_active_folder, %q0))][setq(9, squish(u(filter_list, setdiff(%q1, %q5), %q1)))][setq(9, switch(last(%q5), last(%q1), first(%q9), extract(%q1, add(member(%q1, last(%q5)), 1), 1)))]0 = words(%q1), {@pemit %# = There is no mail marked for deletion in folder '%q8'.;@no %q0},words(%q5), {@pemit %# = There is no mail marked for deletion in folder '%q8'.;@no %q0},{@dolist [setq(2, words(%q1))]setunion(%q5,) = {@tr me/remove_letter = u(get_src_dbref, %q0, ##), u(get_src_num, %q0, ##), %#, %q0, ##, edit(%q8, %b, $),+flush}; @swi 1 = 1, {@pemit %# = [setq(4, words(%q5))]All messages that were marked for deletion have been deleted from folder '%q8'. (%b%q4 deleted, [sub(%q2, %q4)] remain%b); &[u(which_current_letter, %q0)] %q0 = %q9; @no %q0}}}}
&FIND_LETTERS_TO_FLUSH #4167 = iter(%1, switch(member(get(%0/in-##-flags), D), 0,, ##))
&REPLY_COMMAND #300=$+reply*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = strmatch(%0, all*),,not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},strmatch(escape(%0), *[*), {@pemit %# = u(nofunc)},eq(strlen(%q0), 0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +reply%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_single_letter_range, trim(%0), %q1, u(get_folder_current_letter, %q0)))][setq(4, u(get_src_dbref, %q0, %q2))][setq(5, u(get_src_num, %q0, %q2))][setq(6, default(%q4/out-%q5-sender, get(%q4/owner_dbref)))]1 = strmatch(get(%q0/mail-in-progress), true),{@pemit %# = You are already in the middle of sending a message. You must complete that one before you reply to this one.; @no %q0},eq(words(%q1), 0), {@pemit %# = u(nomail, u(get_active_folder, %q0));@no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},eq(words(%q2), 0), {@pemit %# = u(no_match, +reply, ulocal(format_request, trim(%0)), u(get_active_folder, %q0)); @no %q0},not(strmatch(type(%q6), PLAYER)), {@pemit %# = Originator of letter [u(convert_nums, %q2, %q1)][ulocal(format_request, trim(%0))] in folder '[u(get_active_folder, %q0)]' is no longer a player.; @no %q0},{&[u(which_current_letter, %q0)] %q0 = %q2;&mail-in-progress %q0 = true; &mail-in-progress-to %q0 = name(%q6); &mail-in-progress-to-expanded %q0 = %q6; &mail-in-progress-subject %q0 = [setq(3, get(%q4/out-%q5-subject))]switch(mid(%q3, 0, 3), Re:, %q3, Re:%b%b%q3); @pemit %# = u(enter_msg); @no %q0}}}
&REPLYALL_COMMAND #300=$+replyall*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},strmatch(escape(%0), *[*), {@pemit %# = u(nofunc)},eq(strlen(%q0), 0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +replyall%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_single_letter_range, trim(%0), %q1, u(get_folder_current_letter, %q0)))][setq(4, u(get_src_dbref, %q0, %q2))][setq(5, u(get_src_num, %q0, %q2))]1 = strmatch(get(%q0/mail-in-progress), true),{@pemit %# = You are already in the middle of sending a message. You must complete that one before you reply to this one.; @no %q0},eq(words(%q1), 0),{@pemit %# = u(nomail, u(get_active_folder, %q0));@no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},eq(words(%q2), 0), {@pemit %# = u(no_match, +replyall, ulocal(format_request, trim(%0)), u(get_active_folder, %q0)); @no %q0},not(hasattr(%q4, out-%q5-replyall_to)), {@pemit %# = +replyall:%b%bUnable to perform this function on the specified letter[ulocal(format_request, trim(%0))] in folder '[u(get_active_folder, %q0)]'.;@no %q0},{&[u(which_current_letter, %q0)] %q0 = %q2;&mail-in-progress %q0 = true; &mail-in-progress-to %q0 = u(pretty_dist, get(%q4/out-%q5-replyall_to)); &mail-in-progress-to-expanded %q0 = get(%q4/out-%q5-replyall_to); &mail-in-progress-subject %q0 = [setq(3, get(%q4/out-%q5-subject))]switch(mid(%q3, 0, 3), Re:, %q3, Re:%b%b%q3); @pemit %# = u(enter_msg); @no %q0}}}
&INCLUDE_COMMAND #300=$+include*: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(9, switch(words(%0), 0, current, trim(%0)))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +include%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_single_letter_range, %q9, %q1, u(get_folder_current_letter, %q0)))]1 = eq(words(%q1), 0), {@pemit %# = u(nomail, u(get_active_folder, %q0));@no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},strmatch(get(%q0/mail-in-progress), false), {@pemit %# = u(not_writing_mail); @no %q0}, eq(words(%q2), 0), {@pemit %# = u(no_match, +include, ulocal(format_request, %q9), u(get_active_folder, %q0)); @no %q0},{&mail-in-progress-body %q0 = [setq(3, u(get_src_dbref, %q0, %q2))][setq(4, u(get_src_num, %q0, %q2))][setq(5, default(%q3/out-%q4-sender, get(%q3/owner_dbref)))][setq(5, switch(type(%q5), PLAYER, name(%q5), destroyed player))][setq(6, get(%q3/out-%q4-time_sent))][setq(7, edit(edit(get(%q3/out-%q4-text), v(newline),v(percent_r)), v(percent_r), [v(percent_r)]>%b))][setq(3, get(%q0/mail-in-progress-body))]%q3[switch(words(%q3), 0,, %r)]On %q6, %q5 wrote:[switch(1, gt(strlen(%q7), 3000),{[setq(8, wordpos(%q7, 1000))][setq(3, wordpos(%q7, 2000))][setq(4, wordpos(%q7, 3000))][u(format_include_text, 0, 76, extract(%q7, 1, sub(%q8, 1)))] [u(format_include_text, 0, 76, extract(%q7, %q8, sub(%q3, %q8)))];[u(format_include_text, 0, 76, extract(%q7, %q3, sub(%q4, %q3)))];[u(format_include_text, 0, 76, extract(%q7, %q4, add(sub(words(%q7), %q4), 1)))];},gt(strlen(%q7), 2000),{[setq(8, wordpos(%q7, 1000))][setq(3, wordpos(%q7, 2000))][u(format_include_text, 0, 76, extract(%q7, 1, sub(%q8, 1)))] [u(format_include_text, 0, 76, extract(%q7, %q8, sub(%q3, %q8)))];[u(format_include_text, 0, 76, extract(%q7, %q3, add(sub(words(%q7), %q3), 1)))];},gt(strlen(%q7), 1000),{[setq(8, wordpos(%q7, 1000))][u(format_include_text, 0, 76, extract(%q7, 1, %q8))] [u(format_include_text, 0, 76, extract(%q7, add(1, %q8), sub(words(%q7), %q8)))];},{ [u(format_include_text, 0, 76, %q7)]})]%r; @pemit %# = Message [u(convert_nums, %q2, %q1)][ulocal(format_request, %q9)] in folder '[u(get_active_folder, %q0)]' has been included.; @no %q0}}}
&FORMAT_INCLUDE_TEXT #4167=switch(gt(strlen(%2), sub(%1, %0)), 1, %r[space(%0)]>%b[setq(6, sub(wordpos(%2, sub(%1, %0)), 1))][switch(%q6, 0,{[setq(6, sub(%1, %0))][mid(%2, 0, %q6)][u(format_include_text, %0, %1, mid(%2, %q6, sub(strlen(%2), %q6)))]},{[setq(6, wordpos(%2, sub(%1, %0)))][extract(%2, 1, sub(%q6, 1))][u(format_include_text, %0, %1, extract(%2, %q6, add(sub(words(%2), %q6), 1)))]})], %r[space(%0)]>%b%2)
&FORWARD_MAIL #300=$+forward* to *: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},or(strmatch(escape(%0), *[*),strmatch(escape(%1), *[*)),{@pemit %# = u(nofunc)},eq(strlen(%q0), 0), {@pemit %# = u(nomail, ulocal(get_inbox))},{@wait %q0 = {&debug_mail %q0 = +forward%0 to %1; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_single_letter_range, trim(%0), %q1, u(get_folder_current_letter, %q0)))][setq(3, ulocal(identify_to_list, {%1}, %q0))][setq(7, get(%vm/global-mail-aliases))][setq(8, get(%q0/alias-list))][setq(4, u(get_aliases, {%1}, %q0, %q7, %q8))][setq(5, setunion(%q3 [ulocal(expand_aliases, %q4, %q0, %b, %q7, %q8)], ))][setq(6, [u(pretty_dist, %q4, %q0, %q8, %q7, %q3)])]0 = strlen(%1), {@pemit %# = You must specify a destination to forward this piece of mail to.; @no %q0},words(%q1),{@pemit %# = u(nomail, u(get_active_folder, %q0));@no %q0},not(strmatch(%q2, *ABORT*)), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},words(%q2), {@pemit %# = u(no_match, +forward, ulocal(format_request, trim(%0)), u(get_active_folder, %q0)); @no %q0},not(strmatch(%q3, *ABORT*)), {@pemit %# = secure(after(before(%q3, ENDABORT), ABORT)); @no %q0},{@tr me/store_letter =[setq(3, u(get_src_dbref, %q0, %q2))][setq(4, u(get_src_num, %q0, %q2))][setq(7, default(%q3/out-%q4-sender, get(%q3/owner_dbref)))][setq(8, get(%q3/out-%q4-subject))][setq(9, get(%q0/in-%q2-note))]%q0, switch(mid(%q8, 0, 4), Fwd:, %q8, Fwd:%b%b%q8), %q6, %q5, , , , , F, {Received from:%b%b[name(%q7)]%r[u(%q3/out-%q4-text)][switch(words(%q9),0,,%r%r[u(dash_line)]%r%N's comment section:%r%r%q9)]}; &[u(which_current_letter, %q0)] %q0 = %q2;@pemit %# = u(forward_notification, u(get_active_folder, %q0), [u(convert_nums, %q2, %q1)][ulocal(format_request, trim(%0))]); @no %q0}}}
&FORWARD_COMMAND #300=$+forward: @pemit %# = u(#13/forward_help)
&FORWARD_MAIL2 #300=$+forward *=*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},or(strmatch(escape(%0), *[*), strmatch(escape(%1), *[*)), {@pemit %# = u(nofunc)},eq(strlen(%q0), 0), {@pemit %# = u(nomail, ulocal(get_inbox))},{@wait %q0 = {&debug_mail %q0 = +forward %0=%1; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, ulocal(expand_single_letter_range, trim(%1), %q1, u(get_folder_current_letter, %q0)))][setq(3, ulocal(identify_to_list, {%0}, %q0))][setq(7, get(%vm/global-mail-aliases))][setq(8, get(%q0/alias-list))][setq(4, u(get_aliases, {%0}, %q0, %q7, %q8))][setq(5,setunion(%q3 [ulocal(expand_aliases, %q4, %q0, %b, %q7, %q8)], ))][setq(6,[u(pretty_dist, %q4, %q0, %q8, %q7, %q3)])]1 = eq(strlen(%0), 0), {@pemit %# = You must specify a destination to forward this pieceof mail to.;@no %q0},strmatch(get(%q0/mail-in-progress), true),{@pemit %# = You are already in the middle of sending a message. You must complete that one before you can forward another.; @no %q0},eq(words(%q1), 0), {@pemit %# = u(nomail, u(get_active_folder, %q0));@no %q0},strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},eq(words(%q2), 0), {@pemit %# = u(no_match, +forward, ulocal(format_request, trim(%1)), u(get_active_folder, %q0)); @no %q0},strmatch(%q3, *ABORT*),{@pemit %# = secure(after(before(%q3, ENDABORT), ABORT));@no %q0},{&[u(which_current_letter, %q0)] %q0 = %q2;&mail-in-progress %q0 = true; &mail-in-progress-to %q0 = %q6; &mail-in-progress-to-expanded %q0 = %q5; &mail-in-progress-flags %q0 = setunion(get(%q0/mail-in-progress-flags) F, );&mail-in-progress-body %q0 = [setq(9, u(get_src_dbref, %q0, %q2))]Received from:%b%b[name(get(%q9/owner_dbref))]%r[u(%q9/out-[u(get_src_num, %q0, %q2)]-text)]%r%r---- Below this line are comments added by %N ----%r; &mail-in-progress-subject %q0 = [setq(9, u(%q9/out-[u(get_src_num, %q0, %q2)]-subject))]switch(mid(%q9, 0, 4), Fwd:, %q9, Fwd:%b%b%q9); @pemit %# = You may now enter text to send along with the message to forward.; @no %q0}}}
&MARK_COMMAND #300=$+mark*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},strmatch(escape(%0), *[*), {@pemit %# = u(nofunc)},eq(strlen(%q0), 0),{@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +mark%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, u(get_folder_current_letter, %q0))][setq(3, u(get_active_folder, %q0))][setq(4, ulocal(expand_letter_range, %0, %q1, %q2))]0 = words(%q1), {@pemit %# = u(nomail, %q3);@no %q0},not(strmatch(%q4, *ABORT*)), {@pemit %# = after(before(%q4, ENDABORT), ABORT); @no %q0},words(%q4), {@pemit %# = u(no_match, +mark, ulocal(format_request, trim(%0)), %q3); @no %q0},{@dolist [setq(4, u(filter_list, setunion(%q4, ), %q1))]%q4 = {&in-##-flags %q0 = setunion(get(%q0/in-##-flags) M, )}; @swi 1 = 1,{&[u(which_current_letter, %q0)] %q0 = last(%q4); @pemit %# = Message(s) [u(convert_nums, %q4, %q1)][ulocal(format_request, trim(%0))] marked in folder '%q3'.; @no %q0}}}}
&UNMARK_COMMAND #300=$+unmark*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},strmatch(escape(%0), *[*), {@pemit %# = u(nofunc)},eq(strlen(%q0), 0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +unmark%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, u(get_folder_current_letter, %q0))][setq(3, u(get_active_folder, %q0))][setq(4, ulocal(expand_letter_range, %0, %q1, %q2))]0 = words(%q1), {@pemit %# = u(nomail, %q3);@no %q0},not(strmatch(%q4, *ABORT*)), {@pemit %# = after(before(%q4, ENDABORT), ABORT); @no %q0},words(%q4), {@pemit %# = u(no_match, +unmark, ulocal(format_request, trim(%0)), %q3); @no %q0},{@dolist [setq(4, u(filter_list, setunion(%q4, ), %q1))]%q4 = {&in-##-flags %q0 = squish(remove(get(%q0/in-##-flags), M))}; @swi 1 = 1,{&[u(which_current_letter, %q0)] %q0 = last(%q4); @pemit %# = Mark(s) removed from message(s) [u(convert_nums, %q4, %q1)][ulocal(format_request, trim(%0))] in folder '%q3'.; @no %q0}}}}
&SAVE_COMMAND #300=$+save*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},strmatch(get(%vm/default_save_option), disabled), {@pemit %# = I'm sorry, but the +save command has been disabled by the game administrators.},strmatch(escape(%0), *[*), {@pemit %# = u(nofunc)},eq(strlen(%q0), 0),{@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +save%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, u(get_folder_current_letter, %q0))][setq(3, u(get_active_folder, %q0))][setq(4, ulocal(expand_letter_range, %0, %q1, %q2))]0 = words(%q1), {@pemit %# = u(nomail, %q3);@no %q0},not(strmatch(%q4, *ABORT*)), {@pemit %# = after(before(%q4, ENDABORT), ABORT); @no %q0},words(%q4), {@pemit %# = u(no_match, +save, ulocal(format_request, trim(%0)), %q3); @no %q0},{@dolist [setq(4, u(filter_list, setunion(%q4, ), %q1))]%q4 = {&in-##-flags %q0 = setunion(get(%q0/in-##-flags) S, )}; @swi 1 = 1, {&[u(which_current_letter, %q0)] %q0 = last(%q4); @pemit %# = Message(s) [u(convert_nums, %q4, %q1)][ulocal(format_request, trim(%0))] marked as 'saved' in folder '%q3'.; @no %q0}}}}
&UNSAVE_COMMAND #300=$+unsave*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},strmatch(escape(%0), *[*), {@pemit %# = u(nofunc)},eq(strlen(%q0), 0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},{@wait %q0 = {&debug_mail %q0 = +unsave%0; @swi/first [setq(1, u(get_folder_in_list, %q0))][setq(2, u(get_folder_current_letter, %q0))][setq(3, ulocal(expand_letter_range, %0, %q1, %q2))][setq(4, u(get_active_folder, %q0))]0 = words(%q1), {@pemit %# = u(nomail, %q4);@no %q0},not(strmatch(%q3, *ABORT*)), {@pemit %# = after(before(%q3, ENDABORT), ABORT); @no %q0},words(%q3), {@pemit %# = u(no_match, +unsave, ulocal(format_request, trim(%0)), %q4); @no %q0},{@dolist [setq(3, u(filter_list, setunion(%q3, ), %q1))]%q3 = {&in-##-flags %q0 = squish(remove(get(%q0/in-##-flags), S))}; @swi 1 = 1,{&[u(which_current_letter, %q0)] %q0 = last(%q3); @pemit %# = The 'S' flag has been removed from message(s) [u(convert_nums, %q3, %q1)][ulocal(format_request, trim(%0))] in folder '%q4'.; @no %q0}}}}
&MAIL_COMMAND #300=$+mail *=*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = or(strmatch(escape(%0), *[*), strmatch(escape(%1), *[*)),{@pemit %# = u(nofunc)},not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},eq(strlen(%q0), 0), {@swi/first [setq(6, get(%vm/global-mail-aliases))][setq(1, ulocal(identify_to_list, {%0}, %vm))][setq(2, u(get_aliases, {%0}, #0, %q6, ))][setq(3, setunion(%q1 [ulocal(expand_aliases, %q2, #0, %b, %q6, )], ))]1 = strmatch(%q1, *ABORT*),{@pemit %# = secure(after(before(%q1, ENDABORT), ABORT))},eq(words(%q3), 0),{@pemit %# = You must specify a destination for this piece of mail.},{@create %N's Mailbox; @set [setq(4, con(me))]%q4 = quiet; @drain %q4; &debug_mail %q4 = +mail %0=%1; @tel %q4 = %vm; &mailbox_%# %vm = %q4; @tr %vm/add_mailbox = %q4; &owner_dbref %q4 = %#; @startup %q4 = {@drain me; @no me}; @set %q4 = safe; &current_folder %q4 = ulocal(get_inbox, %#); &folder-list %q4 = get(%q4/current_folder); &mail-in-progress %q4 = true; &mail-in-progress-to %q4 = u(pretty_dist, %q2, #0, , %q6, %q1); &mail-in-progress-to-expanded %q4 = %q3; &mail-in-progress-subject %q4 = %1; @pemit %# = u(enter_msg); @no %q4}},{@wait %q0 = {&debug_mail %q0 = +mail %0=%1; @swi/first [setq(1, ulocal(identify_to_list, {%0}, %q0))][setq(7, get(%q0/alias-list))][setq(6, get(%vm/global-mail-aliases))][setq(2, u(get_aliases, {%0}, %q0, %q6, %q7))]1 = strmatch(get(%q0/mail-in-progress), true),{@pemit %# = You are already in the middle of sending a message. %bYou must complete that one before you begin another.; @no %q0},eq(strlen(%0), 0),{@pemit %# = You must specify a destination for this piece of mail.; @no %q0},strmatch(%q1, *ABORT*),{@pemit %# = secure(after(before(%q1, ENDABORT), ABORT)); @no %q0},{&mail-in-progress %q0 = true; &mail-in-progress-to %q0 = u(pretty_dist, %q2, %q0, %q7, %q6, %q1); &mail-in-progress-to-expanded %q0 = %q1 [ulocal(expand_aliases, %q2, %q0, %b, %q6, %q7)]; &mail-in-progress-subject %q0 = %1; @swi/first hasattr(%q0, mail-in-progress-to-expanded) = 0,{@pemit %# = You must specify a destination for this piece of mail.; &mail-in-progress %q0 = false; &mail-in-progress-to %q0 = ; &mail-in-progress-to-expanded %q0 = ; &mail-in-progress-subject %q0 = ; @no %q0},{@pemit %# = u(enter_msg); @no %q0}}}}
&MAIL_NO_PARAM #300 = $+mail: @pemit %# = You must specify the name(s) of the individual(s) that you wish to send mail to, and an optional 'subject' line.%b (format: +mail <name1 name2 .. nameN>=<Subject line>)
&NOTE_COMMAND #300 = $+note*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strlen(%0), {@pemit %# = No text specified for note.%b Syntax:%b +note <text>},strlen(%q0), {@create %N's Mailbox;@set [setq(0, con(me))]%q0 = quiet;@drain %q0;&debug_mail %q0 = +note%0; @no %q0;@tel %q0 = %vm;&mailbox_%# %vm = %q0;@tr %vm/add_mailbox = %q0; &owner_dbref %q0 = %#;@startup %q0 = {@drain me; @no me};@set %q0 = safe;&mail-in-progress %q0 = false;&current_folder %q0 = ulocal(get_inbox, %#);&folder-list %q0 = get(%q0/current_folder); @tr me/store_letter = %q0, Personal Note, %N, %#, , , , , , u(clean_text, %0); @pemit %# = A personal note has been stored in your mailbox.},{@tr me/store_letter = %q0, Personal Note, %N, %#, , , , , , u(clean_text, %0); @pemit %# = A personal note has been stored in your mailbox.}
&DASH_COMMAND #300=$-*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = strmatch(%0, -),,not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},eq(strlen(%q0), 0),{@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = -%0; @swi/first [setq(4, get(%q0/mail-in-progress-body))]1 = strmatch(get(%q0/mail-in-progress), false),{@pemit %# = u(not_writing_mail); @no %q0},eq(words(escape(%0)), 0),{@pemit %# = Options:%r%r%b%b[ljust(-, 40)] ( show this help display )%r%b%b[ljust(-<text>, 40)] ( add text to the message )%r%b%b[ljust(+proof, 40)] ( proofread the message )%r%b%b[ljust(+send, 40)] ( send the message )%r%b%b[ljust(--, 40)] ( same as +send )%r%b%b[ljust(+toss, 40)] ( discard the message )%r%b%b[ljust(+include \[<letter number or keyword>\], 40)] ( include letter into text )%r%b%b[ljust(+cc <list of people or aliases>, 40)] ( set carbon copy list )%r%b%b[ljust(+bcc <list of people or aliases>, 40)] ( set blind carbon copy list )%r%r%b%b[ljust(+edit <mail part>=<old>/<new>, 40)] ( edit your message )%r%b%b%b%b(where mail part = to, cc, bcc, subject or text)%r%r%b%b[ljust(+set mail flag \[!\]<flag>, 40)] ( set or clear mail flag )%r%b%b%b%b(where flag = urgent, private, registered, or reply requested); @no %q0},{&mail-in-progress-body %q0 = u(clean_text, switch(words(%q4), 0, %0, %q4[u(get_separator_option, %#)]%0)); @pemit %# = [setq(1, u(size_of_mail_in_progress, %q0))][u(text_added_notification)][switch(gt(%q1, 4000), 1, %b%bWarning, message is [sub(4000, %q1)] characters too long and will be truncated.,)]; @no %q0}}}
&CLEAN_TEXT #4167=edit(escape(edit(edit(%0, \\,), v(newline), v(percent_r))), [v(backslash)][v(percent_r)],[v(percent_r)])
&BACKSLASH #4167=\
&SIZE_OF_MAIL_IN_PROGRESS #4167 =add(196, mul(strlen(u(equal_line)), 2), strlen(u(dash_line)), strlen(u(%0/mail-in-progress-subject)), strlen(u(%0/mail-in-progress-to)), switch(strlen(get(%0/mail-in-progress-cc)), 0, 0, {[add(11, strlen(u(%0/mail-in-progress-cc)))]}), switch(strlen(get(%0/mail-in-progress-bcc)), 0, 0, {[add(11, strlen(u(%0/mail-in-progress-bcc)))]}), strlen(u(%0/mail-in-progress-body)), [setq(2, get(%0/mail-in-progress-flags))]switch(words(%q2), 0, 0, {[add(11, switch(match(%q2, RR), 0, 0, strlen(v(mail_flag_rr))), switch(match(%q2, P), 0, 0, strlen(v(mail_flag_p))), switch(match(%q2, U), 0, 0, strlen(v(mail_flag_u))), switch(match(%q2, R), 0, 0, strlen(v(mail_flag_r))), mul(sub(words(%q2), 1), 2))]}))
&DOUBLE_DASH_COMMAND #300=$--: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strlen(%q0),{@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = --; @swi/first [setq(1, u(get_final_delivery_list, %q0))]1 = strmatch(get(%q0/mail-in-progress), false), {@pemit %# = You do not have a mail message ready to send.; @no %q0},eq(words(%q1), 0), { @pemit %# = You do not have a destination specified.; @no %q0},{@tr me/store_letter = %q0, get(%q0/mail-in-progress-subject), get(%q0/mail-in-progress-to), get(%q0/mail-in-progress-to-expanded), get(%q0/mail-in-progress-cc), get(%q0/mail-in-progress-cc-expanded), get(%q0/mail-in-progress-bcc), get(%q0/mail-in-progress-bcc-expanded), get(%q0/mail-in-progress-flags), get(%q0/mail-in-progress-body); @tr me/cleanup_send = %#, %q0}}}
&STORE_LETTER #4167 = &[setq(0, u(free_num, get(%0/out-list)))]out-%q0-time_sent %0 = time(); &[setq(3, get(%0/owner_dbref))]out-%q0-subject %0 = %1; &out-list %0 = [get(%0/out-list)] %q0; &out-list-current %0 = switch(words(get(%0/out-list)), 1, %q0, get(%0/out-list-current)); &out-%q0-to %0 = %2; &out-%q0-cc %0 = %4; &out-%q0-bcc %0 = %6; &out-%q0-bcc-expanded %0 = %7; &out-%q0-text %0 = %9[switch([setq(4, get(%q3/MAIL_SIG))]strlen(%q4), 0,, %r%q4)]; &out-%q0-replyall_to %0 = setunion(%q3 %3 %5, ); &out-%q0-held %0 = [setq(8, setunion(iter(setunion(%3 %5 %7, ), ulocal(autoforward_test, ##)), ))]%q8; &out-%q0-dist %0 = iter(%q8, ##:); @dolist %q8 = {@swi/first [setq(1, get(%vm/mailbox_##))][setq(9, u(folder_to_store_into, %q1, get(%0/owner_dbref), %1, ##))]1 = and(strmatch(type(##), PLAYER), eq(strlen(%q1), 0)),{@create [name(##)]'s Mailbox; @set [setq(2, con(me))]%q2 = quiet; @drain %q2; &debug_mail %q2 = store_letter; @tel %q2 = %vm; &mailbox_## %vm = %q2; @tr %vm/add_mailbox = %q2; &owner_dbref %q2 = ##; @startup %q2 = {@drain me; @no me}; @set %q2 = safe; &mail-in-progress %q2 = false; &current_folder %q2 = %q9; &folder-list %q2 = %q9; &in-list-%q9 %q2 = 0; &current_letter-%q9 %q2 = 0; &in-0-time_read %q2 = 0; &in-0-flags %q2 = %8; &in-0-note %q2 = ; &in-0-location %q2 = %0 %q0; @edit %0/out-%q0-dist = ##:,##:0; @pemit ## = switch(%1, Personal Note,, {u(delivery_notification, %q3, sign(match(%8, u)),sign(match(%8, p)),sign(match(%8, rr)),sign(match(%8, r)), secure(%q9))}); @no %q2}, strmatch(type(##), PLAYER), {&folder-list %q1 = setunion(%q9 [get(%q1/folder-list)], ); &in-list-%q9 %q1 = [setq(6, u(free_num, u(get_all_in_lists, %q1)))][setq(7, get(%q1/in-list-%q9))]squish(%q7 %q6); &current_letter-%q9 %q1 = switch(words(%q7), 0, %q6, get(%q1/current_letter-%q9)); &in-%q6-time_read %q1 = 0; &in-%q6-flags %q1 = %8; &in-%q6-note %q1 = ; &in-%q6-location %q1 = %0 %q0; @edit %0/out-%q0-dist = ##:,##:%q6; @pemit ## = switch(1, strmatch(%1, Personal Note),, hasattr(%q1, reject_msg),, {u(delivery_notification, %q3, sign(match(%8, u)),sign(match(%8, p)),sign(match(%8, rr)),sign(match(%8, r)), secure(%q9))}); @swi/first 1 = strmatch(%1, On Vacation),,strmatch(%1, Letter Rejected),,and(strmatch(%q9, null), hasattr(%q1, filter_reject)),{@tr me/remove_letter =%0, %q0, get(%q1/owner_dbref), %q1, %q6, %q9, discard;@tr me/store_letter =%q1,Letter Rejected,name(get(%0/owner_dbref)),get(%0/owner_dbref),,,,,,{Message with subject line "%1" has been rejected by [name(get(%0/owner_dbref))]'s mailbox.%r%r----- Reject Message -----%r%r[get(%q1/filter_reject)]}; @pemit ## = Discarded due to personal mail filter.},strmatch(%q9, null),{@tr me/remove_letter = %0, %q0, get(%q1/owner_dbref), %q1, %q6, %q9,discard; @pemit ## = Discarded due to personal mail filter. },hasattr(%q1, reject_msg), {@tr me/remove_letter = %0, %q0, get(%q1/owner_dbref), %q1, %q6, %q9,reject; @tr me/store_letter = %q1, Letter Rejected, name(get(%0/owner_dbref)), get(%0/owner_dbref), , , , , , {Message with subject line "%1" has been rejected by [name(get(%0/owner_dbref))]'s mailbox.%r%r----- Reject Message -----%r%r[get(%q1/reject_msg)]}},hasattr(%q1, vacation), {@tr me/store_letter = %q1, On Vacation, name(get(%0/owner_dbref)), get(%0/owner_dbref), , , , , , {Message with subject line "%1" has been stored in [name(get(%0/owner_dbref))]'s mailbox.%r%r----- Vacation Message -----%r%r[get(%q1/vacation)]}}}, {@pemit get(%0/owner_dbref) = Unable to deliver message.} }
&REMOVE_LETTER #4167 = &[setq(4, trim(%4))][setq(1, trim(%1))]in-list-%5 %3 = squish(remove(get(%3/in-list-%5), %q4)); @wipe %3/in-%q4-*; &out-%q1-held %0 = squish(remove(get(%0/out-%q1-held), %2)); @swi get(%0/out-%q1-held) = ,{@wipe %0/out-%q1-*; &out-list %0 = squish(remove(get(%0/out-list), %q1)); &out-list-current %0 = switch(member(get(%0/out-list), get(%0/out-list-current)), 0, last(get(%0/out-list)), get(%0/out-list-current)); @swi 1 = u(ok_to_dest_mailbox, %0),{@tr %vm/destroy_mailbox = get(%0/owner_dbref), num(me), %0, remove_letter_a} }; @swi 1 = u(ok_to_dest_mailbox, %3),{@tr %vm/destroy_mailbox = get(%3/owner_dbref), num(me), %3, remove_letter_b}
&PROOF_COMMAND #300=$+proof: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strlen(%q0),{@pemit %# = You are not currently writing a mail message.},{@wait %q0 = {&debug_mail %q0 = +proof; @pemit %# = switch(get(%q0/mail-in-progress),false, You are not currently writing a mail message.,{[setq(1, get(%q0/mail-in-progress-cc))][setq(2, get(%q0/mail-in-progress-bcc))][setq(3, get(%q0/mail-in-progress-flags))][setq(4, u(get_format_option, get(%#/mail_config_options)))][switch(%q4, standard, {[u(equal_line)]%r})]To:[space(7)][trim(get(%q0/mail-in-progress-to))][switch(words(%q1), 0,, %rCc:[space(7)][trim(%q1)])][switch(words(%q2), 0,, %rBcc:[space(6)][trim(%q2)])]%rSubject:%b%b[trim(get(%q0/mail-in-progress-subject))][switch(words(%q3), 0,, %rFlags:%b%b%b%b)][switch(match(%q3, u), 0,, [v(mail_flag_u)]%b%b)][switch(match(%q3, rr), 0,, [v(mail_flag_rr)]%b%b)][switch(match(%q3, r), 0,, [v(mail_flag_r)]%b%b)][switch(match(%q3, p), 0,, [v(mail_flag_p)]%b%b)][switch(%q4, standard, {%r[u(dash_line)]%r%r},%rText:[space(5)])][get_eval(%q0/mail-in-progress-body)][switch(%q4, standard, {%r%r[u(equal_line)]})]%r[u(finish_msg)]}); @swi and(v(spell_checker_available), hasflag(v(spell_checker), connect), strmatch(get(%q0/mail-in-progress), true)) = 1,{@pemit v(spell_checker) = StartSpelling %# 0 0 subject 0; @pemit v(spell_checker) = get(%q0/mail-in-progress-subject); @pemit v(spell_checker) = StopSpelling; @pemit v(spell_checker) = StartSpelling %# 0 0 text 0; @pemit v(spell_checker) = get(%q0/mail-in-progress-body); @pemit v(spell_checker) = StopSpelling}; @no %q0}}
&TOSS_COMMAND #300=$+toss: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strlen(%q0),{@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +toss; @swi/first get(%q0/mail-in-progress) = false,{@pemit %# = u(not_writing_mail); @no %q0},{@pemit %# = The mail message has been discarded.; &mail-in-progress %q0 = false; &mail-in-progress-subject %q0; &mail-in-progress-to %q0; &mail-in-progress-to-expanded %q0; &mail-in-progress-cc %q0; &mail-in-progress-cc-expanded %q0; &mail-in-progress-bcc %q0; &mail-in-progress-bcc-expanded %q0; &mail-in-progress-flags %q0; &mail-in-progress-body %q0; @swi/first 1 = u(ok_to_dest_mailbox, %q0),{@tr %vm/destroy_mailbox = %#, num(me), %q0, +toss; @no %q0},{@no %q0}}}}
&CC_COMMAND #300=$+cc*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +cc%0; @swi/first [setq(1, ulocal(identify_to_list, {%0}, %q0))][setq(2, get(%vm/global-mail-aliases))][setq(3, get(%q0/alias-list))][setq(4, u(get_aliases, {%0}, %q0, %q2, %q3))]1 = strmatch(get(%q0/mail-in-progress), false),{@pemit %# = u(not_writing_mail); @no %q0},strmatch(%q1, *ABORT*),{@pemit %# = secure(after(before(%q1, ENDABORT), ABORT)); @no %q0},{&mail-in-progress-cc %q0 = u(pretty_dist, %q4, %q0, %q3, %q2, %q1); &mail-in-progress-cc-expanded %q0 = setunion(%q1 [ulocal(expand_aliases, %q4, %q0, %b, %q2, %q3)], ); @pemit %# = switch(hasattr(%q0, mail-in-progress-cc-expanded), 0, No carbon copy (cc) set., The carbon copy (cc) line now reads:%b%b[get(%q0/mail-in-progress-cc)]); @no %q0}}}
&CC_NO_PARAM #300=$+cc: @pemit %# = You must specify the name of the individual(s) that you wish to be carbon copied on this piece of mail.
&EDIT_MAIL_CC #300=$+edit cc*=*/*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%2), *[*)),{@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +edit cc%0=%1/%2; @swi/first [setq(1, lcstr(trim(%1)))][setq(2, trim(%2))][setq(3, lcstr(get(%q0/mail-in-progress-cc)))]1 = strmatch(get(%q0/mail-in-progress), false), {@pemit %# = u(not_writing_mail); @no %q0},not(hasattr(%q0, mail-in-progress-cc)),{@swi/first or(strmatch(%q1, $), strmatch(%q1, ^), eq(strlen(%q1), 0)) = 1, {@tr me/cleanup_edit_mail_cc = %#, u(clean_dist, %q2), %q0},{@pemit %# = Unable to find '%q1' in current value for CC.; @no %q0}},strmatch(%q1, $), {@tr me/cleanup_edit_mail_cc = %#, u(clean_dist, {%q3, %q2}), %q0},strmatch(%q1, ^), {@tr me/cleanup_edit_mail_cc = %#, u(clean_dist, {%q2, %q3}), %q0},strmatch(%q3, *%q1*),{@tr me/cleanup_edit_mail_cc = %#, u(clean_dist, edit(%q3, %q1, %q2)), %q0},{@pemit %# = Unable to find '%q1' in current value for CC.%b Please check the exact format of the current value for CC by doing a +proof.; @no %q0}}}
&CLEAN_DIST #4167 = squish(remove(edit(edit(%0, \(personal mail alias\), ), \(global mail alias\), ), and))
&CLEANUP_EDIT_MAIL_CC #4167=@swi/first [setq(1, ulocal(identify_to_list, {%1}, %2))][setq(2, get(%vm/global-mail-aliases))][setq(3, get(%2/alias-list))][setq(4, u(get_aliases, {%1}, %2, %q2, %q3))]%q1 = *ABORT*, {@pemit %0 = secure(after(before(%q1, ENDABORT), ABORT)); @no %2},{&mail-in-progress-cc %2 = u(pretty_dist, %q4, %2, %q3, %q2, %q1); &mail-in-progress-cc-expanded %2 = setunion(%q1 [ulocal(expand_aliases, %q4, %2, %b, %q2, %q3)], ); @swi/first words(get(%2/mail-in-progress-cc-expanded)) = 0,{@pemit %0 = No carbon copy set.; @no %2},{@pemit %0 = The carbon copy (cc) line now reads:%b%b[get(%2/mail-in-progress-cc)]; @no %2}}
&edit_cc_blank #300 = $+edit cc: @pemit %# = The syntax is +edit cc=<old text>/<new text>.
&BCC_COMMAND #300=$+bcc*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +bcc%0; @swi/first [setq(1, ulocal(identify_to_list, {%0}, %q0))][setq(2, get(%vm/global-mail-aliases))][setq(3, get(%q0/alias-list))][setq(4, u(get_aliases, {%0}, %q0, %q2, %q3))]1 = strmatch(get(%q0/mail-in-progress), false),{@pemit %# = u(not_writing_mail); @no %q0},strmatch(%q1, *ABORT*),{@pemit %# = secure(after(before(%q1, ENDABORT), ABORT)); @no %q0},{&mail-in-progress-bcc %q0 = u(pretty_dist, %q4, %q0, %q3, %q2, %q1); &mail-in-progress-bcc-expanded %q0 = setunion(%q1 [ulocal(expand_aliases, %q4, %q0, %b, %q2, %q3)], ); @pemit %# = switch(hasattr(%q0, mail-in-progress-bcc-expanded), 0,No blind carbon copy (bcc) set.,The blind carbon copy (bcc) line now reads:%b%b[get(%q0/mail-in-progress-bcc)]); @no %q0}}}
&BCC_NO_PARAM #300=$+bcc: @pemit %# = You must specify the name of the individual(s) that you wish to be blind carbon copied on this piece of mail.
&EDIT_MAIL_BCC #300=$+edit bcc*=*/*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%2), *[*)),{@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +edit bcc%0=%1/%2; @swi/first [setq(1, lcstr(trim(%1)))][setq(2, trim(%2))][setq(3, lcstr(get(%q0/mail-in-progress-bcc)))]1 = strmatch(get(%q0/mail-in-progress), false), {@pemit %# = u(not_writing_mail); @no %q0},not(hasattr(%q0, mail-in-progress-bcc)),{@swi/first or(strmatch(%q1, $), strmatch(%q1, ^), eq(strlen(%q1), 0)) = 1, {@tr me/cleanup_edit_mail_bcc = %#, u(clean_dist, %q2), %q0},{@pemit %# = Unable to find '%q1' in current value for BCC.; @no %q0}},strmatch(%q1, $),{@tr me/cleanup_edit_mail_bcc = %#, u(clean_dist, {%q3, %q2}), %q0},strmatch(%q1, ^),{@tr me/cleanup_edit_mail_bcc = %#, u(clean_dist, {%q2, %q3}), %q0},strmatch(%q3, *%q1*),{@tr me/cleanup_edit_mail_bcc = %#, u(clean_dist, edit(%q3, %q1, %q2)), %q0},{@pemit %# = Unable to find '%q1' in current value for BCC.%b Please check the exact format of the current value for CC bydoing a +proof.; @no %q0}}}
&CLEANUP_EDIT_MAIL_BCC #4167=@swi/first [setq(1, ulocal(identify_to_list, {%1}, %2))][setq(2, get(%vm/global-mail-aliases))][setq(3, get(%2/alias-list))][setq(4, u(get_aliases, {%1}, %2, %q2, %q3))]%q1 = *ABORT*,{@pemit %0 = secure(after(before(%q1, ENDABORT), ABORT)); @no %2},{&mail-in-progress-bcc %2 = u(pretty_dist, %q4, %2, %q3, %q2, %q1); &mail-in-progress-bcc-expanded %2 = %q1 [ulocal(expand_aliases, %q4, %2, %b, %q2, %q3)]; @swi/first words(get(%2/mail-in-progress-bcc-expanded)) = 0,{@pemit %0 = No blind carbon copy set.; @no %2},{@pemit %0 = The blind carbon copy (bcc) line now reads:%b%b[get(%2/mail-in-progress-bcc)]; @no %2}}
&EDIT_BCC_BLANK #300 =$+edit bcc: @pemit %# = The syntax is +edit bcc=<old text>/<new text>.
&EDIT_MAIL_TO #300=$+edit to*=*/*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%2), *[*)),{@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +edit to%0=%1/%2; @swi/first [setq(1, lcstr(trim(%1)))][setq(2, trim(%2))][setq(3, lcstr(get(%q0/mail-in-progress-to)))]1 = strmatch(get(%q0/mail-in-progress), false),{@pemit %# = u(not_writing_mail); @no %q0},not(hasattr(%q0, mail-in-progress-to)),{@swi/first or(strmatch(%q1, $), strmatch(%q1, ^), eq(strlen(%q1), 0)) = 1, {@tr me/cleanup_edit_mail_to = %#, u(clean_dist, %q2), %q0},{@pemit %# = Unable to find '%q1' in current value for TO.; @no %q0}},strmatch(%q1, $),{@tr me/cleanup_edit_mail_to = %#, u(clean_dist, {%q3, %q2}), %q0},strmatch(%q1, ^),{@tr me/cleanup_edit_mail_to = %#, u(clean_dist, {%q2, %q3}), %q0},strmatch(%q3, *%q1*),{@tr me/cleanup_edit_mail_to = %#, u(clean_dist, edit(%q3,%q1, %q2)), %q0},{@pemit %# = Unable to find '%q1' in current value for TO.%b Please check the exact format of the current value for TO bydoing a +proof.; @no %q0}}}
&CLEANUP_EDIT_MAIL_TO #4167=@swi/first [setq(1, ulocal(identify_to_list, {%1}, %2))][setq(2, get(%vm/global-mail-aliases))][setq(3, get(%2/alias-list))][setq(4, u(get_aliases, {%1}, %2, %q2, %q3))]%q1 = *ABORT*, {@pemit %0 = secure(after(before(%q1, ENDABORT), ABORT)); @no %2},{&mail-in-progress-to %2 = u(pretty_dist, %q4, %2, %q3, %q2, %q1); &mail-in-progress-to-expanded %2 = %q1 [ulocal(expand_aliases, %q4, %2, %b, %q2, %q3)]; @swi/first words(get(%2/mail-in-progress-to-expanded)) = 0,{@pemit %0 = No destination set.; @no %2},{@pemit %0 = The 'TO' line now reads:%b%b[get(%2/mail-in-progress-to)]; @no %2}}
&EDIT_TO_BLANK #300 = $+edit to: @pemit %# = The syntax is +edit to=<old text>/<new text>.
&EDIT_MAIL_SUBJECT #300=$+edit sub*=*/*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%2), *[*)),{@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +edit sub%0=%1/%2; @swi/first [setq(1, squish(u(clean_text, %1)))][setq(2, squish(u(clean_text, %2)))]1 = strmatch(get(%q0/mail-in-progress), false),{@pemit %# = u(not_writing_mail); @no %q0},not(hasattr(%q0, mail-in-progress-subject)),{@swi/first or(strmatch(%q1, $), strmatch(%q1, ^), eq(words(%q1), 0)) = 1, {&mail-in-progress-subject %q0 = %q2; @pemit %# = The subject line now reads:%b%b[get_eval(%q0/mail-in-progress-subject)]; @no %q0},{@pemit %# = Unable to find '%q1' in current value for SUBJECT.; @no %q0}},strmatch(%q1, $),{@edit %q0/mail-in-progress-subject = %q1, {%q2}; @pemit %# = The subject line now reads:%b%b[get_eval(%q0/mail-in-progress-subject)]; @no %q0},strmatch(%q1, ^),{@edit %q0/mail-in-progress-subject = %q1, {%q2}; @pemit %# = The subject line now reads:%b%b[get_eval(%q0/mail-in-progress-subject)]; @no %q0},strmatch(get(%q0/mail-in-progress-subject), *%q1*), {@edit %q0/mail-in-progress-subject = {%q1}, {%q2}; @pemit %# = The subject line now reads:%b%b[get_eval(%q0/mail-in-progress-subject)]; @no %q0},{@pemit %# = Unable to find '%q1' in current value for SUBJECT.; @no %q0}}}
&EDIT_SUBJECT_BLANK #300=$+edit subject: @pemit %# = The syntax is +edit subject=<old text>/<new text>.
&EDIT_MAIL_TEXT #300=$+edit text*=*/*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strlen(%q0),{@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +edit text%0=%1/%2; @swi/first [setq(1, squish(u(clean_text, %1)))][setq(2, squish(u(clean_text, %2)))]1 = strmatch(get(%q0/mail-in-progress), false),{@pemit %# = u(not_writing_mail); @no %q0}, not(hasattr(%q0, mail-in-progress-body)), {@swi/first or(strmatch(%q1, $), strmatch(%q1, ^), eq(words(%q1), 0)) = 1, {&mail-in-progress-body %q0 = %q2; @tr me/cleanup_edit_mail_text = %#, %q0},{@pemit %# = Unable to find '%q1' in current value for TEXT.; @no %q0}}, strmatch(%q1, $),{@edit %q0/mail-in-progress-body = %q1, {%q2}; @tr me/cleanup_edit_mail_text = %#, %q0},strmatch(%q1, ^),{@edit %q0/mail-in-progress-body = %q1, {%q2}; @tr me/cleanup_edit_mail_text = %#, %q0},strmatch(get(%q0/mail-in-progress-body), *%q1*),{@edit %q0/mail-in-progress-body = {%q1}, {%q2}; @tr me/cleanup_edit_mail_text = %#, %q0},{@pemit %# = Unable to find '%q1' in current value for TEXT.; @no %q0}}}
&CLEANUP_EDIT_MAIL_TEXT #4167=&mail-in-progress-body %1 = u(clean_text, get(%1/mail-in-progress-body)); @pemit %0 = [setq(0, u(get_format_option, get(%0/mail_config_options)))][setq(1, get(%1/mail-in-progress-cc))][setq(2, get(%1/mail-in-progress-bcc))][setq(3, get(%1/mail-in-progress-flags))][switch(%q0, standard, {[u(equal_line)]%r})]To:[space(7)][trim(get(%1/mail-in-progress-to))][switch(words(%q1), 0,, %rCc:[space(7)][trim(%q1)])][switch(words(%q2), 0,, %rBcc:[space(6)][trim(%q2)])]%rSubject:%b%b[get(%1/mail-in-progress-subject)][switch(words(%q3), 0,, %rFlags:%b%b%b%b)][switch(match(%q3, u), 0,, [v(mail_flag_u)]%b%b)][switch(match(%q3, rr), 0,, [v(mail_flag_rr)]%b%b)][switch(match(%q3, r), 0,, [v(mail_flag_r)]%b%b)][switch(match(%q3, o), 0,, [v(mail_flag_p)]%b%b)][switch(%q0, standard, {%r[u(dash_line)]%r%r},%rText:%b%b)][get_eval(%1/mail-in-progress-body)][switch(%q0, standard, {%r%r[u(equal_line)]})]%r[u(finish_msg)]; @no %1
&EDIT_TEXT_BLANK #300=$+edit text: @pemit %# = The syntax is +edit text=<old text>/<new text>.
&EDIT_BLANK #300=$+edit: @pemit %# = You must specify what you wish to edit. The syntax of the command is +edit <mail part>=<old text>/<new text>, where mail part may be one of the following:%b%bto, cc, bcc, subject or text.
&SET_MAIL_FLAG #300=$+set mail flag *: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strlen(%q0),{@pemit %# = u(not_writing_mail)},{@wait %q0 = {&debug_mail %q0 = +set mail flag %0; @swi/first 1 = strmatch(get(%q0/mail-in-progress), false),{@pemit %# = u(not_writing_mail); @no %q0},strmatch(%0, r), {@tr me/set_flag_guts = %#, R, v(mail_flag_r) (R), %q0},strmatch(%0, rr), {@tr me/set_flag_guts = %#, RR, v(mail_flag_rr) (RR), %q0},strmatch(%0, u*), {@tr me/set_flag_guts = %#, U, v(mail_flag_u) (U), %q0},strmatch(%0, p*), {@tr me/set_flag_guts = %#, P, v(mail_flag_p) (P), %q0},strmatch(%0, rep*), {@tr me/set_flag_guts = %#, RR, v(mail_flag_rr) (RR), %q0},strmatch(%0, reg*), {@tr me/set_flag_guts = %#, R, v(mail_flag_r) (R), %q0}, strmatch(%0, !r), {@tr me/clear_flag_guts = %#, R, v(mail_flag_r) (R), %q0},strmatch(%0, !rr), {@tr me/clear_flag_guts = %#, RR, v(mail_flag_rr) (RR), %q0},strmatch(%0, !u*), {@tr me/clear_flag_guts = %#, U, v(mail_flag_u) (U), %q0},strmatch(%0, !p*), {@tr me/clear_flag_guts = %#, P, v(mail_flag_p) (P), %q0},strmatch(%0, !rep*), {@tr me/clear_flag_guts = %#, RR, v(mail_flag_rr) (RR), %q0},strmatch(%0, !reg*), {@tr me/clear_flag_guts = %#, R, v(mail_flag_r) (R), %q0},{@pemit %# = That is not a valid mail flag. Available flags are: [v(mail_flag_u)] (U), [v(mail_flag_rr)] (RR), [v(mail_flag_p)] (P), [v(mail_flag_r)] (R); @no %q0}}}
&CLEAR_FLAG_GUTS #4167=@pemit %0 = [setq(0, get(%3/mail-in-progress-flags))]switch(match(%q0, %1), 0, The %2 flag is not currently set for this mail message.,The %2 flag has been cleared.); &mail-in-progress-flags %3 = squish(remove(%q0, %1)); @no %3
&SET_FLAG_GUTS #4167=@pemit %0 = [setq(0, get(%3/mail-in-progress-flags))]switch(match(%q0, %1), 0, The %2 flag has been set., The %2 flag is already set for this mail message.); &mail-in-progress-flags %3 = setunion(get(%3/mail-in-progress-flags) %1, ); @no %3
&SET_MAIL_FLAG_BLANK #300=$+set mail flag: @pemit %# = You must specify which flag you wish to set. Current options are: Private (P), Urgent (U), Registered (R) and Reply Requested (RR).
&SEND_COMMAND #300=$+send: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER), {@pemit %# = u(not_player)}, strlen(%q0), {@pemit %# = u(not_writing_mail)}, {@wait %q0 = {&debug_mail %q0 = +send; @swi/first [setq(1, u(get_final_delivery_list, %q0))]1 = strmatch(get(%q0/mail-in-progress), false), {@pemit %# = You do not have a mail message ready to send.; @no %q0}, eq(words(%q1), 0), { @pemit %# = You do not have a destination specified.; @no %q0}, {@tr me/store_letter = %q0, get(%q0/mail-in-progress-subject), get(%q0/mail-in-progress-to), get(%q0/mail-in-progress-to-expanded), get(%q0/mail-in-progress-cc), get(%q0/mail-in-progress-cc-expanded), get(%q0/mail-in-progress-bcc), get(%q0/mail-in-progress-bcc-expanded), get(%q0/mail-in-progress-flags), get(%q0/mail-in-progress-body); @tr me/cleanup_send = %#, %q0}}}
&GET_FINAL_DELIVERY_LIST #4167=trim(setunion([get(%0/mail-in-progress-to-expanded)] [get(%0/mail-in-progress-cc-expanded)] [get(%0/mail-in-progress-bcc-expanded)], ))
&CLEANUP_SEND #4167=@pemit %0 = u(pickup_notification); &mail-in-progress-subject %1; &mail-in-progress-to %1; &mail-in-progress-to-expanded %1; &mail-in-progress-cc %1; &mail-in-progress-cc-expanded %1; &mail-in-progress-bcc %1; &mail-in-progress-bcc-expanded %1; &mail-in-progress-flags %1; &mail-in-progress-body %1; &mail-in-progress %1 = false; @no %1
&RETRACT_MAIL #300=$+retract*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(strmatch(escape(%0), *[*)), {@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = There is no mail to retract in your mailbox.},{@wait %q0 = {&debug_mail %q0 = +retract%0; @swi/first [setq(1, get(%q0/out-list))][setq(2,ulocal(expand_single_letter_range,trim(%0), %q1, get(%q0/out-list-current)))]1 = eq(words(%q1), 0), {@pemit %# = There is no mail to retract in your mailbox.; @no %q0}, strmatch(%q2, *ABORT*), {@pemit %# = after(before(%q2, ENDABORT), ABORT); @no %q0},u(any_read, %q0, %q2), {@pemit %# = One or more recipients of the designated letter has already read it, therefore it cannot be retracted.; @no %q0}, {@tr me/retract_main = %#, %q0, %q2, [u(convert_nums, %q2, %q1)][ulocal(format_request, trim(%0))] }}}
&ANY_READ #4167 = strmatch(iter(get(%0/out-%1-dist), [setq(3, get(#7/mailbox_[before(##, :)]))][setq(4, after(##, :))]and(strmatch(get(%q3/in-%q4-time_read), 0), strmatch(first(get(%q3/in-%q4-location)), %0), strmatch(rest(get(%q3/in-%q4-location)), %1))), *0*)
&RETRACT_MAIN #4167=@dolist get(%1/out-%2-dist) = {@tr [setq(2, get(%vm/mailbox_[before(##, :)]))][setq(3, after(##, :))]me/remove_letter[switch(member(get(%1/out-%2-held), before(##, :)), 0,-NO-OP,2)] = %q2, %q3, %0, %1, %2, %3}; @swi 1 = 1, {&out-list-current %1 = [setq(0, get(%1/out-list))][setq(1, get(%1/out-list-current))]switch(%q1+[last(%q0)], %2+%2, first(rest(revwords(%q0))), %2+*, extract(%q0, add(member(%q0, %2), 1), 1), %q1); &out-list %1 = squish(remove(%q0, %2)); @wipe %1/out-%2-*; @pemit %0 = Letter %3 has been retracted.; @no %1}
&REMOVE_LETTER-NO-OP #4167=@@ do nothing
&REMOVE_LETTER2 #4167 =@dolist get(%0/folder-list) = {&current_letter-## %0 = [setq(0, get(%0/in-list-##))][setq(1, get(%0/current_letter-##))]switch(%q1+[last(%q0)], %1+%1, first(rest(revwords(%q0))), %1+*, extract(%q0, add(member(%q0, %1), 1), 1), %q1); &in-list-## %0 = squish(remove(get(%0/in-list-##), %1))};@swi 1 = 1, {@wipe %0/in-%1-*}
&REVIEW_LETTERS #300=$+review: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(1, get(%q0/out-list))][setq(2, get(%q0/out-list-current))][setq(9, u(get_format_option, get(%#/mail_config_options)))]0 = strlen(%q0),{@pemit %# = u(no_sent_mail)},words(%q1), {@pemit %# = u(no_sent_mail)}, {@pemit %# =[switch(%q9, standard,{[u(equal_line)]%r%r[center(List of Previously Sent Mail Messages, 78)]%r%r})][space(8)][ljust(Subject, 46)]%b%bSize%b%bSent%r[space(8)]-------[space(41)]----%b%b--------;@dolist get(%q0/out-list) ={@pemit %# = u(review_brief, %#, ##, %q0, %q1, %q2)};@swi 1 = 1,{@pemit %# = switch(%q9, standard, %r[u(equal_line)],,)}}
&REVIEW_BRIEF #4167 = [setq(2, member(%3, %1))][setq(3, trim(get(%2/out-%1-subject)))][switch(%1, %4, +, %b)][rjust(%q2\)%b%b, 7)][ljust(mid(%q3, 0, min(46, strlen(%q3))), 48)][ljust(strlen(u(%2/out-%1-text)), 6)][mid(get(%2/out-%1-time_sent), 0, 16)]
&REVIEW_LETTER #300=$+review*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},words(%0),,not(strmatch(escape(%0), *[*)),{@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(no_sent_mail)},{@wait %q0 = {&debug_mail %q0 = +review%0; @swi/first [setq(1, get(%q0/out-list))][setq(9, u(get_format_option, get(%#/mail_config_options)))]0 = words(%q1), {@pemit %# = u(no_sent_mail); @no %q0},{@swi/first [setq(3, ulocal(expand_outgoing_letter_range, %0, %q1, get(%q0/out-list-current), %q0))]1 = strmatch(%q3, *ABORT*),{@pemit %# = after(before(%q3, ENDABORT), ABORT); @no %q0},eq(words(%q3), 0),{@pemit %# = u(no_match, +review, ulocal(format_request, trim(%0)), %q2); @no %q0},{@dolist [setq(3, u(filter_list, setunion(%q3, ), %q1))]%q3 ={@pemit %# = ulocal(read_bulk_private, %#, %q0, ##, %q9)}; @swi 1 = 1, {&out-list-current %q0 = last(%q3); @swi 1 = 1,{@no %q0}}}}}}
&READ_BULK_PRIVATE #4167=[setq(4, get(%1/out-%2-cc))][setq(5, get(%1/out-%2-bcc))][setq(7, get(%1/out-list))][setq(6, member(%q7, %2))][switch(%3, standard, {[u(equal_line)]%r})][ljust(Message:, 10)][ljust(%q6/[words(%q7)], 9)][rjust(Sent:%b%b[get(%1/out-%2-time_sent)], 59)]%r[ljust(To:, 10)][trim(get(%1/out-%2-to))][switch(words(%q4), 0,,%r[ljust(Cc:, 10)][trim(%q4)])][switch(words(%q5), 0,,%r[ljust(Bcc:, 10)][trim(%q5)])]%r[ljust(Held By:, 10)][u(pretty_dist, get(%1/out-%2-held))]%r[ljust(Subject:, 10)][trim(get(%1/out-%2-subject))][switch(%3, standard, {%r[u(dash_line)]%r%r},%rText:[space(11)])][u(%1/out-%2-text)][switch(%3, standard, {%r%r[u(equal_line)]})]
&STATUS_OF_MAIL_SENT #300=$+status of mail sent to *: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(1, get(%vm/mailbox_[num(*%0)]))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},strmatch(type(*%0), PLAYER),{@pemit %# = [capstr(%0)] is not a player.}, strlen(%q0), {@pemit %# = u(no_mail_from_you, [name(*%0)])},{@wait %q0 = {&debug_mail %q0 = +status of mail sent to %0; @swi/first [setq(2, get(%q0/out-list))][setq(3, squish(iter(%q2, switch(get(%q0/out-##-dist), *[num(*%0)]:*, ##))))]0 = words(%q2),{@pemit %# = u(no_mail_from_you, [name(*%0)]); @no %q0},words(%q3), {@pemit %# = u(no_mail_from_you, [name(*%0)]); @no %q0},{@pemit %# = [setq(4, u(get_format_option, get(%#/mail_config_options)))][switch(%q4, standard, {[u(equal_line)]%r%r[space(13)]Status of messages you have sent to [name(*%0)]%r%r})]Subject[space(28)]Sent on[space(11)]Read[switch(%q4, standard, {%r[u(dash_line)]})]; @dolist %q3 = {@pemit %# = [setq(5, trim(get(%q0/out-##-subject)))][setq(6, get(%q1/in-[after(extract(get(%q0/out-##-dist), match(get(%q0/out-##-dist), [num(*%0)]:*), 1), :)]-time_read))][ljust(mid(%q5, 0, min(33, strlen(%q5))), 35)][mid(get(%q0/out-##-time_sent), 0, 16)]%b%b[switch(%q6+[words(%q6)], *+0, Message has been deleted, 0+*, Message has not been read, mid(%q6, 0, 16))]}; @swi 1 = 1, {@pemit %# = switch(%q4, standard, u(equal_line),,); @no %q0}}}}
&STATUS_OF_MAIL_SENT_BLANK #300=$+status of mail sent: @pemit %# = The syntax is +status of mail sent to <person>.
&MAIL_ADMIN_COMMAND #300=$+mail status: @swi/first hasflag(%#, wizard) = 1,{@pemit %# = [setq(0, u(get_format_option, get(%#/mail_config_options)))][switch(%q0, standard, {[u(equal_line)]%r[space(26)]Summary status of mailboxes%r%r})]Mailbox%b%bOwner[space(12)]Writing? %b Filters%b Aliases%b Folders%b Sent%b Received[switch(%q0, standard, {%r[u(dash_line)]})]; @tr me/continue_mail_status = %#, 1, %q0, get(%vm/mailboxes_num_of_attributes)}, {@pemit %# = Permission denied.}
&CONTINUE_MAIL_STATUS #4167=@swi/first [setq(0, get(%vm/mailboxes_%1))][strlen(%q0)]+[gt(%3, %1)] = 0+0,{@pemit %0 = switch(%2, standard, u(equal_line), )},0+*, {@tr me/continue_mail_status = %0, add(1, %1), %2, %3}, {@tr me/show_one_mailbox = %0, %q0, 1, words(%q0),continue_mail_status, 0, %1, %2, %3}
&EVALUATE_NEXT_LIST #4167 = iter(get(%vm/mailboxes_%0),switch(u(%1, ##, %2),1,##,))
&SHOW_ONE_MAILBOX #4167 = @swi/first %3+[gt(%8, %6)] = 0+0,{@pemit %0 = switch(%7, standard, u(equal_line), )},0+*,{@tr me/%4 = %0, add(1, %6), %5, %7, %8},{@pemit %0 = u(get_info_for_one_mailbox, extract(%1, %2, 1)); @swi/first %2+[gt(%8, %6)] = %3+0, {@pemit %0 = switch(%7, standard, u(equal_line), )},%3+*, {@tr me/%4 = %0, add(1, %6), %7, %8},{@tr me/show_one_mailbox = %0, %1, add(%2, 1), %3, %4, %5, %6, %7, %8}}
&GET_INFO_FOR_ONE_MAILBOX #4167 = [setq(0, get(%0/owner_dbref))][setq(1, get(%0/semaphore))][setq(2, get(%0/mail-in-progress))][setq(3, [switch(%q1, -1,, {[switch(strlen(%q1), 0,%bsem 0, %bsem%q1)]})])][ljust(%0, 7)][switch(hasattr(%0, autoforward), 0, %b%b, a%b)][switch(0, strmatch(owner(%0), owner(#7)), {%b-- WARNING -- This mailbox object is not owned by the right player!},strlen(%q2),{%b-- WARNING -- This does not seem to be a valid mailbox.},strmatch(type(%q0), PLAYER), {%b-- INFORMATIVE -- Mailbox for dest'ed player (do a +destroy mailbox for %q0. Caution:%b all mail sent by that player will be removed from the destination mailboxes)},{[ljust(name(%q0), 17)][ljust(%q2%q3, 11)][rjust(add(words(get(%0/author_filter), ~), words(get(%0/subject_filter), ~)), 7)][rjust(words(get(%0/alias-list)), 9)][rjust(words(remove(get(%0/folder-list), null)), 9)][rjust(words(get(%0/out-list)), 6)][rjust(words(u(get_all_in_lists, %0)), 10)]})]
&MAIL_ADMIN_COMMAND_SPECIFIC #300 = $+mail status for *: @swi/first [setq(0, get(%vm/mailbox_[num(*%0)]))]0 = hasflag(%#, wizard),{@pemit %# = Permission denied.},strmatch(type(*%0), PLAYER),{@pemit %# = [capstr(%0)] is not a player.},strlen(%q0),{@pemit %# = [name(*%0)] does not currently have a mailbox.},{@tr me/display_mail_admin = %#, %q0}
&DISPLAY_MAIL_ADMIN #4167 = &folder-list %0 = squish(remove(get(%0/folder-list), null)); @pemit %0 = [setq(0, u(get_format_option, get(%0/mail_config_options)))][setq(1, get(%1/owner_dbref))][setq(2, get(%1/mail-in-progress))][switch(%q0, standard, {[u(equal_line)]%rDetailed status for [name(%q1)]'s mailbox:%r[u(dash_line)]%r})][rjust(Mailbox dbref:, 20)]%b%b%1[switch(strlen(%q2), 0,{%r-- WARNING -- This does not seem to be a valid mailbox.})]%r[rjust(Mail-in-progress:, 20)]%b%b%q2%r[rjust(Received:, 20)]%b%b[words(u(get_all_in_lists, %1))]%r[rjust(Sent:, 20)]%b%b[words(get(%1/out-list))]%r[rjust(Personal aliases:, 20)]%b%b[words(get(%1/alias-list))] [switch(hasattr(%1, alias-list), 0,,([u(list_names, trim(get(%1/alias-list)))]))]%r[rjust(Filters:, 20)]%b%b[ulocal(get_filter_count, %q1)]%r[rjust(Folders:, 20)]%b%b[words(get(%1/folder-list))] [switch(hasattr(%1, folder-list), 0,,{([u(secure_names, trim(get(%1/folder-list)))])})]%r[rjust(Autoforward:, 20)]%b%b[ulocal(get_autoforward_option, %q1)]%r[rjust(Message Timeout:, 20)]%b%b[ulocal(get_timeout_option, %q1)]%r[rjust(Semaphore:, 20)]%b%b[get(%1/semaphore)]%r[rjust(Current Letter:, 20)]%b%b[get(%1/[u(which_current_letter, %1)])]%r[rjust(Current Folder:, 20)]%b%b[secure(get(%1/current_folder))]%r[rjust(Inbox:, 20)]%b%b[secure(ulocal(get_inbox, %q1))]%r[rjust(Vacation:, 20)]%b%b[u(%1/vacation)]%r[rjust(Reject:, 20)]%b%b[u(%1/reject_msg)]%r[rjust(Filter reject:, 20)]%b%b[u(%1/filter_reject)][switch(%q0, standard, {%r[u(equal_line)]})];
&MAIL_MEMORY_HOGS #300 = $+mail status >*: @swi/first hasflag(%#, wizard) = 1,{@pemit %# = [setq(0, u(get_format_option, get(%#/mail_config_options)))][switch(%q0, standard, {[u(equal_line)]%r[space(8)]Summary status of mailboxes with greater than [trim(%0)] messages%r%r})]Mailbox%b%bOwner[space(12)]Writing? %b Filters%b Aliases%b Folders%b Sent%b Received[switch(%q0, standard, {%r[u(dash_line)]})]; @tr me/continue_memory_hogs = %#, 1, %0, %q0, get(%vm/mailboxes_num_of_attributes)}, {@pemit %# = Permission denied.}
&CONTINUE_MEMORY_HOGS #4167 = @swi/first [strlen(get(%vm/mailboxes_%1))]+[gt(%4, %1)] = 0+0,{@pemit %0 = switch(%3, standard, u(equal_line), )},0+*, {@tr me/continue_memory_hogs = %0, add(1, %1), %2, %3, %4},{@tr me/show_one_mailbox =[setq(0, u(evaluate_next_list, %1, memory_hog_test, %2))]%0, %q0, 1, words(%q0), continue_memory_hogs, %2, %1, %3, %4}
&MEMORY_HOG_TEST #4167 = gt(words(u(get_all_in_lists, %0)), %1)
&MAIL_STATUS_LESS_THAN #300 = $+mail status <*: @swi/first hasflag(%#, wizard) = 1,{@pemit %# = [setq(0, u(get_format_option, get(%#/mail_config_options)))][switch(%q0, standard, {[u(equal_line)]%r[space(8)]Summary status of mailboxes with less than [trim(%0)] messages%r%r})]Mailbox%b%bOwner[space(12)]Writing? %b Filters%b Aliases%b Folders%b Sent%b Received[switch(%q0, standard, {%r[u(dash_line)]})]; @tr me/continue_less_than = %#, 1, %0, %q0, get(%vm/mailboxes_num_of_attributes)}, {@pemit %# = Permission denied.}
&CONTINUE_LESS_THAN #4167 = @swi/first [strlen(get(%vm/mailboxes_%1))]+[gt(%4, %1)] = 0+0, {@pemit %0 = switch(%3, standard, u(equal_line), )},0+*, {@tr me/continue_less_than = %0, add(1, %1), %2, %3, %4},{@tr me/show_one_mailbox =[setq(0, u(evaluate_next_list, %1, letters_less_than_test, %2))]%0,%q0, 1,words(%q0),continue_less_than,%2, %1, %3, %4}
&LETTERS_LESS_THAN_TEST #4167 = lt(words(u(get_all_in_lists, %0)), %1)
&MAIL_STATUS_BAD_SEM #300 =$+mail status bad sem*:@swi/first hasflag(%#, wizard) = 1,{@pemit %# =[setq(0, u(get_format_option, get(%#/mail_config_options)))][switch(%q0, standard, {[u(equal_line)]%r[space(8)]Summary status of mailboxes with semaphores that are off%r%r})]Mailbox%b%bOwner[space(12)]Writing? %b Filters%b Aliases%b Folders%b Sent%b Received[switch(%q0, standard, {%r[u(dash_line)]})];@tr me/continue_semaphore_off = %#, 1, %q0, get(%vm/mailboxes_num_of_attributes)}, {@pemit %# = Permission denied.}
&CONTINUE_SEMAPHORE_OFF #4167 =@swi/first [strlen(get(%vm/mailboxes_%1))]+[gt(%3, %1)] = 0+0, {@pemit %0 = switch(%2, standard, u(equal_line), )},0+*, {@tr me/continue_semaphore_off = %0, add(1, %1), %2, %3},{@tr me/show_one_mailbox =[setq(0, u(evaluate_next_list, %1, semaphore_off_test))]%0, %q0, 1, words(%q0), continue_semaphore_off, 0, %1,%2,%3}
&SEMAPHORE_OFF_TEST #4167 = switch(get(%0/semaphore), -1, 0, 1)
&SANITY_CHECK #300 = $+sanity check: @swi/first hasflag(%#, wizard) = 1,{&last_sanity_checked me = time(); @tr me/continue_sanity_check =%#, 1, get(%vm/mailboxes_num_of_attributes)},{@pemit %# = Permission denied.}
&CONTINUE_SANITY_CHECK #4167 = @swi/first [strlen(get(%vm/mailboxes_%1))]+[gt(%2, %1)] =0+0,{@pemit %0 = Sanity check complete.},0+*,{@tr me/continue_sanity_check = %0, add(1, %1), %2},{@tr #7/sanity_check_one_mailbox =first(get(%vm/mailboxes_%1)), %0, %1,%2, get(%vm/mailboxes_%1), words(get(%vm/mailboxes_%1)), 1}
&SANITY_CHECK_ONE_MAILBOX #7 = @pemit %1 = Sanity checking [name(get(%0/owner_dbref))]'s mailbox.; @dolist u(#300/get_all_in_lists, %0) = {@swi/first [setq(0, get(%0/in-##-location))]1 = and(eq(member(get(first(%q0)/out-list), rest(%q0)), 0),not(strmatch(rest(%q0), a*))), {@pemit %1 = Error detected in mailbox %0.%b Internal mail number ## is not present in source mailbox.}, and(eq(member(get(first(%q0)/out-[rest(%q0)]-held), get(%0/owner_dbref)), 0), not(strmatch(rest(%q0), a*))), {@pemit %1 = Error detected in mailbox %0.%b Internal mail number ## is not in the 'held' list in source mailbox.}, and(or(eq(words(get(%0/in-##-time_read)), 0), eq(words(get(%0/in-##-location)), 0)), strmatch(rest(%q0), a*)), {@pemit %1 = Error detected in mailbox %0.%b Internal mail number ## for 'old' mail does not have matching in-* attributes.}, and(eq(words(get(%0/out-a##-time_sent)), 0), strmatch(rest(%q0), a*)), {@pemit %1 = Error detected in mailbox %0.%b Internal mail number ## for 'old' mail does not have matching out-a* attributes.}}; @dolist get(%0/out-list) = {@tr me/sanity_check_outgoing_mail = %0, %1, ##};@swi 1 = 1, {@swi 1 = 1, {@swi 1 = 1, {@swi %6 = %5,{@tr #300/continue_sanity_check = %1, add(1, %2), %3},{@tr #7/sanity_check_one_mailbox =extract(%4, add(1, %6), 1), %1, %2, %3, %4, %5, add(1, %6)}}}}
&SANITY_CHECK_OUTGOING_MAIL #7 = @dolist [setq(0, get(%0/out-%2-dist))]get(%0/out-%2-held) = {@swi/first [setq(1, match(%q0, ##:*))][setq(2, extract(%q0, %q1, 1))][setq(3, v(mailbox_[before(%q2, :)]))][setq(4, after(%q2, :))][setq(5, get(%q3/in-%q4-location))][setq(6, u(#300/get_all_in_lists, %q3))][setq(7, name(get(%q3/owner_dbref)))]0 = %q1,{@pemit %1 = Error detected in mailbox %0.%b Outgoing mail number %2 has a 'held' member (##) which isn't in the 'dist' list.},words(%q7),{@pemit %1 = Error detected in mailbox %0.%b Outgoing mail number %2 has a 'held' member (##) who does not even have a mailbox.%b Fixed.;&out-%2-held %0 = squish(remove(get(%0/out-%2-held), ##)) },words(%q5),{@pemit %1 = Error detected in mailbox %0.%b Outgoing mail number %2 does not exist in destination mailbox %q3 \(%q7\).%b Fixed.;&out-%2-held %0 = squish(remove(get(%0/out-%2-held), ##)) },strmatch(first(%q5), %0),{@pemit %1 = Error detected in mailbox %0.%b Outgoing mail number %2 'dist' does not match in-%q4-location in mailbox %q3 \(%q7\)%b Fixed.;&out-%2-held %0 = squish(remove(get(%0/out-%2-held), ##)) }, strmatch(rest(%q5), %2), {@pemit %1 = Error detected in mailbox %0.%b Outgoing mail number %2 'dist' does not match in-%q4-location in mailbox %q3 \(%q7\).%b Fixed.;&out-%2-held %0 = squish(remove(get(%0/out-%2-held), ##)) }, member(%q6, %q4), {@pemit %1 = Error detected in mailbox %0.%b Outgoing mail number %2 exists in destination mailbox %q3 \(%q7\), but is not in any of its IN lists.}};@swi 1 = 1,{@swi 2 = 2,{@swi hasattr(%0, out-%2-held) = 0,{@wipe %0/out-%2-*;&out-list %0 = squish(remove(get(%0/out-list), %2))}}}
&WIZ_MAKE_MAILBOX #300 = $+make mailbox for *: @swi/first hasflag(%#, wizard) = 1,{@tr %vm/make_mailbox = %0, %#}, {@pemit %# = Permission denied.}
&WIZ_DESTROY_MAILBOX #300=$+destroy mailbox for *: @swi/first hasflag(%#, wizard) = 1,{@tr %vm/destroy_mailbox = %0, %#, 0, +destroy_mailbox}, {@pemit %# = Permission denied.}
&MAIL_CONFIGURATION #300=$+mail config*: @swi hasflag(%#, wizard) = 1,{@pemit %# = [setq(0, u(get_format_option, get(%#/mail_config_options)))][setq(1, get(%vm/default_timeout_option))][switch(%q0, standard, {[u(equal_line)]%rCurrent mail configuration:%r[u(dash_line)]%r})]Defaults:%r%r%b%bdestroy:%b%b[ljust(switch(get(%vm/delete_when_empty), 0, no, yes), 16)][rjust(\(+set mail option destroy = yes or no\), 50)]%r%b%b%b%b%b%bRGA:%b%b[ljust(switch(get(%vm/default_rga_option), 0, no, yes), 16)][rjust(\(+set mail default RGA = yes or no\), 50)]%r%b%b%bdelete:%b%b[ljust(get(%vm/default_delete_option), 16)][rjust(\(+set mail default delete = hard or soft\), 50)]%r%b%b%bformat:%b%b[ljust(get(%vm/default_format_option), 16)][rjust(\(+set mail default format = standard or compact\), 50)]%r%b%b%b%b%bsave:%b%b[ljust(get(%vm/default_save_option), 16)][rjust(\(+set mail default save = enabled or disabled\), 50)]%rseparator:%b%b[ljust(get(%vm/default_separator_option), 16)][rjust(\(+set mail default separator = space or return\), 50)]%r%b%btimeout:%b%b[ljust(switch(%q1, 0, <disabled>,{[div(%q1, v(seconds_in_day))] days}), 16)][rjust(\(+set mail default timeout = <number of days>\), 50)]%r%b%b%b%bpurge:%b%b[ljust(get(%vm/default_purge_time), 16)][rjust(\(+set mail default purge = <day> <hour>:<minute>\), 50)]%r%rNotifications: \(set on Parent Mail Object/#4167\)%r%r%b%bENTER_MSG:%b%b[get(#4167/enter_msg)]%r%r%b%bFINISH_MSG:%b%b[get(#4167/finish_msg)]%r%r%b%bDELIVERY_NOTIFICATION:%b%b[get(#4167/delivery_notification)]%r%r%b%bPICKUP_NOTIFICATION:%b%b[get(#4167/pickup_notification)]%r%r%b%bFORWARD_NOTIFICATION:%b%b[get(#4167/forward_notification)]%r%r%b%bTEXT_ADDED_NOTIFICATION:%b%b[get(#4167/text_added_notification)]%r%rCurrent Status:%r%r%b%bThere are [words(get(%vm/global-mail-aliases))] global mail aliases.%r%b%bThere are [words(iter(lnum(get(%vm/mailboxes_num_of_attributes)),get(%vm/mailboxes_[add(1, ##)])))] mailboxes.%r%b%b[switch(get(#7/mailboxes_num_of_attributes), 1, One attribute is, [get(#7/mailboxes_num_of_attributes)] are)] used to hold the list of mailboxes. [switch(%q0, standard, {%r[u(equal_line)]})]}
&VERIFY_MAIL_CONFIG #300=$+verify mail config*:@swi hasflag(%#, wizard) = 1,{&mail_config_options me=this is a test;&test_space_compression me = z%b%b%b%b%bz;@create Test Object; &new_object me = switch(name(con(me)), Test Object, con(me), #-1); @swi/first 0+0 = 0+0,, 0+*, {@pemit %# = @swi/first is broken! Don't bother trying to run the mailer until it is fixed.}, {}; @pemit %# =[switch(words(v(mail_config_options)), 0,,%r%rWARNING:%b%bhave [name(#1)]\(#1\) do a@attribute/access mail_config_options=wizard)][switch(flags(#300), *I*, %r%rWARNING:%b%bThe [name(#300)] object \(#300\) should not be inherit.)][switch([flags(#25)]+[flags(owner(#25))],*I*+*W*,, *W*+*W*,, %r%rFATAL:%b%bThe [name(#25)] object \(#25\)should be inherit and owned by a Wizard.)][switch(parent(me), #4167,, %r%rFATAL:%b%bThe [name(me)] object \([num(me)]\) should be parented tothe [name(#4167)] \(#4167\).)][switch(strlen(u(test_space_compression), 3,,{%r%rFATAL:%b%b have [name(#1)]\(#1\) do a @adminspace_compress=yes}))][switch(isdbref(v(new_object)), 1,, 0, {FATAL:%b%bThe Mail System must be allowed to create objects, but a @create failed!})]; @swi 1 = 1, @pemit %# = Verify complete.;&test_space_compression me = ;@dest v(new_object); &new_object me = ; &mail_config_options me =}
&SET_MAIL_OPTION_DESTROY #300=$+set mail option destroy*=*: @swi/first hasflag(%#, wizard) = 1,{@swi/first 1 = or(strmatch(%1, *yes), strmatch(%1, *on), strmatch(%1, *true), strmatch(%1, *t), strmatch(%1, *1)),{&delete_when_empty %vm = 1; @pemit %# = Mailboxes will be automatically destroyed when they are empty.},or(strmatch(%1, *no), strmatch(%1, *off), strmatch(%1, *false), strmatch(%1, *f), strmatch(%1, *0)),{&delete_when_empty %vm = 0; @pemit %# = Mailboxes will not be automatically destroyed when they are empty.}, {@pemit %# = The value for this option must be specified as a boolean. For example: %bon, off, yes, no, true, false are all acceptable values.} }, {@pemit %# = Permission denied.}
&SET_MAIL_OPTION_RGA #300=$+set mail option RGA*=*:@swi/first hasflag(%#, wizard) = 1,{@swi/first 1 =or(strmatch(%1, *yes),strmatch(%1, *on),strmatch(%1, *true),strmatch(%1, *t),strmatch(%1, *1)),{&default_rga_option #7 = 1;@pemit %# = Adding global mail aliases is now restricted to wizards.},or(strmatch(%1, *no),strmatch(%1, *off),strmatch(%1, *false),strmatch(%1, *f),strmatch(%1, *0)),{&default_rga_option #7 = 0;@pemit %# = Adding global mail aliases is no longer restricted.},{@pemit %# = The value for this option must be specified as aboolean. For example: %bon, off, yes, no, true, false are allacceptable values.}},{@pemit %# = Permission denied.}
&SET_MAIL_OPTION_BLANK #300=$+set mail option: @swi/first hasflag(%#, wizard) = 1,{@pemit %# = You must specify which option you wish to set and the desired value. The current options are:%r%r%b%bdelete=hard | soft%r%r%b%bdestroy=on | off%r%r%b%bformat=compact | standard%r%r%b%bseparator=space | return%r%r%b%binbox=<folder name>%r%r%b%bvacation=<text>%r%r%b%breject=<text>%r%r%b%bfilter reject=<text>%r%r%b%bautoforward=<list of people and/or mail aliases>%r%r%b%btimeout=<number of days> for <player>%r%r%b%bRGA=yes | no (RGA stands for Restrict Global Aliases)},{@pemit %# = You must specify which option you wish to set and the desired value. The current options are:%r%r%b%bdelete=hard | soft%r%r%b%bformat=compact | standard%r%r%b%bseparator=space | return%r%r%b%binbox=<folder name>%r%r%b%bvacation=<text>%r%r%b%breject=<text>%r%r%b%bfilter reject=<text>%r%r%b%bautoforward=<list of people and/or mail aliases>}
&SET_MAIL_OPTION_TIMEOUT #25=$+set mail option timeout*=* for *: @swi/first [setq(0, get(%vm/mailbox_[num(*%2)]))]0 = hasflag(%#, wizard), {@pemit %# = Permission denied.},strmatch(type(*%2), PLAYER),{@pemit %# = [capstr(%2)] is not a player.},strlen(%q0),{@pemit %# = [name(*%2)] does not currently have a mailbox.},%1,{&message_timeout %q0 = 0; @pemit %# = The message timeout has been set to 0 days (indicating that the timeout option has been turned off for [name(*%2)]).},lt(%1, 7),{&message_timeout %q0 = mul(%1, v(seconds_in_day));@pemit %# = The message timeout value for [name(*%2)] has been set to [add(%1, 0)] days.},{@pemit %# = The value specified for the message timeout must be either a '0' (indicating the timeout option has been turned off) or a value greater than or equal to 7 days.}
&SET_MAIL_DEFAULT_DELETE #25=$+set mail default delete*=*: @swi/first 1 = eq(hasflag(%#, wizard), 0),{@pemit %# = Permission denied.},strmatch(%1, *s*),{@pemit %# = switch(get(%vm/default_delete_option), hard, The mail system default for 'delete' is now 'soft'., The mail system default for 'delete' is already 'soft'.); &default_delete_option %vm = soft; },strmatch(%1, *h*),{@pemit %# = switch(get(%vm/default_delete_option), soft, The mail system default for 'delete' is now 'hard'., The mail system default for 'delete' is already 'hard'.); &default_delete_option %vm = hard; },{@pemit %# = The value specified for the mail system default for 'delete', must be either 'soft' or 'hard'.}
&SET_MAIL_DEFAULT_MODE #25=
&SET_MAIL_DEFAULT_FORMAT #25=$+set mail default format*=*: @swi/first 1 = eq(hasflag(%#, wizard), 0),{@pemit %# = Permission denied.},strmatch(%1, *s*),{@pemit %# = switch(get(%vm/default_format_option), compact, The mail system default for 'format' is now 'standard'., The mail system default for 'format' is already 'standard'.); &default_format_option %vm = standard},strmatch(%1, *c*),{@pemit %# = switch(get(%vm/default_format_option), standard, The mail system default for 'format' is now 'compact'., The mail system default for 'format' is already 'compact'.); &default_format_option %vm = compact},{@pemit %# = The value specified for the mail system default for 'format', must be either 'standard' or 'compact'.}
&SET_MAIL_DEFAULT_SAVE #25=$+set mail default save*=*: @swi/first [setq(0, trim(%1))]1 = eq(hasflag(%#, wizard), 0),{@pemit %# = Permission denied.},strmatch(%q0, e*),{@pemit %# = switch(get(%vm/default_save_option), disabled, The mail system default for 'save' is now 'enabled'., The mail system default for 'save' is already 'enabled'.); &default_save_option %vm = enabled},strmatch(%q0, d*),{@pemit %# = switch(get(%vm/default_save_option), enabled, The mail system default for 'save' is now 'disabled'., The mail system default for 'save' is already 'disabled'.); &default_save_option %vm = disabled},{@pemit %# = The value specified for the mail system default for 'save', must be either 'enabled' or 'disabled'.}
&SET_MAIL_DEFAULT_SEPARATOR #25=$+set mail default separator*=*: @swi/first [setq(0, trim(%1))]1 = eq(hasflag(%#, wizard), 0),{@pemit %# = Permission denied.},strmatch(%q0, s*),{@pemit %# = switch(get(%vm/default_separator_option), return, The mail system default for 'separator' is now 'space'., The mail system default for 'separator' is already 'space'.); &default_separator_option %vm = space},strmatch(%q0, r*),{@pemit %# = switch(get(%vm/default_separator_option), space, The mail system default for 'separator' is now 'return'., The mail system default for 'separator' is already 'return'.); &default_separator_option %vm = return},{@pemit %# = The value specified for the mail system default for 'separator', must be either 'space' or 'return'.}
&SET_MAIL_DEFAULT_TIMEOUT #25=$+set mail default timeout*=*:@swi/first 0 = hasflag(%#, wizard), {@pemit %# = Permission denied.},%1,{&default_timeout_option %vm = 0;@pemit %# = The mail system default for 'timeout' has been set to 0 days (indicating that the timeout option has been turned off).},lt(%1, 7), {&default_timeout_option %vm = mul(%1, v(seconds_in_day));@pemit %# = The mail system default for 'timeout' is now [add(%1, 0)] days and will run on [get(%vm/default_purge_time)].},{@pemit %# = The value specified for the mail system default for 'timeout', must be either a '0' (indicating the timeout option has been turned off) or a value greater than or equal to 7 days.}
&SET_MAIL_DEFAULT_PURGE #25=$+set mail default purge*=* *:@swi/first 0 = hasflag(%#, wizard), {@pemit %# = Permission denied.},match(Monday Tuesday Wednesday Thursday Friday Saturday Sunday Mon Tue Tues Wed Thu Thur Thurs Fri Sat Sun, %1),{@pemit %# = Please specify day of week. (example:%b Monday)},strmatch(%2, *:*),{@pemit %# = Please specify the time in the format of <hour>:<minute>.},not(strmatch(%2, *:*:*)),{@pemit %# = Please specify the time in the format of <hour>:<minute>.},[setq(0, before(%2, :))]not(or(lt(%q0, 0), gt(%q0, 24))), {@pemit %# = Hour must be between 0 and 24.},[setq(1, after(%2, :))]not(or(lt(%q1, 0), gt(%q1, 59))), {@pemit %# = Minute must be between 0 and 59.},{&default_purge_time %vm = %1 [mid(00, 0, sub(2, strlen(%q0)))]%q0:[mid(00, 0, sub(2, strlen(%q1)))]%q1; @pemit %# = The mail system letter and mailbox purge code will run on [get(%vm/default_purge_time)].}
&SET_MAIL_OPTION_DELETE #25=$+set mail option delete*=*: @swi/first [setq(0, get(%#/mail_config_options))]trim(%1) = s*,{@pemit %# = switch(member(%q0, soft), 0, Your 'delete' mail option is now set to 'soft'., Your 'delete' mail option is already set to 'soft'.); &mail_config_options %# = setunion(squish(remove(%q0, hard) soft), )},h*,{@pemit %# = switch(member(%q0, hard), 0, Your 'delete' mail option is now set to 'hard'., Your 'delete' mail option is already set to 'hard'.); &mail_config_options %# = setunion(squish(remove(%q0, soft) hard), )},{@pemit %# = The value specified for the mail option 'delete', must be either 'soft' or 'hard'.}
&SET_MAIL_OPTION_MODE #25=
&SET_MAIL_OPTION_AUTOFORWARD #25 = $+set mail option autoforward*=*: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(2, get(%vm/global-mail-aliases))][setq(3, get(%q0/alias-list))]1 = and(eq(strlen(%q0), 0), eq(strlen(%1), 0)), {@pemit %# = Mail will not be autoforwarded.},eq(strlen(%1), 0), {&autoforward %q0 = ; @pemit %# = Mail will not be autoforwarded.},eq(strlen(%q0), 0), {@swi/first [setq(1,[ulocal(#300/identify_to_list, {%1}, %vm)] [u(#300/get_aliases, {%1}, #0, %q2, )])]%q1 = *ABORT*, {@pemit %# = secure(after(before(%q1, ENDABORT), ABORT));@no %q0},{@create %N's Mailbox; @set [setq(0, con(me))]%q0 = quiet; @drain %q0; &debug_mail %q0 = +set mail option autoforward%0=%1; @chown %q0 = owner(%vm); @set %q0 = !halt; @tel %q0 = %vm; &mailbox_%# %vm = %q0; @tr %vm/add_mailbox = %q0; &owner_dbref %q0 = %#; @startup %q0 = {@drain me; @no me}; @set %q0 = safe; &mail-in-progress %q0 = false; &current_folder %q0 = ulocal(#300/get_inbox, %#); &folder-list %q0 = get(%q0/current_folder); &autoforward %q0 = %q1; @pemit %# = All mail destined for this mailbox will now be autoforwarded to [u(#300/pretty_dist, u(#300/get_aliases, %q1, %q0, %q2, ), %q0, , %q2, u(#300/snag_dbrefs, %q1))].; @no %q0}},{@swi/first [setq(1,[ulocal(#300/identify_to_list, {%1}, %q0)] [u(#300/get_aliases, {%1}, %q0, %q2, %q3)])]%q1 = *ABORT*, {@pemit %# = secure(after(before(%q1, ENDABORT), ABORT));@no %q0},{&autoforward %q0 = %q1; @pemit %# = All mail destined for this mailbox will now be autoforwarded to [u(#300/pretty_dist, u(#300/get_aliases, %q1, %q0, %q2, %q3), %q0, %q3, %q2, u(#300/snag_dbrefs, %q1))].}}
&SET_MAIL_OPTION_FORMAT #25=$+set mail option format*=*: @swi/first [setq(0, get(%#/mail_config_options))]trim(%1) = s*,{@pemit %# = switch(member(%q0, standard), 0, Your 'format' mail option is now set to 'standard'., Your 'standard' mail option is already set to 'standard'.); &mail_config_options %# = setunion(squish(remove(%q0, compact) standard), )},c*,{@pemit %# = switch(member(%q0, compact), 0, Your 'format' mail option is now set to 'compact'., Your 'standard' mail option is already set to 'compact'.); &mail_config_options %# = setunion(squish(remove(%q0, standard) compact), )},{@pemit %# = The value specified for the mail option 'format', must be either 'standard' or 'compact'.}
&SET_MAIL_OPTION_SEPARATOR #25=$+set mail option separator*=*: @swi/first [setq(0, get(%#/mail_config_options))]trim(%1) = s*,{@pemit %# = switch(member(%q0, space), 0, Your 'separator' mail option is now set to 'space'., Your 'separator' mail option is already set to 'space'.); &mail_config_options %# = setunion(squish(remove(%q0, return) space), )},r*,{@pemit %# = switch(member(%q0, return), 0, Your 'separator' mail option is now set to 'return'., Your 'separator' mail option is already set to 'return'.); &mail_config_options %# = setunion(squish(remove(%q0, space) return), )},{@pemit %# = The value specified for the mail option 'separator', must be either 'space' or 'return'.}
&SET_MAIL_OPTION_INBOX #25=$+set mail option inbox*=*: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(1, edit(lcstr(trim(%1)), %b, $))]1 = strmatch(escape(%1), *[*),{@pemit %# = u(#300/nofunc)},not(strmatch(type(%#), PLAYER)),{@pemit %# = u(#300/not_player)},eq(strlen(%1), 0),{@pemit %# = You must specify a name for the folder to be the designated inbox.},gt(strlen([setq(2, [setq(3, %1)]filter(#300/check_for_bad_chars, get(#300/bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in folder name.},gt(strlen(%1), 16),{@pemit %# = Folder name specified is too long (maximum of 16 characters).},eq(strlen(%q0), 0),{&MAIL_CONFIG_OPTIONS %# = [before(get(%#/mail_config_options), INBOX:)] [after(get(%#/mail_config_options), :INBOXEND)] INBOX:%q1:INBOXEND; @pemit %# = '[secure(%q1)]' is now the designated inbox[switch(%q1, null, {WARNING:%b This will result in all of your incoming mail being automatically discarded.},.)]},{&MAIL_CONFIG_OPTIONS %# = [before(get(%#/mail_config_options), INBOX:)] [after(get(%#/mail_config_options), :INBOXEND)] INBOX:%q1:INBOXEND; &folder-list %q0 = setunion([get(%q0/folder-list)] %q1, ); @pemit %# = '[secure(%q1)]' is now the designated inbox.[switch(%q1, null, {WARNING:%b This will result in all of your incoming mail being automatically discarded.},.)]}
&SET_MAIL_OPTION_VACATION #25=$+set mail option vacation*=*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = and(eq(strlen(%q0), 0), eq(words(%1), 0)), {@pemit %# = No vacation text registered.},eq(words(%1), 0), {&vacation %q0 = ; @pemit %# = Vacation text cleared.},eq(strlen(%q0), 0), {@create %N's Mailbox; @set [setq(0, con(me))]%q0 = quiet; @drain %q0; &debug_mail %q0 = +set mail option vacation%0=%1; @chown %q0 = owner(%vm); @set %q0 = !halt; @tel %q0 = %vm; &mailbox_%# %vm = %q0; @tr %vm/add_mailbox = %q0; &owner_dbref %q0 = %#; @startup %q0 = {@drain me; @no me}; @set %q0 = safe; &mail-in-progress %q0 = false; &current_folder %q0 = ulocal(#300/get_inbox, %#); &folder-list %q0 = get(%q0/current_folder); &vacation %q0 = u(#300/clean_text, %1); @pemit %# = Vacation text set.; @no %q0},{&vacation %q0 = u(#300/clean_text, %1); @pemit %# = Vacation text set.; }
&SET_MAIL_OPTION_REJECT #25=$+set mail option reject*=*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = and(eq(strlen(%q0), 0), eq(words(%1), 0)), {@pemit %# = No reject text registered.},eq(words(%1), 0), {&reject_msg %q0 = ; @pemit %# = Reject text cleared.},eq(strlen(%q0), 0), {@create %N's Mailbox; @set [setq(0, con(me))]%q0 = quiet; @drain %q0; &debug_mail %q0 = +set mail option reject%0=%1; @chown %q0 = owner(%vm); @set %q0 = !halt; @tel %q0 = %vm; &mailbox_%# %vm = %q0; @tr %vm/add_mailbox = %q0; &owner_dbref %q0 = %#; @startup %q0 = {@drain me; @no me}; @set %q0 = safe; &mail-in-progress %q0 = false; &current_folder %q0 = ulocal(#300/get_inbox, %#); &folder-list %q0 = get(%q0/current_folder); &reject_msg %q0 = u(#300/clean_text, %1); @pemit %# = Reject text set.; @no %q0},{&reject_msg %q0 = u(#300/clean_text, %1); @pemit %# = Reject text set.; }
&SET_MAIL_OPTION_FILTER_REJECT #25=$+set mail option filter reject*=*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = and(eq(strlen(%q0), 0), eq(words(%1), 0)), {@pemit %# = No filter reject text registered.},eq(words(%1), 0), {&filter_reject %q0 = ; @pemit %# = Filter reject text cleared.},eq(strlen(%q0), 0), {@create %N's Mailbox; @set [setq(0, con(me))]%q0 = quiet; @drain %q0; &debug_mail %q0 = +set mail option filter reject%0=%1; @chown %q0 = owner(%vm); @set %q0 = !halt; @tel %q0 = %vm; &mailbox_%# %vm = %q0; @tr %vm/add_mailbox = %q0; &owner_dbref %q0 = %#; @startup %q0 = {@drain me; @no me}; @set %q0 = safe; &mail-in-progress %q0 = false; &current_folder %q0 = ulocal(#300/get_inbox, %#); &folder-list %q0 = get(%q0/current_folder); &filter_reject %q0 = u(#300/clean_text, %1); @pemit %# = Filter reject text set.; @no %q0},{&filter_reject %q0 = u(#300/clean_text, %1); @pemit %# = Filter reject text set.; }
&SHOW_MAIL_OPTIONS #25=$+show mail option*: @pemit %# = [setq(0, #300)][setq(1, u(%q0/get_format_option, get(%#/mail_config_options)))][setq(2, get(%vm/mailbox_%#))][switch(%q1, standard,{[u(%q0/equal_line)]%rUser mail configuration options:%r[u(%q0/dash_line)]%r})][rjust(Delete:, 15)]%b%b[u(%q0/get_delete_option, %#)]%r[rjust(Format:, 15)]%b%b%q1%r[rjust(Autoforward:, 15)]%b%b[ulocal(%q0/get_autoforward_option, %#)]%r[rjust(Timeout:, 15)]%b%b[ulocal(%q0/get_timeout_option, %#)]%r[rjust(Separator:, 15)]%b%b[switch(u(%q0/get_separator_option, %#), %b, space, return)]%r[rjust(Aliases:, 15)]%b%b[ulocal(%q0/get_personal_aliases, %#)]%r[rjust(Filters:, 15)]%b%b[ulocal(%q0/get_filter_count, %#)]%r[rjust(Folders:, 15)]%b%b[ulocal(%q0/get_folders, %#)]%r[rjust(Inbox:, 15)]%b%b[secure(ulocal(%q0/get_inbox, %#))]%r[rjust(Current Folder:, 15)]%b%b[switch(words(%q2), 0, secure(ulocal(%q0/get_inbox, %#)), secure(get(%q2/current_folder)))]%r[rjust(Vacation:, 15)]%b%b[switch(words(%q2), 0, <none>, switch(get(%q2/vacation),, <none>, u(%q2/vacation)))]%r[rjust(Reject:, 15)]%b%b[switch(words(%q2), 0, <none>, switch(get(%q2/reject_msg),, <none>, u(%q2/reject_msg)))]%r[rjust(Filter Reject:, 15)]%b%b[switch(words(%q2),0, <none>,switch(get(%q2/filter_reject),, <none>, u(%q2/filter_reject)))][switch(%q1, standard, {%r[u(#300/equal_line)]})]
&MAIL_CREDITS #300=$+mail credits: @pemit %# = Credits:%r%r%b%bTesting help, moral support[space(9)]- Kelson of CrystalMUSH%r%b%bIdea for +unread, .signature %r%b%b%b%b+mark, +unmark [space(19)]- Anastasia of TooMUSH%r%b%bBug fixes, additional help text[space(5)]- Zalcor of Singlenesia%r%b%bSuggested improvements and patience - Ambar %r%b%bSpace option, author:<name>, subject:<text> keywords, +note and performance ideas%b - Amberyl %r%r%b%b+mail, -, --, +proof, +toss, +send, +skim, +read, +delete (clear), +edit%r%b%bwere written from scratch, without seeing his code, but based on the%r%b%buser interface of the mailer written by F'jon of PernMUSH, with%r%b%bnumerous enhancements.%r%r%b%bThe credit/blame for the rest of the commands, goes to Brandy of %r%b%bCrystalMUSH.%r%r%b%bThis +mail code is available via anonymous FTP from %r%b%bftp.tinymush.org (205.226.195.2) in file:%r%b%b/pub/mud/tinymush/mushcode/mail/brandy_mailer.14%r%r%b%b(source code last updated [v(mail_version)])%r
&MAIL_CHANGES #300=$+mail changes: @pemit %# = Changes since version 13:%r%rUpdated to use some new 2.2 functions%rSome bug fixes (see source file for details)%rNew flag 'forwarded' on +read and +skim%rNew command '+include <letter number or keyword>' %rNew command '+check mail/all' %rNew special folder 'null' mail filters, meaning auto-discard%rNew admin command '+verify mail config'%rNew admin command '+set mail option RGA = yes | no'
&ADD_PERSONAL_ALIAS #300=$+add personal alias *=*: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(5, get(%q0/alias-list))]1 = or(strmatch(escape(%0), *[*), strmatch(escape(%1), *[*)),{@pemit %# = u(nofunc)},strmatch(type(*[trim(%0)]), PLAYER),{@pemit %# = I'm sorry, but the alias you specified is the name of%ba player.},not(strmatch(type(%#), PLAYER)), {@pemit %# = u(not_player)}, eq(strlen(%0), 0),{@pemit %# = You must specify a name for the alias.},gt(words(%0), 1),{@pemit %# = The alias must be a single word.},gt(strlen(%0), 25), {@pemit %# = Sorry, personal alias names are restricted to a maximum of 25 characters.},gt(strlen([setq(2,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in alias name.},eq(strlen(%1), 0),{@pemit %# = You need to specify a list of people to associate with the alias.},eq(strlen(%q0), 0),{@swi/first [setq(1, [ulocal(identify_to_list, {%1}, %vm)] [u(get_aliases, {%1}, #0, get(%vm/global-mail-aliases), )])]%q1 = *ABORT*,{@pemit %# = secure(after(before(%q1, ENDABORT), ABORT))},{@create %N's Mailbox; @set [setq(2, con(me))]%q2 = quiet; @drain %q2; &debug_mail %q2 = +add personal alias %0=%1; @tel %q2 = %vm; &mailbox_%# %vm = %q2; @tr %vm/add_mailbox = %q2; &owner_dbref %q2 = %#; @startup %q2 = {@drain me; @no me}; @set %q2 = safe; &mail-in-progress %q2 = false; &current_folder %q2 = ulocal(get_inbox, %#); &folder-list %q2 = get(%q2/current_folder); &alias-list %q2 = [setq(3, lcstr(trim(%0)))]%q3; &alias-%q3 %q2 = %q1; @pemit %# = '%q3' has been added as a personal mail alias.;@no %q2}},{@wait %q0 = {&debug_mail %q0 = +add personal alias %0=%1; @swi/first [setq(1,[ulocal(identify_to_list, {%1}, %q0)] [u(get_aliases, {%1}, %q0, get(%vm/global-mail-aliases), %q5)])][setq(3, lcstr(trim(%0)))]1 = gt(match(%q5, %q3), 0),{@pemit %# = You already have a personal alias with this name. If you really mean to totally overwrite it, you should do a +remove personal alias %q3, followed by a +add personal alias%b%q3=<list of people>.; @no %q0},strmatch(%q1, *ABORT*),{@pemit %# = secure(after(before(%q1, ENDABORT), ABORT)); @no %q0},{&alias-list %q0 = %q5 %q3; &alias-%q3 %q0 = %q1; @pemit %# = '%q3' has been added as a personal mail alias.; @no %q0}}}
&ADD_PERSONAL_ALIAS_BLANK #300=$+add personal alias: @pemit %# = The syntax is +add personal alias <alias>=<list of people>.&ADD_ALIAS_BLANK #300=$+add alias: @pemit %# = There are two varieties of mail distribution lists (aliases): personal and global. Personal aliases may be used only by you. Global aliases may be used by all. The syntax is:%r%r+add personal alias <alias>=<list of people> -or-%r+add global alias <alias>=<list of people>
&LIST_PERSONAL_ALIASES #300=$+list personal a*: @swi/first [setq(0, get(%vm/mailbox_%#))]strlen(%q0) = 0, {@pemit %# = You have no personal mail aliases defined.},{@wait %q0 = {&debug_mail %q0 = +list personal aliases; @pemit %# = [setq(1, get(%q0/alias-list))][setq(2, u(get_format_option, get(%#/mail_config_options)))]switch(strlen(%q1), 0, You have no personal mail aliases defined.,{[switch(%q2, standard, {[u(equal_line)]%rList of [name(%#)]'s personal mail aliases:%r[u(dash_line)]%r})][iter(%q1, [lcstr(##)][switch(type(*##), PLAYER, {%b-%b( Warning: there is a player%bwith this name, therefore using this alias will send to%bthat player instead%b)%b})])][switch(%q2, standard, {%r[u(equal_line)]})]}); @no %q0}}
&LIST_ALIASES_BLANK #300=$+list alias*: @pemit %# = There are two varieties of mail distribution lists (aliases): personal and global. Personal aliases may be used only by you. Global aliases may be used by all. The syntax is:%r%r+list personal aliases -or-%r+list global aliases
&EXPAND_PERSONAL_ALIAS #300=$+expand personal alias *: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strlen(%q0),{@pemit %# = You do not have a personal mail alias defined with that name.},eq(strlen([setq(2,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in alias name.},{@wait %q0 = {&debug_mail %q0 = +expand personal alias %0; @pemit %# = [setq(1, get(%q0/alias-list))][setq(2, u(get_format_option, get(%#/mail_config_options)))][setq(3, get(%vm/global-mail-aliases))][setq(4, get(%q0/alias-%0))]switch(or(eq(strlen(%q1), 0), eq(match(%q1, %0), 0)), 1, You do not have a personal mail alias defined with that name.,{[switch(%q2, standard, {[u(equal_line)]%rExpansion of %N's personal mail alias '[lcstr(%0)]':[switch(type(*##), PLAYER, {%rWARNING: there is a player%bwith this name, therefore using this alias will send to%bthat player instead%b)%b})]%r[u(dash_line)]%r})][u(pretty_dist, u(get_aliases, {%q4}, %q0, %q3, %q1), %q0, %q1, %q3, u(snag_dbrefs, %q4))][switch(%q2, standard, {%r[u(equal_line)]})]}); @no %q0}}
&EXPAND_PERSONAL_ALIAS_BLANK #300=$+expand personal alias: @pemit %# = The syntax is +expand personal alias <alias>.
&EXPAND_ALIAS_BLANK #300=$+expand alias: @pemit %# = There are two varieties of mail distribution lists (aliases): personal and global. Personal aliases may be used only by you. Global aliases may be used by all. The syntax is:%r%r+expand personal alias <alias> -or-%r+expand global alias <alias>
&REMOVE_PERSONAL_ALIAS #300=$+remove personal alias *: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = or(eq(strlen(%0), 0), eq(strlen(%q0), 0)),{@pemit %# = You do not have a personal mail alias defined with that name.},gt(strlen([setq(2,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in alias name.},{@wait %q0 = {&debug_mail %q0 = +remove personal alias %0; @swi/first [setq(1, get(%q0/alias-list))][setq(2, lcstr(%0))]or(eq(strlen(%q1), 0), eq(match(%q1, %0), 0)) = 1,{@pemit %# = You do not have a personal mail alias defined with that name.; @no %q0},{&alias-list %q0 = squish(remove(%q1, %q2)); &alias-%0 %q0 = ; @pemit %# = '%q2' has been removed from your list of personal mail aliases.; @no %q0; }}}
&REMOVE_PERSONAL_ALIAS_BLANK #300=$+remove personal alias: @pemit %# = The syntax is +remove personal alias <alias>.
&REMOVE_ALIAS_BLANK #300=$+remove alias: @pemit %# = There are two varieties of mail distribution lists (aliases): personal and global. Personal aliases may be used only by you. Global aliases may be used by all. The syntax is:%r%r+remove personal alias <alias> -or-%r+remove global alias <alias>
&EDIT_PERSONAL_ALIAS #300=$+edit personal alias *=*/*: @swi/first [setq(0, get(%vm/mailbox_%#))]0 = strlen(%q0), {@pemit %# = You do not have a personal mail alias defined with that name.},eq(strlen([setq(2,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in alias name.},{@wait %q0 = {&debug_mail %q0 = +edit personal alias %0=%1/%2; @swi/first [setq(1, lcstr(trim(%0)))][setq(2, lcstr(trim(%1)))][setq(3, trim(%2))][setq(4, u(purify_alias_list, get(%q0/alias-%q1)))][setq(5, get(%q0/alias-list))][setq(6, get(%vm/global-mail-aliases))][setq(7, lcstr(u(pretty_dist, u(get_aliases, %q4, %q0, %q6, %q5), %q0, %q5, %q6, u(snag_dbrefs, %q4))))]1 = eq(strlen(%q1), 0),{@pemit %# = You must specify a name for the alias you wish to edit.; @no %q0},gt(words(%q1), 1), {@pemit %# = The alias must be a single word.; @no %q0},eq(match(%q5, %q1), 0), {@pemit %# = You do not have a personal mail alias defined with that%bname.; @no %q0},eq(words(%q4), 0),{@tr me/cleanup_edit_mail_palias = %#, %q3, %q0, %q1},strmatch(%q2, $), {@tr me/cleanup_edit_mail_palias = %#,u(clean_dist, {%q4, %q3}), %q0,%q1},strmatch(%q2, ^), {@tr me/cleanup_edit_mail_palias = %#,u(clean_dist, {%q3, %q4}), %q0,%q1},strmatch(%q7, *%q2*), {@tr me/cleanup_edit_mail_palias = %#,u(clean_dist, edit(%q7, %q2, %q3)), %q0, %q1}, {@pemit %# = Unable to find '%q2' in current value for personal alias '%q1'.%b Please check the exact format by doing a '+expand personal alias %q1'.; @no %q0}}}
&CLEANUP_EDIT_MAIL_PALIAS #4167=@swi/first [setq(1, ulocal(identify_to_list, {%1}, %2))][setq(2, get(%vm/global-mail-aliases))][setq(3, get(%2/alias-list))][setq(4, u(get_aliases, {%1}, %2, %q2, %q3))]%q1 = *ABORT*, {@pemit %0 = secure(after(before(%q1, ENDABORT), ABORT)); @no %2},{&alias-%3 %2 = %q1 %q4; @pemit %0 = switch(words(%q1 %q4), 0, {No names are associated with the specified alias.}, {Your '%3' personal alias has been updated and is now set to:%b [u(pretty_dist, %q4, %2, %q3, %q2, %q1)]}); @no %2}

&LIST_GLOBAL_ALIASES #300=$+list global a*: @swi/first [setq(0, get(%vm/global-mail-aliases))]strlen(%q0) = 0, {@pemit %# = There are no global mail aliases defined.},{@pemit %# = [setq(1, u(get_format_option, get(%#/mail_config_options)))][switch(%q1, standard, {[u(equal_line)]%rList of global mail aliases:%r[u(dash_line)]%r})][iter(%q0, [lcstr(##)][switch(type(*##), PLAYER, {%b-%b( Warning:%b there is a player%bwith this name, therefore using this alias will send to%bthat player instead%b)%b})])][switch(%q1, standard, {%r[u(equal_line)]})]; }
&ADD_GLOBAL_ALIAS #300=$+add global alias *=*: @wait %vm = {&debug_mail %vm = +add global alias %0=%1; @swi/first [setq(0, lcstr(trim(%0)))][setq(1, trim(%1))][setq(2, get(%vm/global-mail-aliases))]1 = or(strmatch(escape(%0), *[*), strmatch(escape(%1), *[*)),{@pemit %# = u(nofunc); @no %vm},and(get(#7/default_rga_option), not(hasflag(%#, wizard))), {@pemit %# = I'm sorry, creation of global aliases has been restricted to wizards.; @no %vm},strmatch(type(*%q0), PLAYER),{@pemit %# = I'm sorry, the alias you specified is the name of a%bplayer.; @no %vm},not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player); @no %vm},eq(strlen(%q0), 0),{@pemit %# = You must specify a name for the global alias.; @no %vm},gt(strlen(%q0), 14), {@pemit %# = Sorry, global alias names are restricted to a maximum of 14 characters.;@no %vm},gt(strlen([setq(4,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q4), 0),{@pemit %# = Invalid character(s) %q4 detected in alias name.; @no %vm},gt(words(%q0), 1), {@pemit %# = The global alias must be a single word.; @no %vm},eq(strlen(%q1), 0),{@pemit %# = You need to specify a list of people to associate%bwith the global alias.; @no %vm},gt(match(%q2, %q0), 0),{@pemit %# = A global already exists with this name.; @no %vm},{@swi/first [setq(3, [ulocal(identify_to_list, {%q1}, %vm)] [u(get_aliases, {%q1}, %0, %q2, )])]%q3 = *ABORT*,{@pemit %# = secure(after(before(%q3, ENDABORT), ABORT)); @no %vm},{&global-mail-aliases %vm = %q2 %q0; &alias-%q0 %vm = %q3; @pemit %# = '%q0' has been added as a global mail alias.; &alias-%q0-created-by %vm = %# %N on [time()]; @no %vm}}}
&ADD_GLOBAL_ALIAS_BLANK #300=$+add global alias: @pemit %# = The syntax is +add global alias <alias>=<list of people>.
&EXPAND_GLOBAL_ALIAS #300=$+expand global alias *: @swi/first [setq(0, get(%vm/global-mail-aliases))]1 = gt(strlen([setq(1,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q1), 0),{@pemit %# = Invalid character(s) %q1 detected in alias name.},or(eq(strlen(%0), 0), eq(strlen(%q0), 0), eq(match(%q0, %0), 0)),{@pemit %# = There is no global mail alias defined with that name.},{@pemit %# = [setq(1, u(get_format_option, get(%#/mail_config_options)))][setq(2, get(%vm/alias-%0))][switch(%q1, standard, {[u(equal_line)]%rExpansion of global mail alias '[lcstr(%0)]'%r( Last modified by [rest(get(%vm/alias-%0-created-by))] )[switch(type(*%0), PLAYER, {%rWARNING: there is a player%bwith this name, therefore using this alias will send to%bthat player instead%b)%b})]%r[u(dash_line)]%r})][u(pretty_dist, u(get_aliases, {%q2}, %vm, %q0, , ), %vm, , %q0, u(snag_dbrefs, %q2))][switch(%q1, standard, {%r[u(equal_line)]})]; }
&EXPAND_GLOBAL_ALIAS_BLANK #300=$+expand global alias: @pemit %# = The syntax is +expand global alias <alias>.
&EDIT_GLOBAL_ALIAS #300=$+edit global alias *=*/*: @wait %vm = {&debug_mail %vm = +edit global alias %0=%1/%2; @swi/first [setq(0, trim(lcstr(%0)))][setq(1, lcstr(trim(%1)))][setq(2, trim(%2))][setq(4, u(purify_alias_list, get(%vm/alias-%q0)))][setq(6, get(%vm/global-mail-aliases))][setq(7, lcstr(u(pretty_dist, u(get_aliases, %q4, #0, %q6, ), #0, , %q6, u(snag_dbrefs, %q4))))]1 = gt(strlen([setq(5,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q5), 0),{@pemit %# = Invalid character(s) %q5 detected in alias name.; @no %vm},[or(eq(strlen(%q0), 0),eq(strlen(%q6), 0),eq(match(%q6, lcstr(%q0)), 0))],{@pemit %# = There is no global mail alias defined with that name.; @no %vm},not(or(hasflag(%#, wizard),strmatch(%#,first(get(%vm/alias-%q0-created-by))))),{@pemit %# = I'm sorry, you may only edit global mail aliases%bthat you added. If you still desire to have the alias modified,%bplease contact the person who added the alias, or a wizard.; @no %vm},eq(words(%q4), 0),{@tr me/cleanup_edit_mail_galias = %#, %q2, %q0},strmatch(%q1, $),{@tr me/cleanup_edit_mail_galias = %#, u(clean_dist, {%q4, %q2}), %q0},strmatch(%q1, ^),{@tr me/cleanup_edit_mail_galias = %#, u(clean_dist, {%q4, %q2}), %q0},strmatch(%q7, *%q1*), {@tr me/cleanup_edit_mail_galias =%#,u(clean_dist, edit(%q7, %q1, %q2)), %q0},{@pemit %# = Unable to find '%q1' in current value for global alias '%q0'.%b Please check the exact format by doing a '+expand global alias %q0'.; @no %vm}}
&CLEANUP_EDIT_MAIL_GALIAS #4167=@swi/first [setq(1, ulocal(identify_to_list, {%1}, %vm))][setq(2, get(%vm/global-mail-aliases))][setq(3, u(get_aliases, {%1}, #0, %q2, ))]%q1 = *ABORT*, {@pemit %0 = secure(after(before(%q1, ENDABORT), ABORT)); @no %vm}, {&alias-%2 %vm = %q1 %q3; &alias-%2-created-by %vm = %0 [name(%0)] on [time()]; @pemit %0 = switch(words(%q1 %q3), 0, {No names are associated with the specified alias.}, {The '%2' global alias has been updated and is now set to:%b [u(pretty_dist, %q3, #0, , %q2, %q1)]}); @no %vm}
&SNAG_DBREFS #4167 = iter(%0, switch(##+[type(##)], #*+PLAYER, ##, ))
&REMOVE_GLOBAL_ALIAS #300=$+remove global alias *: @wait %vm = {&debug_mail %vm = +remove global alias %0; @swi/first 1 = [setq(0, get(%vm/global-mail-aliases))][setq(1, lcstr(trim(%0)))]gt(strlen([setq(2,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in alias name.; @no %vm},or(eq(strlen(%0), 0),eq(strlen(%q0), 0),eq(match(%q0, %0), 0)),{@pemit %# = There is no global mail alias defined with that name.; @no %vm},or(hasflag(%#, wizard),strmatch(%#, first(get(%vm/alias-%q1-created-by)))),{&global-mail-aliases %vm = squish(remove(%q0, %q1)); &alias-%0 %vm = ; &alias-%q1-created-by %vm = ; @pemit %# = '%q1' has been removed from the list of global mail aliases.; @no %vm},{@pemit %# = I'm sorry, you may only remove global mail aliases%bthat you added. If you still desire to have the alias removed,%bplease contact the person who added the alias, or a wizard.; @no %vm}}
&REMOVE_GLOBAL_ALIAS_BLANK #300=$+remove global alias: @pemit %# = The syntax is +remove global alias <alias>.
&LIST_FOLDERS #300=$+list folders: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(3, u(get_format_option, get(%#/mail_config_options)))]strlen(%q0) = 0,{@pemit %# = [switch(%q3, standard,{[u(equal_line)]%rList of %N's folders:%r%r})]Folder Name[space(5)]D-flag[space(5)]Marked[space(6)]Saved[space(2)]Timed Out[space(5)]Unread[space(6)]Total%r[u(dash_line)]%r[ljust(secure(ulocal(get_inbox, %#)), 21)]0[space(10)]0[space(10)]0[space(10)]0[space(10)]0[space(10)]0[switch(%q3, standard, {%r[u(equal_line)]})]},{@wait %q0 = {&debug_mail %q0 = +list folders; @pemit %# = [switch(%q3, standard, {[u(equal_line)]%rList of %N's folders:%r})]Folder Name[space(5)]D-flag[space(5)]Marked[space(6)]Saved[space(2)]Timed Out[space(5)]Unread[space(6)]Total%r[u(dash_line)]; &folder-list %q0 = squish(remove(get(%q0/folder-list), null)); @dolist get(%q0/folder-list) = {@pemit %# = [setq(2, get(%q0/in-list-##))][ljust(secure(lcstr(##)), 17)][switch(strlen(%q2), 0, [space(4)]0[space(10)]0[space(10)]0[space(10)]0[space(10)]0[space(10)]0, {[rjust(u(count_deleted_letters, %q0, %q2), 5)][rjust(u(count_marked_letters, %q0, %q2), 11)][rjust(u(count_saved_letters, %q0, %q2), 11)][rjust(ulocal(count_timed_out_letters, %q0, %q2), 11)][rjust(u(count_unread_letters, %q0, %q2), 11)][rjust(words(%q2), 11)]})]}; @swi 1 = 1,{@pemit %# = %rSelected folder:%b [u(get_active_folder, %q0)][switch(%q3, standard, {%r[u(equal_line)]})]; @no %q0}}}
&MOVE_LETTER_TO_FOLDER #300=$+move* to *: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(5, lcstr(edit(trim(%1), %b, $)))]0 = strmatch(type(%#), PLAYER),{@pemit %# = u(not_player)},not(or(strmatch(escape(%0), *[*), strmatch(escape(%1), *[*))),{@pemit %# = u(nofunc)},strlen(%q0), {@pemit %# = u(nomail, ulocal(get_inbox, %#))},not(strmatch(%1, null)), {@pemit %# = Gimme a break, just +delete it. \;)}, eq(strlen([setq(2,[setq(3, %1)]filter(check_for_bad_chars, v(bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in folder name.},{@wait %q0 = {&debug_mail %q0 = +move%0 to %1; @swi/first [setq(6, u(get_folder_in_list, %q0))][setq(1, ulocal(expand_letter_range,%0,%q6, u(get_folder_current_letter, %q0)))][setq(1, u(filter_list, setunion(%q1, ), %q6))][setq(2, match(%q6, last(%q1)))][setq(2, switch(last(%q1), last(%q6), first(%q6), extract(%q6, add(%q2, 1), 1)))][setq(3, u(convert_nums, %q1, %q6))]0 = strlen(%1),{@pemit %# = You must specify a destination folder to move the mail to.; @no %q0},lte(strlen(%1), 16),{@pemit %# = Folder name specified is too long (maximum of 16 characters).; @no %q0},words(%q6),{@pemit %# = u(nomail, u(get_active_folder, %q0)); @no %q0},not(strmatch(%q1, *ABORT*)),{@pemit %# = after(before(%q1, ENDABORT), ABORT); @no %q0},words(%q1), {@pemit %# = u(no_match, +move, ulocal(format_request, trim(%0)), u(get_active_folder, %q0)); @no %q0},not(strmatch(%q5, get(%q0/current_folder))), {@pemit %# = The folder specified to move the letter(s) to is the current folder ([u(get_active_folder, %q0)]), no action needed.; @no %q0},match(get(%q0/folder-list), %q5), {&folder-list %q0 = get(%q0/folder-list) %q5; &in-list-%q5 %q0 = %q1; &current_letter-%q5 %q0 = first(%q1); &[setq(7, u(which_in_list, %q0))]%q7 %q0 = u(filter_list, setdiff(%q6, %q1), %q6); &[setq(8, u(which_current_letter, %q0))]%q8 %q0 = switch(member(get(%q0/%q7), %q2), 0, first(get(%q0/%q7)), %q2); @pemit %# = Message(s) %q3[ulocal(format_request, trim(%0))] moved from folder '[u(get_active_folder, %q0)]' to newly created folder '[lcstr(%1)]'.; @no %q0}, {&in-list-%q5 %q0 = squish([get(%q0/in-list-%q5)] %q1);&current_letter-%q5 %q0 = first(get(%q0/in-list-%q5)); &[setq(7, u(which_in_list, %q0))]%q7 %q0 = u(filter_list, setdiff(%q6, %q1), %q6); &[setq(8, u(which_current_letter, %q0))]%q8 %q0 = switch(member(get(%q0/%q7), %q2), 0, first(get(%q0/%q7)), %q2); @pemit %# = Message(s) %q3[ulocal(format_request, trim(%0))] moved from folder '[u(get_active_folder, %q0)]' to folder '[lcstr(%1)]'.; @no %q0}}}
&MOVE_NO_PARAM #300=$+move:@pemit %# = There are two ways to +move one or more letters to another folder.%r%r1) +move to <folder name> - will move the current letter to the specified folder (example:%b +move to things to do)%r%r2) +move <keyword or list of letters> to <folder name> - will move the specified letters to the named folder.%r%rThe folder will be created if it doesn't already exist.%b See '+help move' for more details.
&ADD_FOLDER #300=$+add folder *: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(1, edit(lcstr(%0), %b, $))]1 = strmatch(escape(%0), *[*),{@pemit %# = u(nofunc)},not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},eq(strlen(%0), 0),{@pemit %# = You must specify a name for the folder.},strmatch(%0, null),{@pemit %# = Sorry, you cannot create a folder with the name of 'null'.},gt(strlen([setq(2, [setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in folder name.},gt(strlen(%0), 16),{@pemit %# = Folder name specified is too long (maximum of 16 characters).},eq(strlen(%q0), 0),{@create %N's Mailbox; @set [setq(2, con(me))]%q2 = quiet; @drain %q2; &debug_mail %q2 = +add folder %0; @tel %q2 = %vm; &mailbox_%# %vm = %q2; @tr %vm/add_mailbox = %q2; &owner_dbref %q2 = %#; @startup %q2 = {@drain me; @no me}; @set %q2 = safe; &mail-in-progress %q2 = false; &folder-list %q2 = setunion(%q1, ulocal(get_inbox, %#)); &current_folder %q2 = ulocal(get_inbox, %#); @pemit %# = '[secure(%q1)]' has been added as a folder.;@no %q2},{@wait %q0 = {&debug_mail %q0 = +add folder %0; @pemit %# = [setq(4, remove(get(%q0/folder-list), null))]switch(gt(match(%q4, %q1), 0), 1, You already have a folder with this name., '[secure(%q1)]' has been added as a folder.); &folder-list %q0 = setunion(%q4 %q1, ); @no %q0}}
&REMOVE_FOLDER #300=$+remove folder*: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(2, lcstr(edit(trim(%0), %b, $)))]1 = strmatch(escape(%0), *[*),{@pemit %# = u(nofunc)},strmatch(%q2, ulocal(get_inbox, %#)),{@pemit %# = You are not allowed to remove the designated 'inbox' folder.},eq(words(%0), 0), {@pemit %# = You must specify a name for the folder.},eq(strlen(%q0), 0), {@pemit %# = You do not have a folder defined with that name.},not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},gt(strlen(%q0), 16),{@pemit %# = Folder name specified is too long (maximum of 16 characters).},gt(strlen([setq(1,[setq(3, trim(%0))]filter(check_for_bad_chars, v(bad_chars)))]%q1), 0),{@pemit %# = Invalid character(s) %q1 detected in folder name.},{@wait %q0 = {&debug_mail %q0 = +remove folder%0; @swi/first 1 = [setq(1, get(%q0/folder-list))]or(eq(strlen(%q1), 0), eq(match(%q1, %q2), 0)),{@pemit %# = You do not have a folder defined with that name.; @no %q0},sign(strlen(get(%q0/in-list-%q2))),{@pemit %# = The folder specified is not empty and therefore cannot be removed.; @no %q0},{&folder-list %q0 = squish(remove(%q1, %q2)); &in-list-%q2 %q0 = ; &current_letter-%q2 %q0 = ; &current_folder %q0 = [setq(3, get(%q0/current_folder))]switch(%q2, %q3, ulocal(get_inbox, %#), %q3); @pemit %# = '[lcstr(trim(%0))]' has been removed from your list of folders.[switch(%q2, %q3,%b '[get(%q0/current_folder)]' is now the active folder)]; @no %q0}}}
&SELECT_FOLDER #300=$+select folder *: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(2, lcstr(edit(%0, %b, $)))]1 = strmatch(escape(%0), *[*),{@pemit %# = u(nofunc)},eq(strlen(%0), 0), {@pemit %# = You must specify a name for the folder.},strmatch(%0, null),{@pemit %# = 'null' is an invalid folder name.},and(eq(strlen(%q0), 0), strmatch(%0, secure(ulocal(get_inbox, %#)))),{@pemit %# = '[lcstr(%0)]' is already the selected folder.},eq(strlen(%q0), 0), {@pemit %# = You do not have a folder defined with that name.},not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},gt(strlen(%0), 16),{@pemit %# = Folder name specified is too long (maximum of 16 characters).},gt(strlen([setq(1,[setq(3, %0)]filter(check_for_bad_chars, v(bad_chars)))]%q1), 0),{@pemit %# = Invalid character(s) %q1 detected in folder name.},{@wait %q0 = {&debug_mail %q0 = +select folder %0; @swi/first [setq(1, get(%q0/folder-list))]eq(match(%q1, %q2), 0) = 1, {@pemit %# = You do not have a folder defined with that name.; @no %q0},{@pemit %# = switch(get(%q0/current_folder), %q2, '[lcstr(%0)]' is already the selected folder., '[lcstr(%0)]' is now the selected folder.); &current_folder %q0 = %q2; @no %q0}}}
&ADD_FILTER #300=$+add filter *=* folder*=*: @swi/first [setq(0, get(%vm/mailbox_%#))][setq(1, edit(lcstr(trim(%3)), %b, $))][setq(4, switch(trim(%0), s*, subject, a*, author, error))]1 = strmatch(%3, *reject*=*),,or(strmatch(escape(%0), *[*), strmatch(escape(%1), *[*), strmatch(escape(%3), *[*)), {@pemit %# = u(nofunc)},not(strmatch(type(%#), PLAYER)),{@pemit %# = u(not_player)},strmatch(%q4, error),{@pemit %# = You must specify the type of filter, author or subject.%b (syntax:%b +add filter author|subject=<name or text> folder=<folder name>)},eq(words(%1), 0),{@pemit %# = You must specify [switch(%q4, author, A player name to filter on, Some text to filter based on subject line)].%b (syntax:%b +add filter author|subject=<name or text> folder=<folder name>)}, and(strmatch(%q4, author), not(strmatch(type(*%1), PLAYER))),{@pemit %# = Name specified to filter based on author is not an existing player.},eq(words(%3), 0),{@pemit %# = You must specify a name for the folder.},gt(strlen([setq(2, [setq(3, %3)]filter(check_for_bad_chars, v(bad_chars)))]%q2), 0),{@pemit %# = Invalid character(s) %q2 detected in folder name.},gt(strlen(%3), 16),{@pemit %# = Folder name specified is too long (maximum of 16 characters).},eq(strlen(%q0), 0),{@create %N's Mailbox; @set [setq(2, con(me))]%q2 = quiet; @drain %q2; &debug_mail %q2 = +add filter %0=%1 folder%2=%3; @tel %q2 = %vm; &mailbox_%# %vm = %q2; @tr %vm/add_mailbox = %q2; &owner_dbref %q2 = %#; @startup %q2 = {@drain me; @no me}; @set %q2 = safe; &mail-in-progress %q2 = false; &%q4_filter %q2 = [switch(%q4, author, [num(*%1)], %1)]|%q1; &current_folder %q2 = ulocal(get_inbox, %#); @pemit %# = Filter added.; @no %q2},{@wait %q0 = {&debug_mail %q0 = +add filter %0=%1 folder%2=%3; &%q4_filter %q0 = trim([get(%q0/%q4_filter)]~[switch(%q4, author, [num(*%1)], %1)]|%q1,,~); @pemit %# = Filter added.; @no %q0}}
&REMOVE_FILTER #300=$+remove filter*: @swi/first [setq(0, get(%vm/mailbox_%#))]1 = strmatch(escape(%0), *[*),{@pemit %# = u(nofunc)},eq(words(%0), 0), {@pemit %# = You must specify which filter to remove.},eq(strlen(%q0), 0), {@pemit %# = You have no filters defined.},or(not(strmatch(trunc(%0), trim(%0))),lt(%0, 1),not(isnum(%0))),{@pemit %# = You must enter a non-zero integer.%b See +list filters for a list of valid numbers.}, {@wait %q0 = {&debug_mail %q0 = +remove filter%0; @swi/first 1 = [setq(1, get(%q0/author_filter))][setq(2, get(%q0/subject_filter))]gt(%0, add(words(%q1, ~), words(%q2, ~))), {@pemit %# = Filter specified does not exist.; @no %q0},gt(%0, words(%q1, ~)), {&subject_filter %q0 = ldelete(%q2, sub(%0, words(%q1, ~)), ~); @pemit %# = Subject filter removed.; @no %q0}, {&author_filter %q0 = ldelete(%q1, %0, ~);@pemit %# = Author filter removed.;@no %q0} }}
&LIST_FILTERS #300=$+list filters: @swi/first [setq(0, get(%vm/mailbox_%#))]strlen(%q0) = 0,{@pemit %# = You have no filters defined.},{@wait [setq(1, get(%q0/author_filter))][setq(2, get(%q0/subject_filter))][setq(3, u(get_format_option, get(%#/mail_config_options)))]%q0 = {&debug_mail %q0 = +list filters; @pemit %# = switch(add(words(%q1, ~), words(%q2, ~)), 0, You have no filters defined.,{[switch(%q3, standard, {[u(equal_line)]%r[center(List of Mail Filters, 78)]%r})][space(6)]Type[space(5)]Value[space(41)]Folder%r[u(dash_line)][iter(%q1, %r[rjust(member(%q1, ##, ~), 3)]\\)%b%bauthor%b%b%b[ljust(switch(type(before(##, |)), PLAYER, name(before(##, |)), destroyed player), 46)][ljust(secure(after(##, |)), 16)][switch(after(##, |), null, {%b\(discard\)},)],~)][iter(%q2, %r[rjust(add(words(%q1, ~), member(%q2, ##, ~)), 3)]\\)%b%bsubject%b%b[ljust(before(##, |), 46)][ljust(secure(after(##, |)), 16)][switch(after(##, |), null, {%b\(discard\)},)],~)][switch(%q3, standard, {%r[u(equal_line)]})]}); @no %q0}}
&GENERIC_INFO_RECORD #7=
&GENERIC_MAILBOX #7=
&PROCESS_INFO_RECORD #7=
&ADD_MAILBOX #7 = @swi/first [setq(0, v(mailboxes_num_of_attributes))][setq(1, add(1, v(mailboxes_num_of_attributes)))]gt(strlen(v(mailboxes_%q0)), v(overflow_point)) = 1, {&mailboxes_num_of_attributes me = %q1; &mailboxes_%q1 me = [v(mailboxes_%q1)] %0}, {&mailboxes_%q0 me = sort([v(mailboxes_%q0)] %0, d)}
&MAKE_MAILBOX #7=@swi/first [setq(0, num(*%0))][setq(1, name(%q0))]0 = strmatch(type(%q0), PLAYER),{@pemit %1 = [capstr(%0)] is not a player.},strlen(v(mailbox_%q0)),{@create %q1's Mailbox; @set [setq(2, con(me))]%q2 = quiet; @drain %q2; &debug_mail %q2 = make mailbox; @tel %q2 = me; &mailbox_%q0 me = %q2; @tr %vm/add_mailbox = %q2; &owner_dbref %q2 = %q0; @startup %q2 = {@drain me; @no me}; @set %q2 = safe; &mail-in-progress %q2 = false; &current_folder %q2 = ulocal(#300/get_inbox, %q0); &folder-list %q2 = get(%q2/current_folder); @no %q2; @pemit %1 = Mailbox created for %q1.},{@pemit %1 = %q1 already has a mailbox.}
&MAKE_MAILBOX2 #7=
&DESTROY_MAILBOX #7=@wait me = {&debug_mail me = destroy mailbox - parameters: %0, %1, %2, %3; &mailbox_[setq(0, switch(isdbref(%0), 1, %0, num(*%0)))][setq(1, v(mailbox_%q0))]%q0 me=switch(get(%q1/owner_dbref), %q0,,v(mailbox_%q0)); @swi/first strlen(%q1) = 0, {@swi/first %2 = 0,{@pemit %1 = [name(%q0)] does not have a mailbox.; @no me},{@dolist lnum(v(mailboxes_num_of_attributes)) = {&mailboxes_[add(1, ##)] me = squish(remove(v(mailboxes_[add(1, ##)]), %2))}; @swi 1 = 1, {&weird_mailboxes me = [v(weird_mailboxes)] %q1/%2:%0-%1-%2-%3; @no me}}},{@swi/first and(strmatch(get(%q1/owner_dbref), %q0),or(strmatch(%2, 0),strmatch(%2, %q1))) = 1,{@dolist u(#300/get_all_in_lists, %q1) = {@tr #300/remove_letter = u(#300/get_src_dbref, %q1, ##), u(#300/get_src_num, %q1, ##), get(%q1/owner_dbref), %q1, ##, %b,+destroy mailbox}; @dolist get(%q1/out-list) = {@tr #300/retract_main = num(me), %q1, ##, %b}; @dolist lnum(v(mailboxes_num_of_attributes)) = {&mailboxes_[add(1, ##)] me = squish(remove(v(mailboxes_[add(1, ##)]), %q1))}; @swi 1 = 1, {@swi 1 = 1, {@swi 1 = 1, {@destroy/override %q1; @pemit %1 = Mailbox for [name(%q0)] has been destroyed.; @no me}}}},{@pemit %1 = WARNING: mailbox_%q0 on the master mailbox does%bnot appear to contain the dbref of a mailbox object for the%bspecified player. Therefore, the 'mailbox' was NOT%bdestroyed. Someone should look into this. The mailbox has been moved to attribute 'weird_mailboxes' on the Master Mailbox.; @dolist lnum(v(mailboxes_num_of_attributes)) = {&mailboxes_[add(1, ##)] me = squish(remove(remove(v(mailboxes_[add(1, ##)]), %q1), %2))}; @swi 1 = 1, {&weird_mailboxes me = [v(weird_mailboxes)] %q1/%2:%0-%1-%2-%3; @no me}}}}
@startup #7 = @drain me; @no me; @wait u(how_long_til_purge) = @tr me/periodic_letter_purge; @dolist v(global-mail-aliases)={&alias-## me=s(u(cleanup_one_alias, ##))}
&cleanup_one_alias #7=iter(v(alias-%0), switch(strmatch(type(##), PLAYER), 1, ##,))
&HOW_LONG_TIL_PURGE #7 =[setq(0, v(day_[first(time())]))][setq(1, v(day_[mid(v(default_purge_time), 0, 3)]))][setq(2, mul(mid(extract(time(), 4, 1), 0, 2), 60))][setq(3, mul(mid(first(rest(v(default_purge_time))), 0, 2), 60))][setq(4, mid(extract(time(), 4, 1), 3, 2))][setq(5, mid(first(rest(v(default_purge_time))), 3, 2))][setq(6, add(%q2, %q4))][setq(7, add(%q3, %q5))]switch([eq(%q0, %q1)]+[gt(%q7, %q6)],1+1,mul(sub(%q7, %q6), 60),1+0,sub(604800, mul(sub(%q6, %q7), 60)),add(mul(u(full_days, %q0, %q1), 86400),mul(%q7, 60),mul(sub(1440, %q6), 60)))
&DAY_MON #7=1
&DAY_TUE #7=2
&DAY_WED #7=3
&DAY_THU #7=4
&DAY_FRI #7=5
&DAY_SAT #7=6
&DAY_SUN #7=7
&FULL_DAYS #7 =switch(gt(%0, %1),1,add(sub(6, %0), %1),sub(sub(%1, %0), 1))
&PERIODIC_LETTER_PURGE #7 = @swi/first v(default_timeout_option) = 0,{@wait 604800 = @tr me/periodic_letter_purge},{@tr me/purge_old_letters = first(v(mailboxes_1)), #7, 1, 1, v(mailboxes_1)}
&PURGE_OLD_LETTERS #7 = @wait me = {&debug_mail me = purge_old_letters; @swi/first type(get(%0/owner_dbref)) = PLAYER, {@pemit %1 = Scanning [name(get(%0/owner_dbref))]'s mailbox for messages which have timed out.; @va me = u(#300/grab_timeout_value, get(%0/message_timeout), v(default_timeout_option)); @swi/first %va = 200000000,{@pemit %1 = %tTimeout capability disabled.; @tr me/move_to_next_mailbox = %1, %2, %3, %4; @va me = ; @no me},{@vb me = secs(); @vc me = 0; @swi gte(sub(%vb, convtime(get(get(%0/owner_dbref)/last))), %va) = 1,{@wipe %0/mail-in-progress-*;&mail-in-progress %0 = false}; @dolist [iter(get(%0/folder-list), u(grab_letters, %0, ##))] ZZ = {@swi/first 1 = [setq(0, before(##, ~))][setq(1, after(##, ~))][setq(2, get(%0/in-%q0-time_read))][setq(3, strmatch(%q2, 0))][setq(4, eq(match(get(%0/in-%q0-flags), S), 0))][setq(5, gte(sub(%vb, convtime(get(u(get_src_dbref, %0, %q0)/out-[u(get_src_num, %0, %q0)]-time_sent))), %va))][setq(6, gte(sub(%vb, convtime(%q2)), %va))]strmatch(##, ZZ),{@swi 1 = 1,{@pemit %1 = %t%vc message(s) deleted.; @tr me/move_to_next_mailbox = %1, %2, %3, %4; @va me = ; @vb me = ; @vc me = ; @no me}},and(%q3, %q4, %q5),{@vc me = add(%vc, 1);@tr #300/remove_letter = u(get_src_dbref, %0, %q0), u(get_src_num, %0, %q0), get(%0/owner_dbref), %0, %q0, %q1,timeout A},and(not(%q3), %q4, %q6),{@vc me = add(%vc, 1); @tr #300/remove_letter = u(get_src_dbref, %0, %q0), u(get_src_num, %0, %q0), get(%0/owner_dbref), %0, %q0, %q1, timeout B}}}}, {@tr me/destroy_mailbox = get(%0/owner_dbref), num(me), %0, purge_old_letters;@pemit %1 = Mailbox belongs to dest'ed player.%b Mailbox destroyed.;@tr me/move_to_next_mailbox = %1, %2, %3, %4;@va me = ; @no me}}
&GRAB_LETTERS #7 = iter(get(%0/in-list-%1), ##~%1)
&MOVE_TO_NEXT_MAILBOX #7 = @wait me = {&debug_mail me = move_to_next_mailbox; @swi/first 1 = gte(%2, words(%3)), {@swi/first lt(%1, v(mailboxes_num_of_attributes)) = 1,{@tr me/move_to_next_mailbox = %0, add(1, %1), 0, v(mailboxes_[add(1, %1)]); @no me },{@pemit %0 = Purge complete.; @no me; @wait u(how_long_til_purge) = @tr me/periodic_letter_purge}},{@tr me/purge_old_letters = extract(%3, add(1, %2), 1), %0, %1, add(1, %2), %3; @no me }}
&CHECK_FOR_BAD_CHARS #4167 = comp(pos(%0, %q3), #-1)
&BAD_CHARS #4167 = ' ` * ( ) = [ ] { } % | , < > / ? : ; "
&COUNT_UNREAD_LETTERS #4167 =words(iter(%1,switch(get(%0/in-##-time_read), 0, ##,)))
&COUNT_MARKED_LETTERS #4167 = words(iter(%1, switch(get(%0/in-##-flags), *m*, ##, )))
&COUNT_DELETED_LETTERS #4167 = words(iter(%1, switch(get(%0/in-##-flags), *d*, ##, )))
&COUNT_SAVED_LETTERS #4167 = words(iter(%1, switch(get(%0/in-##-flags), *s*, ##, )))
&COUNT_TIMED_OUT_LETTERS #4167 = [setq(0, get(%0/message_timeout))][setq(1, get(%vm/default_timeout_option))][setq(1, div(u(grab_timeout_value, %q0, %q1), 2))]words(iter(%1,[setq(2, get(%0/in-##-time_read))]switch(and(eq(match(get(%0/in-##-flags), s), 0), not(strmatch(%q2, 0)), gte(sub(secs(), convtime(%q2)), %q1)), 1, ##, )))
&OK_TO_DEST_MAILBOX #4167 =and(eq(words(u(get_all_in_lists, %0)), 0),eq(words(get(%0/out-list)), 0),strmatch(get(%0/mail-in-progress), false),get(%vm/delete_when_empty),lte(get(%0/semaphore), 0),not(hasattr(%0, alias-list)), not(hasattr(%0, author_filter)), not(hasattr(%0, subject_filter)), not(hasattr(%0, vacation)), not(hasattr(%0, reject_msg)), not(hasattr(%0, filter_reject)), not(hasattr(%0, autoforward)))
&GET_ALIASES #4167=setunion(iter(edit({%0},\\,,%b), switch(match(%3 %2, ##), 0,, ##)), )
&TEST_IF_ALIAS #4167=switch(match(get(%1/alias-list) [get(%vm/global-mail-aliases)], %0), 0, no, yes)
&EXPAND_ALIASES #4167=iter(u(expand_aliases2, %0, %1, %2, %3, %4),switch(and(isdbref(##), strmatch(type(##), PLAYER)), 1, ##, ))
&EXPAND_ALIASES2 #4167=iter(escape(trim(%0)),[setq(1, get(%1/alias-##))][setq(2, get(%vm/alias-##))][setq(3, get(%vm/global-mail-aliases))]switch(1, sign(match(%2, ##)),, sign(match(%4, ##)),{%q1 [u(expand_aliases, u(get_aliases, %q1, %1, %q3, %4), %1, %2 ##, %3, %4)]}, sign(match(%3, ##)), {%q2 [u(expand_aliases, u(get_aliases, %q2, %1, %q3, %4), %1, %2 ##, %3, %4)]},))
&PRETTY_DIST #4167=u(list_names, iter(%0 %4,switch(1,sign(match(%2, ##)),##&(personal&mail&alias),sign(match(%3, ##)),##&(global&mail&alias),strmatch(type(##), PLAYER), edit(name(##), %b, &),)))
&IDENTIFY_TO_LIST #4167=squish(setunion(iter(u(identify_to_list2, %0), [setq(1, edit(##, &, %b))]switch(1, strmatch(type(*%q1), PLAYER), num(*%q1), strmatch(u(test_if_alias, ##, %1), yes), ,ABORTOne$or$more$of$the$destinations$specified$is$not$a$player$or$mail$alias.ENDABORT.)),))
&IDENTIFY_TO_LIST2 #4167=iter({%0}, switch(type(*##), player, edit(##, %b, &), ##), \,)
&FORMAT_NAMES #4167=u(format_names2, iter(%0, switch(##, #*, ##,)))
&FORMAT_NAMES2 #4167=switch(words(%0),0,,1, {[name(%0)]},2, {[name(first(%0))] and [name(rest(%0))]},{[iter(extract(%0, 1, sub(words(%0), 1)), {[name(##)],})] and [name(extract(%0, words(%0), 1))]})
&LIST_NAMES #4167=switch(words(%0), 0,, 1, {[edit(%0, &, %b)]},2, {[edit(first(%0), &, %b)] and [edit(rest(%0), &, %b)]},{[edit(iter(extract(%0, 1, sub(words(%0), 1)), {##,}), &, %b)] and [edit(extract(%0, words(%0), 1), &, %b)]})
&SECURE_NAMES #4167=switch(words(%0),0,,1, {[secure(%0)]},2, {[secure(first(%0))] and [secure(rest(%0))]},{[iter(extract(%0, 1, sub(words(%0), 1)), {[secure(##)],})] and [secure(extract(%0, words(%0), 1))]})
&FREE_NUM #4167=first(sort(setdiff(lnum(add(words(%0), 1)), %0), N))
&EXPAND_LETTER_RANGE #4167=squish(switch(0, strlen(%1),,strlen(%0), switch(hasattr(%q0, in-%2-location), 1, %2, u(first_unread, %q0)),eq(%0, 0), [setq(3, iter(%0,switch(##, *-*, [setq(1, before(##, -))][setq(2, after(##, -))]switch(or(lte(%q1, 0), gt(%q2, words(%1)), lt(%q2, %q1)),1,ABORTInvalid message range specified.ENDABORT,lnum(%q1, %q2)),*..*, [setq(1, before(##, ..))][setq(2, after(##, ..))]switch(or(lte(%q1, 0), gt(%q2, words(%1)), lt(%q2, %q1)),1,ABORTInvalid message range specified.ENDABORT,lnum(%q1, %q2)),switch(or(lte(##, 0), gt(##, words(%1))),1,ABORTInvalid message number specified.ENDABORT,##))))]switch(%q3, *ABORT*, %q3, elements(%1, %q3)),switch(trim(%0), a*:*,[setq(1, trim(after(%0, :)))]switch(type(*%q1), PLAYER, squish(iter(%1, [setq(2, u(get_src_dbref, %q0, ##))]switch([get(%q2/out-[u(get_src_num, %q0, ##)]-sender)] [get(%q2/owner_dbref)], *[num(*%q1)]*, ##,))), ABORTAuthor specified is not a player.ENDABORT), s*:*,[setq(1, trim(after(%0, :)))]squish(iter(%1, switch(get(u(get_src_dbref, %q0, ##)/out-[u(get_src_num, %q0, ##)]-subject), *%q1*, ##))),s*,squish(iter(%1, switch(get(%q0/in-##-flags), *S*, ##,))),t*:*,[setq(1, trim(after(%0, :)))]squish(iter(%1, switch(get(u(get_src_dbref, %q0, ##)/out-[u(get_src_num, %q0, ##)]-text), *%q1*, ##))),a*, %1,f*, first(%1),p*, switch(%2, first(%1),ABORTYou have reached the beginning of your mail messages.ENDABORT,extract(%1, sub(match(%1, %2), 1), 1)),m*, squish(iter(%1, switch(get(%q0/in-##-flags), *M*, ##,))),c*, switch(hasattr(%q0, in-%2-location), 1, %2, u(first_unread, %q0)),u*, squish(iter(%1, switch(get(%q0/in-##-time_read), 0, ##, %b))), d*, squish(iter(%1, switch(get(%q0/in-##-flags), *D*, ##,))),n*, switch(%2,last(%1),ABORTYou have reached the end of your mail messages.ENDABORT,extract(%1, add(match(%1, %2), 1), 1)),l*, last(%1), ABORTInvalid keyword specified.ENDABORT)))
&GET_SRC_DBREF #4167 = first(get(%0/in-%1-location))
&GET_SRC_DBREF #7 = first(get(%0/in-%1-location))
&GET_SRC_NUM #7 = rest(get(%0/in-%1-location))
&GET_SRC_NUM #4167 = rest(get(%0/in-%1-location))
&FORMAT_REQUEST #4167=switch([setq(1, after(%0, :))]%0+[strlen(%0)], *+0,{%b( current )},a*:*,{%b( author: %q1 )},s*, {[switch(%0,*:*, {%b( subject: %q1 )}, {%b( saved )})]},t*:*,{[switch(%0,te*, {%b( text: %q1 )}, {%b( to: %q1 )}, )]},a*, {%b( all )},f*, {%b( first )},p*, {%b( previous )},m*, {%b( marked )},c*, {%b( current )},u*, {%b( unread )},d*, {%b( deleted )},l*, {%b( last )},n*, {%b( next )},)
&CONVERT_NUMS #4167=iter(%0, match(%1, ##))
&EXPAND_SINGLE_LETTER_RANGE #4167=squish(switch(%0+1, *+[eq(strlen(%1), 0)], ,*+[eq(strlen(%0), 0)], switch(hasattr(%q0, in-%2-location), 1, %2, u(first_unread, %q0)),*+[gt(words(%0), 1)],ABORTInput parameter may only be a single word.ENDABORT, *+[strmatch(%0, *-*)], ABORTRange specifier (-) not allowed for this command.ENDABORT, *+[strmatch(%0, *..*)], ABORTRange specifier (..) not allowed for this command.ENDABORT, *+[gt(%0, 0)], switch(or(gt(%0, words(%1)), not(strmatch(%0, sub(%0, 0)))),1, ABORTInvalid message number specified.ENDABORT,extract(%1, %0, 1)),f*, first(%1),l*, last(%1),p*, switch(%2, first(%1),ABORTYou have reached the beginning of your mail messages.ENDABORT,extract(%1, sub(match(%1, %2), 1), 1)),c*, switch(hasattr(%q0, in-%2-location), 1, %2, u(first_unread, %q0)),n*, switch(%2,last(%1),ABORTYou have reached the end of your mail messages.ENDABORT,extract(%1, add(match(%1, %2), 1), 1)),ABORTUnrecognized keyword specified.ENDABORT))
&EXPAND_OUTGOING_LETTER_RANGE #4167=squish(switch(0, strlen(%1),, strlen(%0), switch(hasattr(%q0, out-%2-text), 1, %2, last(%1)),eq(%0, 0), [setq(3, iter(%0,switch(##, *-*, [setq(1, before(##, -))][setq(2, after(##, -))]switch(or(lte(%q1, 0), gt(%q2, words(%1)), lt(%q2, %q1)),1,ABORTInvalid message range specified.ENDABORT,lnum(%q1, %q2)), *..*,[setq(1, before(##, ..))][setq(2, after(##, ..))]switch(or(lte(%q1, 0), gt(%q2, words(%1)), lt(%q2, %q1)),1,ABORTInvalid message range specified.ENDABORT,lnum(%q1, %q2)),switch(or(lte(##, 0), gt(##, words(%1))),1,ABORTInvalid message number specified.ENDABORT,##))))]switch(%q3, *ABORT*, %q3, elements(%1, %q3)),switch(trim(%0),te*:*,[setq(1, trim(after(%0, :)))]squish(iter(%1, switch(get(%3/out-##-text), *%q1*, ##))),t*:*,[setq(1, trim(after(%0, :)))][setq(2, num(*%q1))]switch(type(*%q1), PLAYER, squish(iter(%1, switch(match(get(%3/out-##-dist), %q2:*), 0,, ##))), ABORTName specified is not a player.ENDABORT), s*:*,[setq(1, trim(after(%0, :)))]squish(iter(%1, switch(get(%3/out-##-subject), *%q1*, ##))),a*, %1,f*, first(%1),p*, switch(%2, first(%1),ABORTYou have reached the beginning of your mail messages.ENDABORT,extract(%1, sub(match(%1, %2), 1), 1)),c*, switch(hasattr(%q0, out-%2-text), 1, %2, last(%1)),l*, last(%1), n*, switch(%2,last(%1),ABORTYou have reached the end of your mail messages.ENDABORT,extract(%1, add(match(%1, %2), 1), 1)), ABORTInvalid keyword specified.ENDABORT)))
&FILTER_LIST #4167=squish(switch(%0, *ABORT*, %0, iter(%1, switch(member(%0, ##), 0, , ##))))
&FIRST_UNREAD #4167=first([iter(u(get_folder_in_list, %0)),switch(get(%0/in-##-time_read), 0, %b##%b, %b))]%b[last(u(get_folder_in_list, %0)))])
&GET_DELETE_OPTION #4167=switch(get(%0/mail_config_options),*soft*, soft, *hard*, hard, get(%vm/default_delete_option))
&GET_FORMAT_OPTION #4167=switch(%0, *standard*, standard, *compact*, compact, get(%vm/default_format_option))
&GET_SEPARATOR_OPTION #4167=switch(get(%0/mail_config_options),*space*, %b,*return*, %r,switch(get(%vm/default_separator_option), space, %b, %r))
&GET_INBOX #4167=switch([setq(1, get(%0/mail_config_options))]%q1, *INBOX*, before(after(%q1, INBOX:), :INBOXEND), main)
&FOLDER_TO_STORE_INTO #4167=first([iter(get(%0/subject_filter), switch(strmatch(%2, *[before(##, |)]*), 1, after(##, |)), ~)] [iter(get(%0/author_filter), switch(strmatch(%1, [before(##, |)]), 1, after(##, |)), ~)] [ulocal(get_inbox, %3)])
&AUTOFORWARD_TEST #4167=[setq(1, get(%vm/mailbox_%0))][setq(2, get(%q1/autoforward))]switch(0, strlen(%q1), %0,strlen(%q2), %0,trim(setunion([u(snag_dbrefs, %q2)] [u(expand_aliases, %q2, %q1, %b, get(%vm/global-mail-aliases), get(%q1/alias-list))], )))
&GET_AUTOFORWARD_OPTION #4167=[setq(7, get(%vm/mailbox_%0))][setq(4, get(%q7/autoforward))][setq(8, get(%vm/global-mail-aliases))][setq(9, get(%q7/alias-list))]switch(0, strlen(get(%vm/mailbox_%0)), {Mail will not be autoforwarded},strlen(%q4), {Mail will not be autoforwarded},{Mail will be autoforwarded to [u(pretty_dist, u(get_aliases, %q4, %q7, %q8, %q9), %q7, %q9, %q8, u(snag_dbrefs, %q4))]})
&GET_PERSONAL_ALIASES #4167=switch([setq(1, get(%vm/mailbox_%0))][setq(2, get(%q1/alias-list))]0, strlen(%q1), No personal mail aliases defined, words(%q2), No personal mail aliases defined, u(list_names, trim(%q2)))
&GET_ACTIVE_FOLDER #4167 =secure(get(%0/current_folder))
&GET_FOLDERS #4167=switch([setq(1, get(%vm/mailbox_%0))]0, strlen(%q1), secure(ulocal(get_inbox, %0)), u(secure_names, trim(get(%q1/folder-list))))
&GET_FILTER_COUNT #4167 = switch([setq(1, get(%vm/mailbox_%0))]0, strlen(%q1), 0, add(words(get(%q1/author_filter), ~), words(get(%q1/subject_filter), ~)))
&WHICH_IN_LIST #4167 =in-list-[default(%0/current_folder, main)]
&WHICH_CURRENT_LETTER #4167 =current_letter-[default(%0/current_folder, main)]
&GET_ALL_IN_LISTS #4167 =iter(get(%0/folder-list), get(%0/in-list-##))
&GET_FOLDER_IN_LIST #4167 =get(%0/in-list-[default(%0/current_folder, main)])
&GET_FOLDER_CURRENT_LETTER #4167 =get(%0/current_letter-[default(%0/current_folder, main)])
&GET_TIMEOUT_OPTION #4167=[setq(1, get(%vm/mailbox_%0))][setq(2, get(%q1/message_timeout))][setq(3, get(%vm/default_timeout_option))][setq(4, div(%q3, v(seconds_in_day)))]switch([strlen(%q1)]+[strlen(%q2)]+%q2,0+*+*,switch([strlen(%q3)]+%q3, 0+*,{0 (timeout capability disabled system-wide)},*+0,{0 (timeout capability disabled system-wide)},{%q4 days}),*+0+*,switch([strlen(%q3)]+%q3, 0+*,{0 (timeout capability disabled system-wide)},*+0,{0 (timeout capability disabled system-wide)},{%q4 days}),*+*+0,0 (timeout capability disabled for this mailbox),{[div(%q2, v(seconds_in_day))] days})
@startup #300 = @wipe me/mail_temp*; @startup me=
&GRAB_TIMEOUT_VALUE #4167 =switch(0, strlen(%0), switch(0, strlen(%1), 200000000, %1, 200000000, %1),%0, 200000000,%0)
&PURIFY_ALIAS_LIST #4167=squish(iter(%0, switch(##+[type(##)], #*+PLAYER, ##, #*,, ##)))


+mail configuration

+verify mail config