AUTORESPONDERS
(PLEASE NOTIFY SUPPORT@INFOPG.COM
IF YOU WISH TO USE AUTORESPONDERS)
What I have done here is dissected a sample .mreply.rc file that is just like the one that is inserted into your directory at creation time. Also refer to the mreply man2html page that is here. The sections of this file may look like fairly inocous plain text, but make sure you leave the sections as-is; don't rearrange them! They are very specific!! Also available is the original mreply FAQ page for our site with a full-blown layout of the Mreply author's personal configuration.
This also assumes you have an inkling of structured programming. You don't have to be able to code while standing on your head, but if you don't know the basics, then the branching that this configuration can do might throw you.
This is some explanation of what you can use to configure the .mreply.rc file, but not really how to use it. (Playful poke at the author, Tor Slettnes). Please read over it.
_______________________________________________________________________ | | People sending mails to your service should use the following syntax | in the body of their message: | | COMMAND [arguments] [TO|AS reply-address@host.domain] | | Built-in commands are: | ====================== | JOIN list - Subscribe to `list' . . . . | num1 > num2 - num1 is greater than num2 | num1 <= num2 - num1 is smaller than or equal to num2 | num1 >= num2 - num1 is greater than or equal to num2 | | String comparisons are not case sensitive. | .AND / .OR are evaluated left to right (actually top to down). | .IF statements can be nested |_______________________________________________________________________
Global Initialization section can be used, as it says to set some global variables. Most are suitable as is, but of course you would want to change the names of the lists.
===================== Global initialization ===================== .globalInit ==================================================================== First, let's find out if this mail has been addressed to one of our services.. ==================================================================== .if to first-list .setenv LISTNAME First-List .elif to second-list .setenv LISTNAME Second-List .elif to third-list .setenv LISTNAME Third-List .endif ==================================================================== Set up a variable called MAILBOX to contain a 'search path' for storing our own mail. This variable will be used in various forwarding declarations further down. ==================================================================== .setenv MAILBOX > /usr/spool/mail/ /usr/mail/ /var/mail/ ~/mbox ==================================================================== Define some global variables. The directories specified must exist. ==================================================================== .setenv ARCHIVE ~/archive/listmail-$downcase($LISTNAME) .setenv LISTFILE $listfile($LISTNAME) .end
Who are we indeed?!? This sets the names and addressed for the rest of the session.
=========== Who are we? =========== .if $LISTNAME exists .serviceAddress ${LISTNAME}-Request@YOURDOMAIN .ownerAddress ${LISTNAME}-Owner@YOURDOMAIN .else .serviceAddress "YOURUSERNAME".ownerAddress "YOURUSERNAME" .endif .if to info .message Forwarded .goto autoresponder .end .endif .if to salez .message Forwarded .goto autoresponder2 .end .endif
In this section, you can begin telling Mreply what to do with the mail. Don't try it elsewhere; I beat myself up for several days trying to figure out why one I was working on was dying; turned out I had tried to route something in the previous section.
============================= Mail filtering and forwarding ============================= .if to owner- .or to -owner ==================================================================== The mail was sent to an 'owner-' alias, so forward to ourselves ==================================================================== .forwardAll $MAILBOX .elif to -request ==================================================================== The mail was sent to a '-request' alias, so forward only regular text mail (Some people have no idea what a list server is..). All other mail is processed. ==================================================================== .forward $MAILBOX ==================================================================== Also point to a response message (declared further down) that will be sent back to the mailer. ==================================================================== .message Forwarded .goto Request-Forwarded .end .elif $LISTNAME exists ==================================================================== The mail was sent to one of the aliases above, but not -request, owner- or -owner. Therefore, the mailing list itself. First, let's see if the mailer is subscribed. ================================================================ .if file $LISTFILE contains $ADDRESS .or file $LISTFILE contains ($FULLNAME) ============================================================ Yup, (s)he is. The mail can be forwarded to the mass mailer script, which in turn will send it out to the list. But only forward regular text mail, since _some people_ have a tendency to send requests to the list itself. (Grmbl!) ============================================================ .forward | /usr/local/bin/msend -q -s $ARCHIVE $LISTFILE($LISTNAME) ============================================================ In this forwarded mail, let's remove some headers ============================================================ .purgeHeader Received: .purgeHeader Return-Path: .purgeHeader Date: ============================================================ And insert some others ============================================================ .insertHeader Content-Type: text/plain; charset=US-ASCII .insertHeader Content-Transfer-Encoding: 7bit .insertHeader Mime-Version: 1.0 ============================================================ Also point to a response message to the mailer, defined further down. ============================================================ .message Forwarded .goto ListMail-Accept .end .else ============================================================ The mailer was not subscribed to the list. Return the message, and also send appropriate response. ============================================================ .forward $MAILBOX .addHeader X-Comments: Rejected; Not in list .addHeader Cc: $OWNERADDRESS .message Forwarded .goto ListMail-Reject .end .endif .else ==================================================================== Who else could the mail possibly have been sent to? Ourselves? What a concept! ==================================================================== .forwardAll $MAILBOX .endif
================ Subscriber lists ================ ======================================================================== The following modifiers are available: concealed - Don't allow 'review' commands on this list. revealed - Allow 'review' commands on this list. [Default] manual - Only add mailers who ask for it via JOIN/SUBSCRIBE. [Default] automatic - Add all mailers that send requests to your service. ======================================================================== .list First-List ~/lists/first-list concealed .list Second-List ~/lists/second-list concealed .list Third-List ~/lists/third-list revealed .list Announcements ~/lists/announcements automatic concealed ======================================================================== Oh, haven't you been annoyed by those thousands of people who send mails to _you_, asking to join the MReply list? Well, forward these requests to their appropriate place. :-) ======================================================================== .list MReply ! mreply-request@YOURDOMAIN ======================================================================== Additional directories in which to look for matching listfiles. The second one captures and forwards all unserved list request, uncomment to enable. ======================================================================== .listdir ~/lists concealed .listdir ! listserv@YOURDOMAIN ============================== Available file items (packets) ============================== .packet item-1 ~/packets/file-one .packet item-2 @ /usr/local/bin/unzip -p ~/packets/file-two.zip ======================================================================== Oh, and all those people again, who ask you to send them your server software... ======================================================================== .packet mreply ! mreply-request@YOURDOMAIN ======================================================================== Additional directories in which to look for matching filenames ======================================================================== .packetDir ~/tmp .packetDir ~/archive ======================================================================== Directory in which to receive files. (Uncomment to enable). The first argument is the name of the directory; the second argument is an ACCESS code that the mailer must specify to gain access. ======================================================================== ; .receiveDir ~/incoming sekret ======================================================================== Mail headers for response messages. These have no effect on forwarded mails. ======================================================================== .header To: $FULLADDRESS .header From: $SERVICEADDRESS .header Errors-To: $ADDRESS, $OWNERADDRESS .header Content-Type: text/plain; charset=US-ASCII .header Content-Transfer-Encoding: 7bit .header Mime-Version: 1.0
============================================== LABELs for .GOTO and .GOSUB statements earlier ============================================== .label autoresponder Subject: Auto-Responder reply Yo $NAME this is coming from your .mreply.rc file in your home directory. it is an auto-responder if you didn't know .end .label autoresponder2 Subject: Another Autoresponder Hello Here is your information you requested: .end .label Request-Forwarded Subject: Your mail was forwarded Hi, $NAME. You write: > ${COMMANDLINE} Since this appears to be a regular mail rather than one containing commands aimed at ${SERVICEADDRESS}, it has been forwarded to my personal mailbox. I will look at it next time I log in. .end .label ListMail-Accept Subject: Your mail to $LISTNAME has been received Hi, $NAME. Your mail to $LISTNAME has been received and redistributed to the list. It should appear within 1/2 hour or so. This is an automatic reply; no response is neccessary. .end .label ListMail-Reject Subject: Your mail to $LISTNAME was stopped Bcc: $OWNERADDRESS Hi, $NAME. To $LISTNAME@YOURDOMAIN, you write: > $COMMANDLINE Your mail to $LISTNAME was stopped, because neither your address nor your real name was found in the list of subscribers. Before sending mail to the list, you must send the following mail to $SERVICEADDRESS: SUBSCRIBE $LISTNAME If you think you are already a member of the list, you may have sent the SUBSCRIBE command from a different hostname. You can send a "REVIEW $LISTNAME" command to determine if this is the case; if you have an obsolete address on the list you can update it with the command "CHANGE oldaddress TO newaddress". Feel free to contact $OWNERADDRESS for more help. .end ===================== User-defined commands ===================== .command INDEX Subject: Index of files available The following items are currently available via e-mail to $SERVICEADDRESS: .gosub packetInfo These items can be obtained with "SEND item" commands, in the body of your message. .end =========================== Response messages to mailer =========================== .message Added .message AutoAdded Subject: Welcome! Hi, $NAME. You have now been added as subscriber to the list '$ARGUMENT'. .gosub ListInfo-$ARGUMENT To send mail to the list, use the address <${ARGUMENT}@YOURDOMAIN>. .setenv N $trim(`cat $PATHNAME | wc -l`) You are subscriber number $N, and your address is recorded as: $FULLADDRESS If this address is not correct, you may send the following command to update it in all lists: CHANGE $ADDRESS TO newaddress@host.domain (Real Name) You can unsubscribe from this list at any time by sending an \`UNSUBSCRIBE $ARGUMENT' command. If you send the request from a different hostname, you will need to say: UNSUBSCRIBE $ARGUMENT AS $ADDRESS To find out what lists you are subscribing to, use the \`WHICH' command. For a list of all available commands, give a \`HELP' command. Enjoy! .end .message AlreadyAdded Subject: Already in list Hi, $NAME. Your address was already recorded in the list \`$ARGUMENT'. It has now been re-recorded as: $FULLADDRESS Maybe you meant to join another list? Available lists are: .gosub ListInfo If you are joining again because you are not receiving any mails from the list, or for any other reason think it is strange that you should already be there, please send a mail to $OWNERADDRESS. .end .message Removed Subject: Removal from $ARGUMENT Hi, $NAME. You have been removed from the '$ARGUMENT' list. Thanks for staying with us; you are welcome back any time! .end .message NotInList Subject: Not found in $FILENAME Hi, $NAME. Your \`$COMMAND $ARGUMENT' command has been received; however your address was not found in the \`$ARGUMENT' list! To find out what lists you are currently subscribing to, send a \`WHICH' command to $SERVICEADDRESS. Also note that if the sender address of your \`$COMMAND' message is not the same as as the one recorded in the list, you will need to say "LEAVE $ARGUMENT AS recorded-address@host.domain". If you prefer, you can have me remove your name manually next time I log in. Please send mail to $OWNERADDRESS. .end .message Review Subject: Current subscribers of $FILENAME Hi, $NAME. These are the current subscribers of $FILENAME. The total number of subscribers is `cat $PATHNAME | wc -l`. .end .message ConcealedList Subject: Mailing list \`$ARGUMENT' not open for review. Hi, $NAME. Your \`$COMMAND $ARGUMENT' request has been received by $SERVICEADDRESS, however the ARGUMENT list is not open for public review. For further questions regarding this, please contact: $OWNERADDRESS .end .message IllegalList Subject: Illegal list specification Hi, $NAME. Your \`$COMMAND $ARGUMENT' request has been received by $SERVICEADDRESS; however no lists are named \`$ARGUMENT'. Available lists are: .gosub ListInfo Please try again. .end .message Which .message NotInAnyList Subject: Your current list subscriptions Hi, $NAME. The following are your current list subscriptions. If you think one or more lists are missing, you may be recorded in the list(s) with a different address. You must then give one of the following commands to change it: CHANGE oldaddress CHANGE oldaddress TO $FULLADDRESS .if $MESSAGE equals Which You are currently subscribing to the following lists: .else You are currently not subscribing to any lists at this server. .endif .end .message Changed Subject: Your address has been changed Hi, $NAME. Your address has been updated from '$ARGUMENTS' to '$FULLADDRESS' in the following lists: .end .message NoChange Subject: Your were not subscribed to any list Hi, $NAME. Your request for address change has not been served, because the old address '$ARGUMENTS' could not be found in any lists. .end .message SendPlain .message SendEncoded Subject: $FILENAME (Information) Hi, $NAME. The file you requested is now sent in $PARTS separate e-mail(s). Note that some mail handlers will reject or truncate very large mails; if you do not receive the complete file, you can have it sent again in parts (or smaller parts, if you are already splitting it). Use the command: $UPCASE($COMMAND) $ARGUMENT splitsize where \`splitsize' is the maximum number of kilobytes or bytes per mail. The smaller number the safer transport, but also the more cumbersome decoding. A value below 50 should not be needed. .if $MESSAGE EQUALS SendEncoded .goto Extract .endif .end .label Extract The file is sent as a shell archive. Instructions for extraction are given in the first part, "$FILENAME (Part 1/$PARTS)". .if $FILENAME contains .tar.Z .goto Extract-tar-Z .elif $FILENAME contains .tar.gz .or $FILENAME contains .taz .goto Extract-taz .elif $FILENAME contains .Z .and not $FILENAME contains .zip .goto Extract-Z .elif $FILENAME contains .gz .goto Extract-gz .endif .end .label Extract-tar-Z To unpack this file after extracting it, type: gtar zxvf $FILENAME If you do not have 'gtar', you can use 'gzip -d' or 'uncompress' followed by 'tar xvf'. .end .label Extract-taz To unpack this file after extracting it, type: gtar zxvf $FILENAME If you do not have 'gtar', you can use 'gzip -d' followed by 'tar xvf'. .end .label Extract-Z To unpack this file after extracting it, type: gzip -d $FILENAME If you do not have 'gzip', you can use 'uncompress'. .end .label Extract-gz To unpack this file after extracting it, type: gzip -d $FILENAME .end .message IllegalPacket Subject: Illegal packet specification Hi, $NAME. The following command has been received from you: > $COMMANDLINE No packet exists by name \`$ARGUMENT'. Available packets are: .gosub PacketInfo Please try again. .end .message ReceivePlain Subject: File '$FILENAME' received Hi, $NAME. The file $FILENAME has been received and stored as: $PATHNAME Thanks for your contribution! .end .message ReceiveEncoded Subject: File $FILENAME successfully decoded Hi, $NAME. The file $FILENAME has been received and successfully uudecoded. The file has now been stored as \`$PATHNAME'. Thanks! .end .message DecodeError Subject: Error during decoding of \`$FILENAME' Hi, $NAME. The following error occured during decoding of your \`$FILENAME' submission to $SERVICEADDRESS: *** $ERRORMESSAGE .exec /bin/rm -f $PATHNAME~ .if $RETURNSTATUS equals 0 .and not $ERRORMESSAGE exists The truncated file has been removed. .endif .end .message NoAccess Subject: Incorrect or missing ACCESS for file submission Hi, $NAME. You did not supply a legal ACCESS code to submit files to $SERVICEADDRESS. To submit a file, please use the command: ACCESS code followed by a "begin mode filename" statement for uuencoded files or a "TEXT filename" statement for plaintext files. .end .message Help Subject: Your HELP request Hi, $NAME. Your HELP command has been received. .goto Help .end .message Unavailable Subject: Service unavailable Hi, $NAME. You wrote: > $COMMANDLINE This syntax is not currently available at this server. .goto Help .end .message SyntaxError Subject: Illegal command Hi, $NAME. You specified an illegal command: \`$COMMAND'. .goto Help .end .message EmptyMail Subject: Empty mail received Hi, $NAME. An empty mail was received from you. .goto Help .end .message ServerError Subject: Error condition re: your '$COMMAND' request This is regarding your following request to $SERVICEADDRESS: > $COMMANDLINE The following error condition occured: *** $ERRORMESSAGE A proper response to your request is therefore not available at this time. To verify your transaction, please contact: $OWNERADDRESS Sorry about the inconvenience. .end .label Help .gosub CommandInfo .gosub Download-Info .gosub Address-Info .end .label CommandInfo To make requests, please send an e-mail containing one or more lines with the following syntax in the message body to $SERVICEADDRESS: COMMAND [arguments] [TO|AS reply-address@host.domain] If [TO|AS reply-address@host.domain] is not specified, the reply address is extracted from the header of your request message. These are available commands: ============================= JOIN list - Subscribe to \`list' SUBSCRIBE list - Subscribe to \`list' LEAVE list - Unsubscribe from \`list' UNSUBSCRIBE list - Unsubscribe from \`list' REVIEW list - List subscribers of \`list' [Mailing list only]. CHANGE address - Update \`address' in all lists. WHICH - Information on what lists you are subscribing to. INDEX - List available packets. SEND packet [n] - Request \`packet'; [n] is an optional split size SERVERINFO - Some information about this autoreplyer HELP - This text \`list' can be one of: .gosub ListInfo \`packet' can be one of: .gosub PacketInfo Some examples: ============== SEND item1 SEND item2 60 TO user@host.domain (Real Name) SUBSCRIBE announcements AS user@host.domain (Real Name) CHANGE oldaddress@host.domain TO newaddress@host.domain (Real Name) SERVERINFO .end .label ListInfo ANNOUNCEMENTS - Misc. announcments; <...> FIRST-LIST - Your first list SECOND-LIST - Your second list THIRD-LIST - Your third list .end .label PacketInfo ITEM-1 - Some information about goes here. ITEM-2 - More information ... listmail-first-list - Mails sent to First-List listmail-second-list - Mails sent to Second-List listmail-third-list - Mails sent to Third-List listmail-announcements - Mails sent to the Announcements list .end .label Download-Info Downloading information ======================= This and that is available via anonymous FTP to YOURDOMAIN in the directory /pub/path. Check the INDEX file for details. You can also send a message tocontaining the words "INDEX /pub/path" in the body. A "HELP" command will give further details on usage. .end .label Address-Info Addresses ========= First-List@YOURDOMAIN (First Mailing List) .gosub ListInfo-First-List Second-List@YOURDOMAIN (Second Mailing List) .gosub ListInfo-Second-List First-List@YOURDOMAIN (Third Mailing List) .gosub ListInfo-Third-List Your-List-Request@YOURDOMAIN (Your List Request Service) Autoreplyer service. Send e-mail containing one command per line in the message body, as described above. Owner-Your-List@YOURDOMAIN (Your List's Owner) Send any comments, complaints, questions, suggestions you have about this list and file service here. you@YOURDOMAIN (Your Name) Me. Same as above. .end .label ListInfo-First-List This list is devoted to [yak-yak-yak] Currently, popular topics include [yak-yak-yak] .end .label Listinfo-Second-List This list is devoted to [yak-yak-yak] Currently, popular topics include [yak-yak-yak] .end .label Listinfo-Second-List This list is devoted to [yak-yak-yak] Currently, popular topics include [yak-yak-yak] .end .label ListInfo-Announcements You will now receive notification every time there is a new release available, as well as other relevant information. .end *** Signatures: .signature .if to -request ______________________________________________________________________ For help, send an e-mail with HELP body to: your-request@host.domain Comments and questions are welcome, use: owner-your-request@host.domain is created and maintained by Your Name .elif to -list __________________________________________________________________ To send mail to Your-list, use the address: Your-list@host.domain For usage, send e-mail with "HELP" body to Your-request@YOURDOMAIN .else __________________________________________________________ For help, please send a HELP command to: .endif .end