The command drop() refuses to accept an email and returns the specified SMTP code with a freely definable information text to the sending system.
•The incoming email will not be accepted (see difference to bounce()) •All subsequent commands are ignored •This command cannot be the condition for an if/else statement (see section Control Structures - If/Else Statements). |
Structure of the command
drop(['smtp_code'], ['text']);
.
Return value
positive |
always |
Parameters
smtp_code (optional)
The smtp_code specifies the reason for rejecting an email.
The meaning of the codes is structured as follows:
1XX |
The email server has accepted the request but has not yet become active itself. A confirmation message is required. |
2XX |
The email server has successfully executed the request without any errors. |
3XX |
The email server has understood the request but requires further information for processing. |
4XX |
The email server has detected a temporary error. If the request is repeated without any changes, processing may be completed. |
5XX |
The email server has detected a fatal error. The request cannot be processed. |
|
Source: Wikipedia Detailed lists of error codes can be found under www.supermailer.de/smtp_reply_codes.htm, for instance. |
Default: If this parameter is not specified, the code "555" is used.
text (optional)
The information text specifies the reason for the rejection in more detail.
Default: If this parameter is not specified, the text "mail NOT accepted" is output.
Example 1
Line |
Code |
---|---|
01 |
drop('451', Message could not be decrypted'); |
Explanation
In this example, an email is rejected with the error code "451 - Message could not be decrypted". The following entry is generated for this action in the system log: "Message Rejected. (451 - Message could not be decrypted)".