Deprecation

From Halon, SMTP software for hosting providers
Revision as of 11:11, 17 September 2018 by Erik (talk | contribs) (Release 4.8)
Jump to: navigation, search

Don't panic just yet. Receiving a warning about deprecation simply means that you're using a feature that will be removed in the future. The system is still working as expected. You should however resolve these issues before updating to the next release. If you have a questions regarding deprecation, feel free to contact [email protected].

Release 3.0

GetID()

  • Warning: 3.0r0p2
  • Removed: 3.3

The usage of GetID() has been deprecated and will be removed, update your GetID() call to

$messageid

Release 3.2

DeliverWithDKIM's deliver_ arguments

  • Warning: 3.2r5
  • Removed: 3.5

The two options deliver_type (which controlled the delivery function to be called) and deliver_args (its arguments). Was never officially documented and will be removed.

DKIMSign(...);
Deliver(); 

DeliverAsSpam()

  • Warning: 3.2r5
  • Removed: 3.4r4

The usage of DeliverAsSpam() has been deprecated and will be removed, update your DeliverAsSpam() call to Deliver(). They effectively does the same since 3.0 anyway.

Deliver(); 

Release 3.3

ScanSPF()

  • Warning: 3.3r2
  • Removed: 3.5

The usage of ScanSPF() has been deprecated and will be removed, update your ScanSPF() call to

spf($senderip$senderhelo$senderdomain

Switch with variable

  • Warning: 3.3r3
  • Removed: 3.5

Switch statements could store the result of the expression in a variable. This is deprecated. You should store it yourself.

switch (expression) => $variable // deprecated syntax
    
...
}

$variable expression// new syntax
switch ($variable) {
    ...
}

switch (
$variable expression) { // alternative syntax
    
...

Trigger URL

  • Warning: 3.3r2
  • Removed: 3.5

Previously it was possible to configure a URL to and end-user installation. It was used by the Blacklist(), ScanBWList() and Quarantine() functions. This feature had a few limitation such as:

  1. It wasn't possible to change timeout or SSL settings for the HTTP request
  2. It wasn't possible for us to update the implementation (so it fall behind feature wise)
  3. Quarantine's register user as always called per recipient (without caching) regardless if local database users were used

To remove the warning (once done with the steps below), go to Mail > Quarantine > [edit] and remove the trigger URL on all quarantines.

Blacklist()

This function is removed in 3.5

Add an improved implementation which has caching. Verify that you have a supported end-user (which supports type=bwlist).

ScanBWList()

This function is removed in 3.5

Add an improved implementation which has caching. Verify that you have a supported end-user (which supports type=bwlist).

Quarantine()

This function will not create users since 3.5

If you have local database users in your quarantine. Add this replacement.

Functions without argument list

  • Warning: 3.3r2
  • Removed: 3.5

Previously we supported the syntax of variadic function without argument lists. Update your code as following (or improve the quality of your code by naming your arguments). If you don't use $argv, simple add an empty argument list () to silence this warning.

function name // deprecated syntax
    
...
}
function 
name(...$argv) { // new syntax
    
...

Release 3.4

WrapMessage()

  • Warning: 3.4r4
  • Removed: 4.0

The usage of WrapMessage() has been deprecated and will be removed, add this custom function to your script to silence this warning (and replace it with similar functionality).

function WrapMessage($subject$body)
{
 
MIME("0")->prependPart(
   
MIME()->setBody("$subject\r\n$body\r\n")
 );

Templates

  • Warning: 3.4r4
  • Removed: 3.5

The usage of template, variables and template_file to the mail() function has been deprecated and will be removed. Please contact [email protected] if you get this warning.

rawbody

  • Warning: TBD
  • Removed: TBD

The usage of rawbody has been deprecated. Use the MIME builder to send custom formatted mail.

Release 3.5

GuessAttachmentType()

  • Warning: 3.5
  • Removed: 3.5r3

The usage of GuessAttachmentType() has been deprecated and will be removed. Please contact [email protected] if you get this warning.

Release 4.0

dovecot_lookup_auth()

  • Warning: 4.0
  • Removed: 4.1

The dovecot_lookup_auth function has been re-implemented in HSL using the Socket API.

https://github.com/halon/hsl-examples/tree/master/protocols/dovecot

ident_lookup()

  • Warning: 4.0
  • Removed: 4.1

The ident_lookup function has been re-implemented in HSL using the Socket API.

https://github.com/halon/hsl-examples/tree/master/protocols/ident

Call function from string

  • Warning: 4.0
  • Removed: TBD

Calling cache's ttl_function and update_function as a string has been deprecated. In order to resolve this, simply remove the quotes around the function's name.

cache "ttl_function" => "my_update_function" ] ... 
// to
cache "ttl_function" => my_update_function ] ... 

Release 4.3

object cast operator

  • Warning: 4.3
  • Removed: 4.5

The object operator has been deprecated in favor of creating instances of known classes. If you have any questions regarding this please contact [email protected]

Release 4.4

ldap without URI

  • Warning: 4.4
  • Removed: TBD

The HSL functions ldap_search and ldap_bind should be called using standard LDAP URIs, eg.

ldap://10.0.0.1
ldaps://10.0.0.1

Deliver() in post-delivery

  • Warning: 4.4
  • Removed: TBD

Use the following code instead:

Retry(["delay" => 0, "reset_retry" => true, "transportid" => "mailtransport:X"]);

Release 4.7

DKIMADSP

  • Warning: 4.7
  • Removed: TBD

The DKIMADSP implementation was removed (since it is an historic protocol which should not be used) and we issue an warning if called. If you care to implement ADSP you could do it by using eg. DKIMSDID.

Historic variables in connect context

  • Warning: 4.7
  • Removed: TBD

Some variables are historically available since the connect script used to be a combined firewall script.

  • $service should be replaced with $serverid
  • $family could be determined using in_network or basic logic on the $senderip variable
  • $protocol is always "tcp"

Release 4.8

is_numer

  • Warning: 4.8
  • Removed: TBD

In previous versions (4.7 and below), HSL didn't have a native Boolean data type. True and False were defined as constants of 1 and 0. You therefore usually checked if a value were true or false by using

if (is_number($value) and $value == true// old way
if (is_boolean($value) and $value == true// new way 

It is usually save just to change is_number to is_boolean if there is a boolean you expect.

radius_authen

  • Removed: 4.8

The radius_authen was removed and re-implemented.

https://github.com/halon/hsl-examples/tree/master/protocols/radius

tacplus_authen

  • Removed: 4.8

tacplus_author

  • Removed: 4.8

TBD

ScanRPDAV()

  • Warning: TBD
  • Removed: TBD

The usage of ScanRPDAV() has been deprecated and will be removed, update your call to ScanRPD()

$score ScanRPDAV(); // deprecated
$score ScanRPD(["extended_result"=>true])["virus_score"]; // new 

ScanSARules()

  • Warning: TBD
  • Removed: TBD

The usage of ScanSARules() has been deprecated and will be removed, update your call to ScanSA()

$rules ScanSARules(); // deprecated
$rules array_keys(ScanSA(["rules"=>true])); // new

$scores ScanSARules(["scores" => true]); // deprecated
$scores ScanSA(["rules"=>true]); // new 

Attachment functions

  • Warning: TBD
  • Removed: TBD

The usage of all attachments functions has been deprecated and will be removed (in the future) update your code to use the MIME() object.

MIME("0")->getType(); 

Use the following alternatives

  • GetAttachmentsByType
    • MIME->findByType
  • GetAttachmentsByName
    • MIME->findByName
  • GetAttachmentType
    • MIME->getType
  • GetAttachmentName
    • MIME->getName
  • GetAttachmentSize
    • MIME->getSize
  • RemoveAttachments
    • MIME->remove

DeliverWithDKIM()

  • Warning: TBD
  • Removed: TBD

The usage of DeliverWithDKIM() has been deprecated and will be removed, update your DeliverWithDKIM(...) call to DKIMSign(...); Deliver().

DKIMSign(...); Deliver(); 

DirectDeliver()

  • Warning: TBD
  • Removed: TBD

Deliver(["queue" => false]);