This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| reference:lua_smtp_server_script [2015/04/14 16:14] – [SMTP Server Global Variables] paul | reference:lua_smtp_server_script [2025/05/08 08:23] (current) – [SMTP Server Lua Scripting] paul | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ======SMTP Server Lua Scripting====== | ======SMTP Server Lua Scripting====== | ||
| - | The SMTP Server [[http:// | + | The SMTP Server [[http:// |
| Each SMTP server instance has its own instance of the SMTPSVR.LUA script. No threading conflicts will occur. | Each SMTP server instance has its own instance of the SMTPSVR.LUA script. No threading conflicts will occur. | ||
| Line 10: | Line 10: | ||
| * **Start()** - called when the SMTP service session starts up, before the welcome message is sent to the SMTP client | * **Start()** - called when the SMTP service session starts up, before the welcome message is sent to the SMTP client | ||
| * **RBLResults()** - (VPOP3 Enterprise Only) - called after the RBL checks have been performed | * **RBLResults()** - (VPOP3 Enterprise Only) - called after the RBL checks have been performed | ||
| + | * **LoadLimits()** - (v8.7+ Enterprise Only) - called at connection to be able to dynamically alter service load limits | ||
| * **GetMaxMessageSize()** - called at startup, and when the HELO and EHLO commands are received | * **GetMaxMessageSize()** - called at startup, and when the HELO and EHLO commands are received | ||
| * **GetEHLOCapabilities()** - called when the EHLO command is received | * **GetEHLOCapabilities()** - called when the EHLO command is received | ||
| Line 55: | Line 56: | ||
| * **MaxLineLength** - (IN/OUT) - number - maximum line length | * **MaxLineLength** - (IN/OUT) - number - maximum line length | ||
| * **AddUserAddresses** - (IN/OUT) - boolean - add recipients of locally sent messages to the autocomplete address list | * **AddUserAddresses** - (IN/OUT) - boolean - add recipients of locally sent messages to the autocomplete address list | ||
| + | |||
| + | ===V6.5 and later=== | ||
| + | * **ServerID** - (IN) - number - ID of SMTP Service in VPOP3 | ||
| + | * **ServerName** - (IN) - string - name of SMTP Service in VPOP3 | ||
| ====In VPOP3 Enterprise Only==== | ====In VPOP3 Enterprise Only==== | ||
| * **CheckRBL** | * **CheckRBL** | ||
| Line 63: | Line 68: | ||
| * **RBLRejectMessage** | * **RBLRejectMessage** | ||
| * **RBLHeader** | * **RBLHeader** | ||
| + | |||
| + | ===V7.10 and later=== | ||
| + | * **Encryption** - (IN) - boolean - Is the session encrypted | ||
| + | * **EncryptionDetails** - (IN) - string - SSL/TLS version and SSL/TLS cipher being used (if encrypted) | ||
| =====SMTP Server " | =====SMTP Server " | ||
| '' | '' | ||
| Line 172: | Line 181: | ||
| The **< | The **< | ||
| The **< | The **< | ||
| - | The **< | + | The **< |
| The **<SPF Result> | The **<SPF Result> | ||
| Line 219: | Line 228: | ||
| * Reason string - text string to use if a reason is needed for the action | * Reason string - text string to use if a reason is needed for the action | ||
| * Recipients table - table containing new/ | * Recipients table - table containing new/ | ||
| - | * HeaderModifiers table - list of message header modifications to make | + | * HeaderModifiers table - list of message header modifications to make - each entry is the full header line (eg "From: < |
| * <message MIME structure> | * <message MIME structure> | ||
| * Path string - the IMAP style path to the message section | * Path string - the IMAP style path to the message section | ||
| Line 241: | Line 250: | ||
| This function should return <new actions table>, <results string> | This function should return <new actions table>, <results string> | ||
| - | In this function the VPOP3 ProcessMessage helper functions can be used. | + | (In version 7.0 and later, the returned ' |
| + | |||
| + | In this function the [[lua_scripting# | ||
| =====CheckRecipients()===== | =====CheckRecipients()===== | ||
| '' | '' | ||