Difference between revisions of "Unit SMTP"
From Ultibo.org
Line 10: | Line 10: | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMTP specific constants''' <code> SMTP_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMTP_LINE_END = Chr(13) + Chr(10);</code> | ||
+ | | CR LF | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMTP_BUFFER_SIZE = SIZE_4K;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMTP status constants''' <code> SMTP_STATUS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMTP_STATUS_NONE = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMTP_STATUS_CONN = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STATUS_HELO = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STATUS_AUTH = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STATUS_MAIL = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STATUS_RCPT = 5;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STATUS_DATA = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STATUS_QUIT = 7;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMTP_MAX_STATUS = 7;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMTP command constants''' <code> SMTP_COMMAND_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_HELO = 'HELO';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_EHLO = 'EHLO';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_TIME = 'TIME';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_NOOP = 'NOOP';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_AUTH = 'AUTH';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_MAIL = 'MAIL';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_RCPT = 'RCPT';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_VRFY = 'VRFY';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_BEGIN_DATA = 'DATA';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_END_DATA = '.';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_RSET = 'RSET';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_COMMAND_QUIT = 'QUIT';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMTP sub command constants''' <code> SMTP_SUB_COMMAND_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMTP_SUB_COMMAND_MAIL_FROM = 'FROM:';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMTP_SUB_COMMAND_RCPT_TO = 'TO:';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMTP string constants''' <code> SMTP_STRING_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMTP_STRING_CONTINUE = '-';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMTP_STRING_CONN_SUCCESS = '220 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_QUIT_SUCCESS = '221 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_HELO_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_EHLO_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_TIME_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_NOOP_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_CONT_SUCCESS = '250-';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_AUTH_SUCCESS = '235 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_AUTH_CHALLENGE = '334 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_MAIL_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_RCPT_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_VRFY_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BEGIN_DATA_SUCCESS = '354 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_END_DATA_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_RSET_SUCCESS = '250 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMTP_STRING_WRITE_FAILURE = '451 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_COMMAND_FAILURE = '500 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_SYNTAX_FAILURE = '501 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_LOGON_FAILURE = '501 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_SEQUENCE_FAILURE = '503 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_AUTH_FAILURE = '504 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_RCPT_FAILURE = '553 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_VRFY_FAILURE = '550 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_SIZE_FAILURE = '552 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_FORWARD_FAILURE = '551 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_PERMISSION_FAILURE = '571 ';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMTP_STRING_CONN_OK = 'Ultibo SMTP server (version ' + ULTIBO_RELEASE_VERSION + ')';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_HELO_OK = 'Ultibo SMTP server - Hello, ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_EHLO_HEAD_OK = 'Ultibo SMTP server - Hello ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_EHLO_TAIL_OK = '; ESMTPs are: ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_AUTH_OK = 'Authenticated OK';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_MAIL_OK = 'Sender OK - send RCPTs';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_MAIL_SIZE_HEAD_OK = 'Sender and size (';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_MAIL_SIZE_TAIL_OK = ') OK - send RCPTs';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_RCPT_OK = 'Recipient OK - send RCPT or DATA';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_VRFY_OK = 'OK - ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BEGIN_DATA_OK = 'OK, send data, end with CRLF.CRLF';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_END_DATA_OK = 'Data received OK';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_RSET_OK = 'Command processed OK';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_QUIT_OK = 'Ultibo SMTP server closing connection';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_TIME_OK = 'Time is ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_NOOP_OK = 'OK';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BAD_COMMAND = 'Command unrecognized';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BAD_SYNTAX = 'Bad syntax in command';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BAD_SEQUENCE = 'Bad sequence of commands';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BAD_AUTH = 'Unrecognized authentication type';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BAD_LOGON = 'Authentication failed';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BAD_MAIL = 'Unknown sender';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BAD_RCPT = 'Unknown recipient';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMTP_STRING_BAD_VRFY = 'Mailbox not found';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMTP logging constants''' <code> SMTP_LOG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMTP_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code> | ||
+ | | SMTP debugging messages | ||
+ | |- | ||
+ | | <code>SMTP_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
+ | | SMTP informational messages, | ||
+ | |- | ||
+ | | <code>SMTP_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
+ | | SMTP error messages | ||
+ | |- | ||
+ | | <code>SMTP_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code> | ||
+ | | No SMTP messages | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === |
Revision as of 03:16, 16 December 2016
Return to Unit Reference
Description
To be documented
Constants
SMTP specific constants
SMTP_*
SMTP_LINE_END = Chr(13) + Chr(10);
|
CR LF |
SMTP_BUFFER_SIZE = SIZE_4K;
|
SMTP status constants
SMTP_STATUS_*
SMTP_STATUS_NONE = 0;
|
|
SMTP_STATUS_CONN = 1;
|
|
SMTP_STATUS_HELO = 2;
|
|
SMTP_STATUS_AUTH = 3;
|
|
SMTP_STATUS_MAIL = 4;
|
|
SMTP_STATUS_RCPT = 5;
|
|
SMTP_STATUS_DATA = 6;
|
|
SMTP_STATUS_QUIT = 7;
|
|
SMTP_MAX_STATUS = 7;
|
SMTP command constants
SMTP_COMMAND_*
SMTP_COMMAND_HELO = 'HELO';
|
|
SMTP_COMMAND_EHLO = 'EHLO';
|
|
SMTP_COMMAND_TIME = 'TIME';
|
|
SMTP_COMMAND_NOOP = 'NOOP';
|
|
SMTP_COMMAND_AUTH = 'AUTH';
|
|
SMTP_COMMAND_MAIL = 'MAIL';
|
|
SMTP_COMMAND_RCPT = 'RCPT';
|
|
SMTP_COMMAND_VRFY = 'VRFY';
|
|
SMTP_COMMAND_BEGIN_DATA = 'DATA';
|
|
SMTP_COMMAND_END_DATA = '.';
|
|
SMTP_COMMAND_RSET = 'RSET';
|
|
SMTP_COMMAND_QUIT = 'QUIT';
|
SMTP sub command constants
SMTP_SUB_COMMAND_*
SMTP_SUB_COMMAND_MAIL_FROM = 'FROM:';
|
|
SMTP_SUB_COMMAND_RCPT_TO = 'TO:';
|
SMTP string constants
SMTP_STRING_*
SMTP_STRING_CONTINUE = '-';
|
|
SMTP_STRING_CONN_SUCCESS = '220 ';
|
|
SMTP_STRING_QUIT_SUCCESS = '221 ';
|
|
SMTP_STRING_HELO_SUCCESS = '250 ';
|
|
SMTP_STRING_EHLO_SUCCESS = '250 ';
|
|
SMTP_STRING_TIME_SUCCESS = '250 ';
|
|
SMTP_STRING_NOOP_SUCCESS = '250 ';
|
|
SMTP_STRING_CONT_SUCCESS = '250-';
|
|
SMTP_STRING_AUTH_SUCCESS = '235 ';
|
|
SMTP_STRING_AUTH_CHALLENGE = '334 ';
|
|
SMTP_STRING_MAIL_SUCCESS = '250 ';
|
|
SMTP_STRING_RCPT_SUCCESS = '250 ';
|
|
SMTP_STRING_VRFY_SUCCESS = '250 ';
|
|
SMTP_STRING_BEGIN_DATA_SUCCESS = '354 ';
|
|
SMTP_STRING_END_DATA_SUCCESS = '250 ';
|
|
SMTP_STRING_RSET_SUCCESS = '250 ';
|
|
SMTP_STRING_WRITE_FAILURE = '451 ';
|
|
SMTP_STRING_COMMAND_FAILURE = '500 ';
|
|
SMTP_STRING_SYNTAX_FAILURE = '501 ';
|
|
SMTP_STRING_LOGON_FAILURE = '501 ';
|
|
SMTP_STRING_SEQUENCE_FAILURE = '503 ';
|
|
SMTP_STRING_AUTH_FAILURE = '504 ';
|
|
SMTP_STRING_RCPT_FAILURE = '553 ';
|
|
SMTP_STRING_VRFY_FAILURE = '550 ';
|
|
SMTP_STRING_SIZE_FAILURE = '552 ';
|
|
SMTP_STRING_FORWARD_FAILURE = '551 ';
|
|
SMTP_STRING_PERMISSION_FAILURE = '571 ';
|
|
SMTP_STRING_CONN_OK = 'Ultibo SMTP server (version ' + ULTIBO_RELEASE_VERSION + ')';
|
|
SMTP_STRING_HELO_OK = 'Ultibo SMTP server - Hello, ';
|
|
SMTP_STRING_EHLO_HEAD_OK = 'Ultibo SMTP server - Hello ';
|
|
SMTP_STRING_EHLO_TAIL_OK = '; ESMTPs are: ';
|
|
SMTP_STRING_AUTH_OK = 'Authenticated OK';
|
|
SMTP_STRING_MAIL_OK = 'Sender OK - send RCPTs';
|
|
SMTP_STRING_MAIL_SIZE_HEAD_OK = 'Sender and size (';
|
|
SMTP_STRING_MAIL_SIZE_TAIL_OK = ') OK - send RCPTs';
|
|
SMTP_STRING_RCPT_OK = 'Recipient OK - send RCPT or DATA';
|
|
SMTP_STRING_VRFY_OK = 'OK - ';
|
|
SMTP_STRING_BEGIN_DATA_OK = 'OK, send data, end with CRLF.CRLF';
|
|
SMTP_STRING_END_DATA_OK = 'Data received OK';
|
|
SMTP_STRING_RSET_OK = 'Command processed OK';
|
|
SMTP_STRING_QUIT_OK = 'Ultibo SMTP server closing connection';
|
|
SMTP_STRING_TIME_OK = 'Time is ';
|
|
SMTP_STRING_NOOP_OK = 'OK';
|
|
SMTP_STRING_BAD_COMMAND = 'Command unrecognized';
|
|
SMTP_STRING_BAD_SYNTAX = 'Bad syntax in command';
|
|
SMTP_STRING_BAD_SEQUENCE = 'Bad sequence of commands';
|
|
SMTP_STRING_BAD_AUTH = 'Unrecognized authentication type';
|
|
SMTP_STRING_BAD_LOGON = 'Authentication failed';
|
|
SMTP_STRING_BAD_MAIL = 'Unknown sender';
|
|
SMTP_STRING_BAD_RCPT = 'Unknown recipient';
|
|
SMTP_STRING_BAD_VRFY = 'Mailbox not found';
|
SMTP logging constants
SMTP_LOG_*
SMTP_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;
|
SMTP debugging messages |
SMTP_LOG_LEVEL_INFO = LOG_LEVEL_INFO;
|
SMTP informational messages, |
SMTP_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;
|
SMTP error messages |
SMTP_LOG_LEVEL_NONE = LOG_LEVEL_NONE;
|
No SMTP messages |
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure SMTPInit;
Description: To be documented
Note | None documented |
---|
SMTP helper functions
procedure SMTPLog(Level:LongWord; const AText:String);
Description: To be documented
Note | None documented |
---|
procedure SMTPLogInfo(const AText:String);
Description: To be documented
Note | None documented |
---|
procedure SMTPLogError(const AText:String);
Description: To be documented
Note | None documented |
---|
procedure SMTPLogDebug(const AText:String);
Description: To be documented
Note | None documented |
---|
Return to Unit Reference