- Publicity: Public Only All
acs-mail-lite-procs.tcl
Provides a simple API for reliably sending email.
- Location:
- packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl
- Created:
- 22 March 2002
- Author:
- Eric Lorenzo <eric@openforce.net>
- CVS Identification:
$Id: acs-mail-lite-procs.tcl,v 1.108.2.34 2024/07/30 08:55:29 antoniop Exp $
Procedures in this file
- acs_mail_lite::address_domain (private)
- acs_mail_lite::configured_p (public)
- acs_mail_lite::encode_email_address (private)
- acs_mail_lite::generate_message_id (private)
- acs_mail_lite::get_address_array (private)
- acs_mail_lite::get_delivery_parameters (private)
- acs_mail_lite::get_package_id (private)
- acs_mail_lite::get_parameter (public, deprecated)
- acs_mail_lite::log_mail_sending (private)
- acs_mail_lite::mail_dir (private)
- acs_mail_lite::message_interpolate (private, deprecated)
- acs_mail_lite::parse_email_address (private)
- acs_mail_lite::send (public)
- acs_mail_lite::send_immediately (private)
- acs_mail_lite::smtp (private)
- acs_mail_lite::sweeper (private)
- acs_mail_lite::valid_signature (private)
- ns_sendmail (public, deprecated)
Detailed information
acs_mail_lite::address_domain (private)
acs_mail_lite::address_domain
- Returns:
- domain address to which bounces are directed to. If empty, uses domain from FixedSenderEmail parameter, otherwise the hostname in config.tcl is used.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::configured_p (public)
acs_mail_lite::configured_p
Determine, whether the outgoing SMTPHost is configured and reachable.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::encode_email_address (private)
acs_mail_lite::encode_email_address email
- Parameters:
- email (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::generate_message_id (private)
acs_mail_lite::generate_message_id
Generate an id suitable as a Message-Id: header for an email.
- Returns:
- valid message-id for mail header
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::get_address_array (private)
acs_mail_lite::get_address_array -addresses addresses
Checks if passed variable is already an array of emails, user_names and user_ids. If not, get the additional data from the db and return the full array.
- Switches:
- Options:
- -addresses (required)
- -addresses
- variable to checked for array
- Returns:
- array of emails, user_names and user_ids to be used for the mail procedures
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::get_delivery_parameters (private)
acs_mail_lite::get_delivery_parameters
Get the SMTP Parameters and return these as a dict.
- Returns:
- dict with keys identical to the package parameters
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::get_package_id (private)
acs_mail_lite::get_package_id
- Returns:
- package_id of this package
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::get_parameter (public, deprecated)
acs_mail_lite::get_parameter -name name [ -default default ]
Deprecated. Invoking this procedure generates a warning.
Returns an apm-parameter value of this package Deprecated: just a wrapper for parameter::get
- Switches:
- Options:
- -name (required)
- -default (optional)
- -name
- parameter name
- -default
- default parameter value
- Returns:
- apm-parameter value of this package
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::log_mail_sending (private)
acs_mail_lite::log_mail_sending -user_id user_id
Logs mail sending time for user
- Switches:
- Options:
- -user_id (required)
- -user_id
- user for whom email sending should be logged
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::mail_dir (private)
acs_mail_lite::mail_dir
- Returns:
- incoming mail directory to be scanned for bounces
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::message_interpolate (private, deprecated)
acs_mail_lite::message_interpolate -values values -text text
Deprecated. Invoking this procedure generates a warning.
Interpolates a set of values into a string. This is directly copied from the bulk mail package. DEPRECATED: duplicated code from bulk-mail that could be replaced by "string map"
- Switches:
- -values (required)
- a list of key, value pairs, each one consisting of a target string and the value it is to be replaced with.
- -text (required)
- the string that is to be interpolated
- Returns:
- the interpolated string
- See Also:
- "string map"
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::parse_email_address (private)
acs_mail_lite::parse_email_address -email email
Extracts the email address out of a mail address (like Joe User <joe@user.com>)
- Switches:
- Options:
- -email (required)
- mail address to be parsed
- Returns:
- only the email address part of the mail address
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::send (public)
acs_mail_lite::send [ -send_immediately ] [ -valid_email ] \ -to_addr to_addr -from_addr from_addr [ -subject subject ] \ -body body [ -mime_type mime_type ] [ -cc_addr cc_addr ] \ [ -bcc_addr bcc_addr ] [ -reply_to reply_to ] \ [ -package_id package_id ] [ -no_callback ] [ -file_ids file_ids ] \ [ -filesystem_files filesystem_files ] \ [ -delete_filesystem_files ] [ -extraheaders extraheaders ] \ [ -use_sender ] [ -object_id object_id ]
Prepare an email to be sent. Various email attributes can be specified, such as subject, body, senders, recipients, attachments and so on. The proc relies on MIME and SMTP.
- Switches:
- -send_immediately (optional, boolean)
- The email is send immediately and not stored in the acs_mail_lite_queue
- -valid_email (optional, boolean)
- -to_addr (required)
- List of e-mail addresses to send this mail to.
- -from_addr (required)
- E-Mail address of the sender.
- -subject (optional)
- of the email
- -body (required)
- Text body of the email
- -mime_type (optional, defaults to
"text/plain"
)- MIME Type of the mail to send out. Can be "text/plain", "text/html".
- -cc_addr (optional)
- List of CC Users e-mail addresses to send this mail to.
- -bcc_addr (optional)
- List of CC Users e-mail addresses to send this mail to.
- -reply_to (optional)
- -package_id (optional)
- Package ID of the sending package
- -no_callback (optional, boolean)
- Boolean that indicates if callback should be executed or not. If you don't provide it it will execute callbacks
- -file_ids (optional)
- List of file ids (items or revisions) to be sent as attachments. This will only work with files stored in the file-storage.
- -filesystem_files (optional)
- List of regular files on the filesystem to be sent as attachments.
- -delete_filesystem_files (optional, boolean)
- -extraheaders (optional)
- List of keywords and their values passed in for headers. Interesting ones are: "Precedence: list" to disable autoreplies and mark this as a list message. This is as list of lists !!
- -use_sender (optional, boolean)
- Boolean indicating that from_addr should be used regardless of fixed-sender parameter
- -object_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- email_send
acs_mail_lite::send_immediately (private)
acs_mail_lite::send_immediately [ -valid_email_p valid_email_p ] \ -to_addr to_addr [ -cc_addr cc_addr ] [ -bcc_addr bcc_addr ] \ -from_addr from_addr [ -reply_to reply_to ] [ -subject subject ] \ -body body [ -package_id package_id ] [ -file_ids file_ids ] \ [ -filesystem_files filesystem_files ] \ [ -delete_filesystem_files_p delete_filesystem_files_p ] \ [ -mime_type mime_type ] [ -no_callback_p no_callback_p ] \ [ -extraheaders extraheaders ] [ -use_sender_p use_sender_p ] \ [ -object_id object_id ] \ [ -force_delivery_mode force_delivery_mode ]
Prepare an email to be sent immediately. Various email attributes can be specified, such as subject, body, senders, recipients, attachments and so on. The proc relies on MIME and SMTP.
- Switches:
- -valid_email_p (optional, defaults to
"0"
)- -to_addr (required)
- List of e-mail addresses to send this mail to.
- -cc_addr (optional)
- List of CC Users e-mail addresses to send this mail to.
- -bcc_addr (optional)
- List of CC Users e-mail addresses to send this mail to.
- -from_addr (required)
- E-Mail address of the sender.
- -reply_to (optional)
- E-Mail address to which replies should go. Defaults to from_addr
- -subject (optional)
- of the email
- -body (required)
- Text body of the email
- -package_id (optional)
- Package ID of the sending package
- -file_ids (optional)
- List of file ids (items or revisions) to be sent as attachments. This will only work with files stored in the file-storage.
- -filesystem_files (optional)
- List of regular files on the filesystem to be sent as attachments.
- -delete_filesystem_files_p (optional, defaults to
"0"
)- Decides if we want files specified by the 'file' parameter to be deleted once sent.
- -mime_type (optional, defaults to
"text/plain"
)- MIME Type of the mail to send out. Can be "text/plain", "text/html".
- -no_callback_p (optional, defaults to
"0"
)- Indicates if callback should be executed or not. If you don't provide it it will execute callbacks.
- -extraheaders (optional)
- List of keywords and their values passed in for headers. Interesting ones are: "Precedence: list" to disable autoreplies and mark this as a list message. This is as list of lists !!
- -use_sender_p (optional, defaults to
"0"
)- Boolean indicating that from_addr should be used regardless of fixed-sender parameter
- -object_id (optional)
- Object id that caused this email to be sent
- -force_delivery_mode (optional)
- Force the specified delivery mode for this single call
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::smtp (private)
acs_mail_lite::smtp -multi_token multi_token -headers headers \ -originator originator -delivery_dict delivery_dict
Send messages via SMTP
- Switches:
- -multi_token (required)
- Multi Token generated which is passed directly to smtp::sendmessage
- -headers (required)
- List of list of header key-value pairs like {{from malte@cognovis.de} {to malte@cognovis.de}}
- -originator (required)
- -delivery_dict (required)
- dictionary of delivery parameters including the SMTP* configuration parameters
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::sweeper (private)
acs_mail_lite::sweeper
Send messages in the acs_mail_lite_queue table.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
acs_mail_lite::valid_signature (private)
acs_mail_lite::valid_signature -signature signature \ -message_id message_id
Validates if provided signature syntactically matches message_id as generated by OpenACS and equals to the hash of the provided signature. GN: not sure, why both is checked.
- Switches:
- -signature (required)
- signature to be checked
- -message_id (required)
- message ID that the signature should be checked against
- Returns:
- boolean 0 or 1
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ns_sendmail (public, deprecated)
ns_sendmail to from subject body [ extraheaders ] [ bcc ]
Deprecated. Invoking this procedure generates a warning.
Replacement for ns_sendmail for backward compatibility.
- Parameters:
- to (required)
- from (required)
- subject (required)
- body (required)
- extraheaders (optional)
- bcc (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.