Difference between revisions of "Deprecation"

From Halon, SMTP software for hosting providers
Jump to: navigation, search
(Functions without argument list)
(GuessAttachmentType())
Line 102: Line 102:
  
 
* Warning: 3.5
 
* Warning: 3.5
* Removed: TBA
+
* Removed: 3.5r3
  
 
The usage of GuessAttachmentType() has been deprecated and will be removed. Please contact [email protected] if you get this warning.
 
The usage of GuessAttachmentType() has been deprecated and will be removed. Please contact [email protected] if you get this warning.

Revision as of 11:57, 9 June 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: 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
    
...

ScanSARules()

  • Warning: TBA
  • Removed: TBA

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

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

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

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

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.

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

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

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

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

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

Attachment functions

  • Warning: TBA
  • Removed: TBA

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