Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
server:mail [2023/02/18 14:02] – New section on Recipients, for Keyop digital manserver:mail [2023/12/19 22:10] – [External Mail Processors] Migrated content from ctrl/modopts.ini - needs update and more info digital man
Line 115: Line 115:
 {{: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 file ''[[dir:ctrl]]/[[config:mailproc.ini]]''
 + 
 +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. 
 + 
 +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" (e.g. "native = 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. 
 +If a "To" value is specified, but is not a valid user name, then the  
 +"PassThru" key must be set to "true" 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. 
 + 
 +Each of the strings in these lists may use the Synchronet .can-style wildcards. 
 + 
 +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 | 
 + 
 + 
 +=== 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 =====