Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
server:mail [2023/02/18 14:02] – New section on Recipients, for Keyop digital man | server:mail [2023/12/19 22:35] – [External Mail Processors] Fix the inverted description of the PassThru key and other cosmetic improvements digital man |
---|
{{:server:SBBSCTRL.mailsrvr.advanced.png?400|}} | {{:server:SBBSCTRL.mailsrvr.advanced.png?400|}} |
==== External Mail Processors ==== | ==== External Mail Processors ==== |
FIXME | |
| === Configuration === |
| |
| The mail processors are configured in the ''[[dir:ctrl]]/[[config:mailproc.ini]]'' file. |
| |
| Each mail processor is specified in a separate "section", comprised of the |
| mail processor name (or command-line) enclosed in square brackets ("[]"), |
| followed by a list of optional "key = value" pairs. |
| |
| Supported ''[[dir:ctrl]]/[[config:mailproc.ini]]'' keys (for each mail processor) with default values: |
| |
| ^ Key ^ Default ^ Description ^ |
| | ''Disabled'' | ''false'' | Set to true to disable | |
| | ''PassThru'' | ''true'' | A mail message should "pass-through" to a BBS user's inbox | |
| | ''Native'' | ''false'' | The mail process is a native (not JavaScript) program | |
| | ''IgnoreOnError'' | ''false'' | If there's an error reported, ignore it | |
| | ''To'' | //none// | A comma-separate list of possible recipient matches (name or name@address) | |
| | ''From'' | //none// | A required sender name | |
| | ''AccessRequirements'' | //none// | Optional access requirements for the processor to run | |
| | ''ProcessSPAM''' | ''true'' | Set to ''false'' to not process SPAM-tagged messages | |
| | ''ProcessDNSBL'' | ''true'' | Set to ''false'' to not process mail from DNS-blacklisted clients | |
| | ''Command'' | //section// | The command or script name to invoke | |
| | ''Eval'' | //none// | The JavaScript expression to invoke | |
| |
| If no ''Eval'' or ''Command'' key value is specified, the mail processor name |
| will be used as the command-line to execute. |
| |
| Non-JavaScript mail processors (i.e. native executables), must have the |
| ''native'' key set to ''true''. |
| |
| For a mail processor to only process mail received for specific name(s), |
| it must have a ''To'' key with a comma-separated list of destination names. |
| |
| Example: ''To = listserver, listserv'' would cause a mail processor to only |
| process mail received for either ''listserver'' or ''listserv''. |
| |
| If no ''To'' value is specified, then the mail processor will process **all** |
| incoming (SMTP) e-mail messages. |
| |
| == Pass-through == |
| |
| If a ''To'' value is specified, but is not a valid user name, then the |
| ''PassThru'' key must be set to ''false'' or the mail may be rejected or |
| forwarded (depending on the system configuration). |
| |
| The ''From'' key is similar to the ''To'' key: |
| a list of zero or more strings to be used to determine which |
| sender addresses the mail processor should be executed for. |
| |
| The strings in the to/from lists may use the Synchronet ''.can'' style comparison patterns. |
| |
| === JavaScript Variables === |
| |
| The filenames referenced below may all be modified or created by the mail processor. |
| |
| Additional (read-only) variables available to JavaScript mail processors: |
| |
| ^ Variable ^ Description ^ |
| | ''message_text_filename'' | filename contains complete message header and body | |
| | ''new_message_text_filename'' | completely new message header and body (optional) | |
| | ''recipient_list_filename'' | list of all SMTP recipients for this message (.ini format) | |
| | ''processing_error_filename'' | a filename that if created will reject this message with an SMTP error | |
| | ''log_text_filename'' | an optional filename that if created will include debug log output | |
| | ''hello_name'' | the "HELO" name specified by the sender during the SMTP session | |
| | ''sender_name'' | the name of the sender, possibly the same as the sender_address | |
| | ''sender_address'' | sender's email address (e.g. "user@domain.com") | |
| | ''reverse_path'' | sender's SMTP reverse-path from SMTP envelope (e.g. "<user@domain.com>") | |
| | ''recipient_address'' | last specified recipient in SMTP session (e.g. "you@your.host.com") | |
| |
| * See ''[[dir:exec]]/mailproc_util.js'' and ''[[dir:exec]]/listserver.js'' for example uses. |
| |
| JavaScript mail processors may be implemented as either a single "Eval" |
| string or an external JavaScript file (e.g. ''*.js''). |
| |
| External JavaScript mail processors (.js files) are loaded from the ''[[dir:mods]]'' |
| or ''[[dir:exec]]'' directory if no path is specified on the command-line. |
| If no file extension is specified on the command-line, ".js" is assumed. |
| |
| === Command-line Specifiers === |
| |
| Command-line specifiers (variables) available for use in command-lines |
| (native or JavaScript mail processor): |
| |
| ^ Specifier ^ Description ^ |
| | ''%m'' | mail message (header and body text) path/filename | |
| | ''%n'' | new message (header and body text) path/filename, in case you can't modify the original | |
| | ''%l'' | recipient list path/filename | |
| | ''%e'' | processing error path/filename (put error text in this file) | |
| | ''%d'' | processing debug log output path/filename | |
| | ''%h'' | sender's host name | |
| | ''%i'' | sender's IP address | |
| | ''%s'' | sender's name | |
| | ''%a'' | sender's address | |
| | ''%u'' | sender's user number (0 if unauthenticated) | |
| | ''%r'' | reverse path (of SMTP "envelope") | |
| | ''%t'' | recipient's address (from SMTP "envelope") | |
| | ''%!'' | exec dir | |
| | ''%g'' | temp dir | |
| | ''%j'' | data dir | |
| | ''%k'' | ctrl dir | |
| | ''%z'' | text dir | |
| | ''%o'' | sysop name | |
| | ''%q'' | system QWK-ID | |
| | ''%v'' | Synchronet version | |
| | ''%?'' | platform | |
| | ''%%'' | percent symbol | |
| |
===== SendMail ===== | ===== SendMail ===== |