spam_history
table
If checked, then Tcl evaluator will be run at the time the message is actually sent on message subject and body, substituting variables or procedure calls wherever \$ and \[\] chars are found. This is specially useful for creating automatically generated templates, such as a daily report which runs a tcl procedure to query the database or create some other summary message.
Note: if you have the Template? option selected, make sure you use backslash to quote any $ or '[]' characters in your message, if you do not want them to undergo evaluation by the Tcl parser.
The following variables are guaranteed to be set in the environment, for use by your template.
db2
a database handle for any subqueries you want to makeuser_id
the user_id of the current target useremail
the email address of the current target userfirst_names
last_name
The param is an association-list, with SQL patterns on the left, and pseudo-mime types on the right. Supported types right now are text/html, text/html, and text/aol-html
.
EmailTypes={%@hotmail.com text/html} {%@aol.com text/aol-html}
Below is an example of the periodic spam admin form, showing the options for configuring periodic messages which get their content from named files the drop-zone directory:
Daily Spam File LocationsYour Workspace : Admin Home : Spam : List Daily Spam FilesSpam files to look for in drop-zone directory "/web/arsdigita/spam/". To delete an entry, just enter an empty string for the filename and subject, and press the Modify button. 'From address' is optional; if left blank, the default spam system from-address will be used.
You can enter the following information for an automatic spam daily message:
Drop Zone DirectoryThe files should be placed in the "Drop Zone" directory specified by the .ini parameterDailySpamDirectory :
Example: DailySpamDirectory=/web/eplay/spamFor each spam defined in the Daily Spam list, the system will look for the following files: file_prefix-MM-DD-YYYY file_prefixNote: Be sure to always use two-digits for Month and Day fields, i.e., 03-06-1999. Don't forget the leading zeros. If a file whose name matches with the specified prefix and the current day's date is found, the contents are queued up to be sent as spam to the designated target user class. The spam system will only send a dated spam once. It keeps a history of all spams sent, and will be robust across server restarts. If the server is restarted in the middle of sending a spam, the spam daemon will resume sending where it left off in the list of users. Be very careful with filenames that have no date suffix!If you use a filename with no date suffix, the spam will be sent once a day from the file. This behavior is designed to support a special case spam for new users, where the user class contains a magic query likeselect user_id from users where trunc(registration_date)=trunc(sysdate-1)which is carefully constructed to always select a mutually exclusive set of users each day, and never repeat the same user twice. HTML and AOL content typesSome users will have designated preferred MIME types for email via the users_preferences table. Currently we support HTML and AOL types in addition to plain text. If you create auxiliary files with the namesfile_prefix-html-MM-DD-YYYY file_prefix-aol-MM-DD-YYYYThen content from these files will be sent preferentially to users who have their email types preferences set in the database. Internal API for other modules to post scheduled spam messages to a user or group of usersIf another module in the ACS wishes to post a spam message, they should use the following interface function:# insert a new spam message into the spam queue, returns the spam_id of the new message spam_post_new_spam_message {{ -db 0 -template_p "f" -from_address "" -title "" -body_plain "" -body_html "" -body_aol "" -target_users_description "" -target_users_query "" -send_date "sysdate" -creation_user "" }}The target_users_description should be an English description of who the designated target users are, for administrative documentation purposes.
The select user_id from users where last_name = 'Kennedy' Example SQL Queries for spam messagesYou supply a SQL query which will be used to generate the target list of recipients for your spam message. Your query should return a single column,user_id . The spam system will automatically join this with the users_spammable view, which is a view that filters out users who have elected not to receive email from the system. So don't worry about pre-filtering your query via the users_spammable view. Just supply SQL which coughs up a list of user_ids.
A simple plain text spam to members of a specific user_group:select u.user_id from users u, user_group_map ugm where ugm.group_id = 12345 and ugm.user_id = u.user_id Setting the .ini ParametersHere is a summary of the .ini params you will need[ns/server/yourserver/acs/spam] ; Pairs of {email_addr_pattern pseudo-mime-type} EmailTypes={%@hotmail.com text/html} {%@aol.com text/aol-html} DailySpamDirectory=/web/yourserver/spam SpamRobotFromAddress= BulkMailBy default the spam system uses the built-in AOLserver ns_sendmail routine. This is adequate for low volume mailings, but if you need to send mail to more than about 500 users, then it has serious limitations. A high-performance module called bulkmail which has a multi-threaded mail client which can talk to multiple mail servers concurrently, and can generate the QMAIL style VERP return addresseses to make automatic bounce handling possible. This will soon be available as part of the core ACS distribution, and the spam module will have an option to use this as the mail transport rather than sendmail.For more info on the configuration of bulkmail and qmail, see bulkmail and qmail configuration UtilitiesThere are some useful utilities defined by the spam and email handling modules:
|