_ _ ___ _ _ _ _ ______ _________ / \ / \ / \ | | | | | | | | / ____\ |____ ___| | \ / | / _ \ | | | | | | | | | |___ | | | |\\//| | | |_| | | | | | _____ | | | | \____ \ | | | | \/ | | | __ | | | | | |_____| | | | | __ \ | | | | | | | | | | | | | | |___ | |____ | | \ \__/ | | | |_| |_| |_| |_| |_| |_____| |______| |_| \____/ |_| (c) Tomas Siegl (c) Orcave Inc. (c) 20002 Contents: Mailing list manager History: 01/09/2002 Sigi - created 1.0 Recieving Mails from net ---------------------------- - Mailist uses the same server background as the CBS mail. Mail posts deliered to maillist are stored in CBS mailbox in diferent folder according post types. - Mailist types are: public - every one who is member can post private - only specific members can send new post, others only recives moderated - new mail post must be approved by moderator (subscriber) or cbs user with coresponding ACL rights before is spread to subscribes. public moderated - Every subscriber can post but mail must be aproved by moderator private moderated - Only specific members can post and mail must be approved by moderators 2.0 Maillist names ------------------ - Mail list uses this format of addresses, but can be arbitrary in general. Etc: alias@list.orcave.com - for normal posts subcribe-alias@list.orcave.com unscribe-alias@list.orcave.com - for adding/ removing subsribers via mail admin-alias@list.orcave.com - for moderators to aproving post and later other commands info-alias@list.orcave.com - for help, describtion Outgoing mails is send with (SMTP) MAIL FROM: admin-postid-subscriber=email-adress@list.orcave.com. This case will eleminate autoresponce scripts and of course not valid email addreses. if email adress has its target mailbox which is maillist type, Delivery will be handled as maillist post. 2.1 Synchronization of maillbox and maillist -------------------------------------------- - Maillist mailboxes can be synchronized with cron script or call qmail-newu directly etc. which updates /etc/alliases (postfix) or /var/qmail/users/...(qmail) file. Done in the same way as in CBS mail 3.0 Mail format --------------- - New mail is proccessed by Mail class and decoded. If a mail is posted back to other members it is created again so original mail is not directly send, because we want to awaid viruses etc. 3.1 Headers ----------- - Maillist uses ordinary mails header items, From: - must be valid maillist user (email address used for identification) identification To: - mailing list Date: - Date when mail was sent Subject: - XMaillistID: - for bounce and holiday checking, and mail robot, (this id corespond to LIST_MAIL table) XPriority: - mail priority. (for future use) XMailType: - Mail type. (for future use) Send mails contains Mailling list headers for mail reader clients, but this information are only for client side, server doesn't need them. List-Unsubscribe: , List-Id: Mail conferency... List-Post: List-Help: List-Subscribe: , - Other headers Mime-Type: etc. are used for decoding mail only. 3.2 Mail body: -------------- - Mail body is converted to plain/text - Html tag can be removed using html Filter (HtmlFilter.php). This filter can set allowed tags and properties. - Mails can have attachement if maillist support them. Otherwise it is removed and user can be informed how to post attachements if it is possible.. 5.0 Database Tables ------------------- Maillist is an instance of data of DTD type mailist@mailist which contains all necessary relation tables and one global side table for storing mailist options MAILLIST -------- - information about all maillistes side static table table [int] id (req primary) [int] contactdataid -> id of data instace where is stored contacts for maillist instance [text] constactcluster -> name of contact cluser for mailling instannce [int] mailboxid (foreign key) (1 mailbox can be used with 1 maillist) [int] addressid // conference addresses [int] postaddressid -> physical email address id [int] adminaddressid -> physical email address id [int] subscribeaddressid -> physical email address id [int] unscribeaddressid -> physical email address id [int] infoaddressid -> physical email address id [int] type -> maillist type [int] posttype -> type of allowed post plain/text, attachements etc. [int] maxpostsize -> max post size [int] approvepoints -> post points if moderated // texts [int] tplid -> reference na sablony, [text] description -> all texts variable=value; + DTD mailist@mailist -> instance data 1 mailistu clusters: "subscribers" ----------- [int] id [int] addressid [time] datecreation [select] authorized [key_user] authorizedby [int] lastdelivered error handling ... plus miliony jeho nastaveni napr. jako v jakym to chce formatu ... kdy naposledy dostal mail atd. "moderators" ---------- [int] id [type] type email/cbs user [int] addressid [id] userid [int] datecreation [int] approvepoints [key_user] added ... plus do budoucna jakymi kanaly muze pridelovat body (sms) ... jeho verifikacni kod "confirmations" ------------- [seq] id id konfirmace [int] maillid releated incoming mail message [int] rel_id related item (subscriber, moderator,...) [int] confirmcode confirmation code [int] operation which operation confirms [txt] operation_data etc. change personal info [time] expiredate "approving" - check if moderator added points or not and if mail has enought points for sprading --------- [int] mailid (mail is stored in mailbox but has set flag that is not visible for template_render) [int] moderatorid ?[time] dateapproving [int] points 6.0 Adding mails to database ---------------------------- - Mail can be added to database before it is send, because we want to avoid loosing it during send. If mailist is moderated, mail is not put in db and coresponding record in table LIST_APPROVED is created, then mail is waiting for some time after it is approved by user with corresponding rights if sender is moderator mail is directly send into mailist without approvement. - when mail is ready it is send. 8.0 User Mailist Rights ----------------------- - tohle je z prvni doby a nemusi to byt presny. moderator/approval ('approve' emails to be sent) admin_subsribers (add new users, change properties) add_new_list (add new lists - adding user become admin @ the list) admin (full lists aministration) 9.0 Mail Robot -------------- - Mailist can be controled (not fully) via mail robot. This robot can: - Add a new user to mailist - Remove existing user from mailist - Send information about mailist - Send history - Send information about all mailist in system. - this mailist can create a new mailist, this must be done via CBS. Subject: Confirmation for subscribe XXX Someone (possibly you) has requested that your email address be added to the mailing list "XXX@lists.orcave.com". If you really want this action to be taken, please send the following commands (exactly as shown) back to "admin@lists.orcave.com": auth AAAAAAAA subscribe XXX YYYYYYYY For most emailing client is enough reply to this email. If you do not want this action to be taken, simply ignore this message and the request will be disregarded. If you have any questions about the list, please contact "XXX-info@lists.orcave.com". Thanks! admin@lists.orcave.com AAAAAAA=generated ID YYYYYYY=related email Similar for unsubscribe. Text are stored in database and can be reused between various lists. It is not important to sub-class these text for languages, because list is in "some langauge", so, one text per mail is enough. Info "You requiested info about XXX mail list." Bye ! admin@lists.orcave.com Error Error text. Something like: "During processing your request following error occurs:" If you have any questions about the lists, please visit http://www.orcave.com/redir?dst=support.cbs.lists&src=cbs.list.msg Thanks! admin@lists.orcave.com When body of this text need to 'reference' something (such as author email, error text, security ID, etc.) it should use %tag_name% which will be replaced. Error text can be also defined. It is stored in separate tree where we can handle multilanguage strings. Error texts can be also reused, byt they will be reused mainly on language. That's why they are separate from normal text. Error texts are stored in form: error_alias text_to_user details Design. ------- New mail arrived -> Mailcollect decode dst address and finds mailbox, if mailbox type is maillist post is inserted into mailbox and Cbs is called with module maillist autorun. Here is decided what to do. 1. mail is subscribtion/unscribe - subscribe or unscribe address is ripped from mail and created confirmation record and generated confirmation mail. (www_render can read this confirmation record from link param if user confirm via http:// click) or data_writer fn can call this function to subscribe new member from web. 2. confirmation check mail header, for id, if not check subject, or body. And Perform removing relation from cluster subscriber 2. admin command etc. approve points /info cluster "approving" 'tpl' is used as is and there is learn some common variables like $posttype={subscribe_confirm,unscribe_confirm,info,approve_accepted,help,welcome_subscribe,welcome_moderator,goodbye_subscriber,goodbye_moderator} $alias .. later we can generate for every contacts its own mail (etc. Name can be in greeetings etc) 4. Ordinary post get subsriber list, remade mail and call mailLib function for sending mail or if moderated insert record into table and call event autorun creates session, login probably mailist_module_user and call coresponging event. etc. event handling user can create filter when compare if from is sombody then notify me with sms mail module chceck event mail.message.new user filters and process that. Handling dead addresses: ------------------------ Maillist uses special address for collecting bounced messages etc. bounce-collect@. When Cbs recives mail targeted to this address mail deamon function is called to analyze mail and grab bad address from mail body. For qmail this address is located after string: Hi. This is the qmail-send program at orcave.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. : After locating non-existing address in maillist, error count is increased in contact table and after reaching defined value address is removed from maillist but not from contact tables.