What's new
Please see the changelog for a full list of changes.
Upgrade notes
You need to upgrade to 5.0 before you can upgrade to 5.1 because of a database migration only present in the former.
Important changes
- Underscores are now allowed in variable names. This change may cause an issue if you have variable interpolation that needs the _ delimiter. For example "$foo_bar" was previously interpolated $foo, now $foo_bar.
- The SMTP server Reject() and Defer() functions no longer prepend any default messages to the reply message.
- Queue-less (in-line) delivery will now pass the error code given by the remote server, instead of only propagating the corresponding error class correctly (4xx or 5xx).
- The mail message getBody() function no longer have a size limit. If you want to limit the body size, you need to use the getSize() function.
- The SMTP server now does slightly stricter SMTP address checking
- The transport destination "null" (for black holing) is no longer a supported (only "/dev/null")
Deprecation warnings
The following deprecation warnings will appear in preparation for future changes:
- Connect script
- Allow() has been deprecated, use Accept() instead.
- Block() has been deprecated, use Reject() instead.
- SetSenderIP() has been deprecated, pass the address as an option to Accept().
- HELO script
- SetHELO() has been deprecated, pass the hostname as an option to Accept().
- Per-recipient end-of-DATA (EOD)
- DeliverWithDKIM() has been deprecated. Use signDKIM() on the MIME object.
- GetRoute() has been deprecated, process the received headers using getHeaders()
- GetDSN() and GetDSNHeader() has been deprecated, use dsn_parse() instead.
- Options for MX delivery has been deprecated (zone= and query=). This affects the transport profile and SetDestination() function. All DNS queries will use the system resolvers in future releases.
New recommendations
We recommend that following changes are performed in order to prepare for future deprecations.
- The SMTP server scripts introduces a new design pattern for accessing and changing context data. All the pre-defined variables are replaced by the $arguments, $connection and $transaction arrays. The arguments array contains all input to a given SMTP command script (sender for MAIL FROM, for example). All the setter functions (like SetSender) have been replaced by arguments to the Accept() functions, which populates the connection and transaction arrays as the SMTP conversation proceeds.
// Old way if ($sender == "foo@example.com") SetSender("test@example.com"); echo $sender; Accept(); // New way $sender = $arguments["sender"]; if ($sender == "foo@example.com") $sender = "test@example.com"; echo $sender; Accept(["sender" => $sender]);
- Use the new $connection["tls"] and its X.509 resource "peercert" with the new X.509 class instead of the GetTLS() function.
// Old way $tls = GetTLS(); if ($tls) echo $tls["peer_cert"]["subject_alt_name"]["DNS"]; // New way if ($connection["tls"]["peercert"]["x509"]) { $tls = X509($connection["tls"]["peercert"]["x509"]); echo $tls->subject_alt_name()["DNS"]; }
- Use the new $arguments["mail"] (or GetMailMessage() in the per-recipient DATA script) object instead of the MIME("0") function.
- Use the new toFile() method on the $arguments["mail"] (or GetMailMessage() in the per-recipient DATA script) object instead of the GetMailFile() function.
- Use the new spf_query() and dns_query() functions with much improved return values instead of spf() and dns().
- The GetAddressList() function is renamed to header_addresslist_extract().
Comments
0 comments
Article is closed for comments.