MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | CONCEPT: |
| 2 | mail |
| 3 | |
| 4 | |
| 5 | DESCRIPTION: |
| 6 | This document describes the mail system used in Nightfall. |
| 7 | The idea is to make a central mail handling object which |
| 8 | accepts and distributes mail between users. Mail is stored in |
| 9 | the /mail directory. save_object is used to save mail |
| 10 | information in mail files in this directory. Only the mail |
| 11 | demon object and the owner of the mail file can access it. |
| 12 | |
| 13 | A number of mail readers will probably available which access |
| 14 | the mail files. A typical mail user agent has commands to |
| 15 | read mail contained in the user's mail file, to reply to |
| 16 | messages, to forward, delete, save them. A folder structure |
| 17 | can be implemented. Outgoing mail is given to the mail demon |
| 18 | object by the user agent for distribution. The mailreader |
| 19 | should implement multiple recipients - carbon copy, cc and |
| 20 | blind carbon copy, bcc. Carbon copy means alternate recipients |
| 21 | to which the message should be sent. Blind carbon copy is the |
| 22 | same, but the recipients won't be listed in the received |
| 23 | message. |
| 24 | |
| 25 | Save file format (sort of formal notation): |
| 26 | |
| 27 | mixed *folders = ({ |
| 28 | ({ string name1; string name2; ... string nameN; }) |
| 29 | ({ mixed *msgs1; mixed *msgs2; ... mixed *msgsN; }) |
| 30 | }) |
| 31 | |
| 32 | The array variable <folders> contains a number of folder |
| 33 | structures containing the actual messages. There are special |
| 34 | folders which are reserved: mail, newmail. New mail will |
| 35 | be delivered into the newmail folder. This is the only hard |
| 36 | coded requirement (the mail demon will simply deposit new |
| 37 | mail there). The folder name 'mail' should be used for read |
| 38 | mail. Other folders can be dynamically created by the user |
| 39 | agent. |
| 40 | |
| 41 | Each msgs field is an array of messages: |
| 42 | |
| 43 | mixed *msgs = ({ mixed *message1; ... mixed *messageM }) |
| 44 | |
| 45 | A message is represented as an array with the following fields: |
| 46 | |
| 47 | mixed *message = ({ |
| 48 | string from; |
| 49 | string sender; |
| 50 | string recipient; |
| 51 | string *cc; |
| 52 | string *bcc; |
| 53 | string subject; |
| 54 | string date; |
| 55 | string id; |
| 56 | string body; |
| 57 | }) |
| 58 | |
| 59 | The mailer demon (/secure/mailer, or /obj/mailer) provides |
| 60 | the following functions: |
| 61 | |
| 62 | DeliverMail(mixed *message) |
| 63 | Hand a mail message over to the mailer demon. The mailer |
| 64 | demon extracts recipients from the recipient, cc and bcc |
| 65 | fields and removes the bcc information. It then deposits |
| 66 | the message to the mail files of all recipients. A valid |
| 67 | message is shown above. |
| 68 | |
| 69 | int FingerMail(string user) |
| 70 | Gives the number of unread messages a user has. |
| 71 | |
| 72 | |
| 73 | SEE ALSO: |