Difference between revisions of "Deprecation"

From Halon, SMTP software for hosting providers
Jump to: navigation, search
(WrapMessage())
(WrapMessage())
Line 99: Line 99:
 
{
 
{
 
  MIME("0")->prependPart(
 
  MIME("0")->prependPart(
   MIME()->setBody("$subject\r\n$body")
+
   MIME()->setBody("$subject\r\n$body\r\n")
  )
+
  );
 
}
 
}
 
</hsl>
 
</hsl>

Revision as of 10:56, 11 February 2016

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].

Switch with variable

  • Warning: 3.3r3
  • Removed: TBA

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: TBA

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()

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

ScanBWList()

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

Quarantine()

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

Functions without argument list

  • Warning: 3.3r2
  • Removed: TBA

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
    
...

ScanSARules()

  • Warning: TBA
  • Removed: TBA

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

ScanSARules() // deprecated format
array_keys(ScanSA(["rules"=>true])) // new format (#note1)

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

note1: even if this syntax is longer, it's now possible to check for a rule with isset() instead of in_array().

if (in_array("MY_RULE"ScanSARules())) {
 
// deprecated format
}
if (isset(
ScanSA(["rules"=>true])["MY_RULE"])) {
 
// new format

WrapMessage()

  • Warning: 3.4r4
  • Removed: TBA

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")
 );

ScanSPF()

  • Warning: 3.3r2
  • Removed: TBA

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

spf($senderip$senderhelo$senderdomain

GetID()

  • Warning: 3.0r0p2
  • Removed: 3.3

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

$messageid

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(); 

DeliverWithDKIM()

  • Warning: TBA
  • Removed: TBA

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

DKIMSign(...); Deliver(); 

DeliverWithDKIM's deliver_ arguments

  • Warning: 3.2r5
  • Removed: TBA

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. Add a function override for Deliver in order to control its behavior.

function Deliver() {
    
builtin DirectDeliver(); // use DirectDeliver
}
DeliverWithDKIM(...);