33.4. SMTP diagnostics, statistics and debug

33.4.1. SMTP diagnostics

This command reports the current situation of the SMTP resource:

d d smtp

Shows the state of the resource.

d de smtp

Shows the state of the resource, and information about SMTP sessions.

[10:25:56] ABILIS_CPX:d d smtp   

RES:Smtp ----------------------------------------------------------------------
       Simple_Mail_Transfer_Protocol                                           
       STATE:ACTIVE    CUR-SES:10        ACTIVE-RES-IN:0    ACTIVE-MIX-IN:0
       QUEUE-OUT:0     QUEUE-DEFER:0     ACTIVE-RES-OUT:0   ACTIVE-MIX-OUT:0
       ------------------------------------------------------------------------
[10:31:49] ABILIS_CPX:d de smtp

RES:Smtp ----------------------------------------------------------------------
       Simple_Mail_Transfer_Protocol                                           
       STATE:ACTIVE    CUR-SES:10        ACTIVE-RES-IN:0    ACTIVE-MIX-IN:0
       QUEUE-OUT:0     QUEUE-DEFER:0     ACTIVE-RES-OUT:0   ACTIVE-MIX-OUT:0
       - Smtp Sessions --------------------------------------------------------
       CH TYPE TCP-State LocAdd-LocPort        RemAdd-RemPort        SMTP-State
       ------------------------------------------------------------------------
       0  OUT  READY                                                 READY
       1  OUT  READY                                                 READY
       2  IN   LISTEN    000.000.000.000-25                          READY
       3  IN   LISTEN    000.000.000.000-25                          READY
       4  IN   LISTEN    000.000.000.000-25                          READY
       5  IN   LISTEN    000.000.000.000-25                          READY
       6  IN   LISTEN    000.000.000.000-25                          READY
       7  IN   LISTEN    000.000.000.000-25                          READY
       8  IN   LISTEN    000.000.000.000-25                          READY
       9  IN   LISTEN    000.000.000.000-25                          READY

The meaning:

STATE

The SMTP driver state:

  • INACTIVE - SMTP does not accept incoming TCP calls and does not make outgoing TCP calls.

  • ACTIVE - SMTP fully active.

CUR-SES

The number of SMTP sessions.

ACTIVE-RES-IN

Reserved IN sessions currently active.

ACTIVE-RES-OUT

Reserved OUT sessions currently active.

ACTIVE-MIX-IN

Not reserved sessions currently opened in output mode.

ACTIVE-MIX-OUT

Not reserved sessions currently opened in input mode.

QUEUE-OUT

The number of mails currently in out queue.

QUEUE-DEFER

This number indicate how many mails are currently waiting in the queue of deferred mails. These mails are waiting the appropriate time interval in the queue of deferred mails, at the expiry they are moved in the QUEUE-OUT. Mails are deferred when a recoverable error occurs at the moment of their transmission.

CH

SMTP Session channel.

TYPE

SMTP Session type: IN or OUT.

TCP-State

SMTP Session TCP state:

  • DOWN - channel is down.

  • READY - channel is ready.

  • LISTEN - channel is listening.

  • CALLED - called procedure.

  • CALLING - calling procedure.

  • CONNECTED - channel is connected.

  • CLEARING - clearing state.

  • CLEARED - cleared state.

  • UNDEFINED - state undefined.

LocAdd-LocPort

Local IP Address and Local Port.

RemAdd-RemPort

Remote IP Address and Remote Port.

SMTP-State

SMTP Session state:

  • READY - for SMTP IN Session listening or SMTP OUT Session waiting for out message to send.

  • INACTIVE - if configuration parameter ACT:NO.

  • DOWN - if TCP port is down.

  • SMTP IN Session has this other steps:

    • WAITHELO - waiting for HELO or MAIL cmd;

    • WAITMAIL - received HELO, waiting for MAIL cmd;

    • WAITRCPT - received MAIL, waiting for RCPT cmd;

    • RCPT - received first RCPT, wait for RCPT or DATA;

    • DATA - received DATA cmd, waiting data and CRLF.CRLF.

  • SMTP OUT Session has this other steps:

    • START - starting session;

    • WAITCONN - Waiting connection and server greetings;

    • HELO - sent HELO cmd;

    • MAIL - sent MAIL cmd or RCPT cmd;

    • RCPT - sent last RCPT cmd;

    • DATA - sent DATA cmd;

    • TEXT - sending Mail text;

    • EOT - sent CRLF.CRLF;

    • QUIT - sent QUIT cmd;

    • ENDED - mail was sent.

33.4.2. SMTP statistics

This command can help to understand what is happening, in case of troubles:

d s smtp

Shows the statistics of the SMTP resource.

d se smtp

Shows the statistics of the SMTP resource for each session.

[10:31:53] ABILIS_CPX:d s smtp

RES:Smtp ----------------------------------------------------------------------
       Simple_Mail_Transfer_Protocol                                           
       --- Cleared 3 days 21:28:37 ago, on 29/09/2017 at 15:12:06 -------------
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CALL-SUCC  |          0|          4|CALL-FAIL  |          0|          2|
       EXT-SUCC   |          0|          0|EXT-FAIL   |          0|          0|
       NOTIFY     |           |          0|NOTIFY-LT  |           |          0|
       NOTIFY-SUCC|           |          0|NOTIFY-FAIL|           |          0|
       LOCAL-SUCC |          0|          0|LOCAL-FAIL |          0|          0|
       RELAY-SUCC |          0|          4|RELAY-FAIL |          0|          0|
       INT-SUCC   |          2|          4|INT-FAIL   |          0|          0|
       DENIED-IP  |          0|           |BANNED-IP  |          0|           |
       ------------------------------------------------------------------------
[10:38:50] ABILIS_CPX:d se smtp

RES:Smtp ----------------------------------------------------------------------
       Simple_Mail_Transfer_Protocol                                           
       --- Cleared 3 days 21:27:52 ago, on 29/09/2017 at 15:12:06 -------------
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CALL-SUCC  |          0|          4|CALL-FAIL  |          0|          2|
       EXT-SUCC   |          0|          0|EXT-FAIL   |          0|          0|
       NOTIFY     |           |          0|NOTIFY-LT  |           |          0|
       NOTIFY-SUCC|           |          0|NOTIFY-FAIL|           |          0|
       LOCAL-SUCC |          0|          0|LOCAL-FAIL |          0|          0|
       RELAY-SUCC |          0|          4|RELAY-FAIL |          0|          0|
       INT-SUCC   |          2|          4|INT-FAIL   |          0|          0|
       DENIED-IP  |          0|           |BANNED-IP  |          0|           |
       ------------------------------------------------------------------------
       - Smtp Sessions --------------------------------------------------------
       CH TYPE TCP-State LocAdd-LocPort        RemAdd-RemPort        SMTP-State
       ------------------------------------------------------------------------
       0  IN   LISTEN    000.000.000.000-25                          READY
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CALL-SUCC  |          0|          1|CALL-FAIL  |          0|          1|
       EXT-SUCC   |          0|          0|EXT-FAIL   |          0|          0|
       NOTIFY     |           |          0|NOTIFY-LT  |           |          0|
       NOTIFY-SUCC|           |          0|NOTIFY-FAIL|           |          0|
       LOCAL-SUCC |          0|          0|LOCAL-FAIL |          0|          0|
       RELAY-SUCC |          0|          1|RELAY-FAIL |          0|          0|
       INT-SUCC   |          0|          1|INT-FAIL   |          0|          0|
       ------------------------------------------------------------------------
       1  IN   LISTEN    000.000.000.000-25                          READY
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CALL-SUCC  |          0|          1|CALL-FAIL  |          0|          1|
       EXT-SUCC   |          0|          0|EXT-FAIL   |          0|          0|
       NOTIFY     |           |          0|NOTIFY-LT  |           |          0|
       NOTIFY-SUCC|           |          0|NOTIFY-FAIL|           |          0|
       LOCAL-SUCC |          0|          0|LOCAL-FAIL |          0|          0|
       RELAY-SUCC |          0|          1|RELAY-FAIL |          0|          0|
       INT-SUCC   |          0|          1|INT-FAIL   |          0|          0|
       ------------------------------------------------------------------------
       2  OUT  READY                                                 READY
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CALL-SUCC  |          0|          1|CALL-FAIL  |          0|          0|
       EXT-SUCC   |          0|          0|EXT-FAIL   |          0|          0|
       NOTIFY     |           |          0|NOTIFY-LT  |           |          0|
       NOTIFY-SUCC|           |          0|NOTIFY-FAIL|           |          0|
       LOCAL-SUCC |          0|          0|LOCAL-FAIL |          0|          0|
       RELAY-SUCC |          0|          1|RELAY-FAIL |          0|          0|
       INT-SUCC   |          0|          1|INT-FAIL   |          0|          0|
       ------------------------------------------------------------------------
       3  OUT  READY                                                 READY
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CALL-SUCC  |          0|          1|CALL-FAIL  |          0|          0|
       EXT-SUCC   |          0|          0|EXT-FAIL   |          0|          0|
       NOTIFY     |           |          0|NOTIFY-LT  |           |          0|
       NOTIFY-SUCC|           |          0|NOTIFY-FAIL|           |          0|
       LOCAL-SUCC |          0|          0|LOCAL-FAIL |          0|          0|
       RELAY-SUCC |          0|          1|RELAY-FAIL |          0|          0|
       INT-SUCC   |          0|          1|INT-FAIL   |          0|          0|
       ------------------------------------------------------------------------

With reference to the shown interval of time («Cleared 3 days 21:27:52 ago») these counters show the number of:

CALL-SUCCSuccessful incoming/outgoing TCP connections.
CALL-FAILUnsuccessful incoming/outgoing TCP connections.
EXT-SUCCIN - accepted external mails. OUT - external mails successfully delivered to a remote domain or a local mailbox.
EXT-FAILIN - refused external mails. OUT - external mails not delivered to a remote domain or a local mailbox.
NOTIFYGenerated mail failure notifications.
NOTIFY-LTGenerated mail failure notifications due to expired mail life time.
NOTIFY-SUCCMail failure notifications that were delivered.
NOTIFY-FAILMail failure notifications that cannot be delivered.
LOCAL-SUCCIN - accepted mails with at least one local recipients. OUT - mails successfully delivered to a local recipients.
LOCAL-FAILIN - refused mails with at least one local recipients. OUT - mails not delivered having at least one local recipient.
RELAY-SUCCIN - accepted mails with at least one recipient which needs relay. OUT - mails successfully delivered to a domain which needed relay.
RELAY-FAILIN - refused mails with at least one recipient which needs relay. OUT - mails not delivered having at least one domain which needed relay.
INT-SUCC IN - accepted internal mails. OUT - internal mails successfully delivered to a remote domain or a local mailbox.
INT-FAILIN - refused internal mails. OUT - internal mails not delivered to a remote domain or a local mailbox.
DENIED-IPSMTP requests received from the clients but not processed because requester (the author of this SMTP request) is not allowed. The not-allowed requester is a client whose IP address is not present in IPSRC and IPSRCLIST parameters configuration.
BANNED-IPRequests that was discarded because the source IP was banned by IPBAN service.

33.4.3. SMTP debug

Type the following command to view the commands allowed:

[15:29:42] ABILIS_CPX:debug res:smtp

RES:Smtp ----------------------------------------------------------------------
       Simple_Mail_Transfer_Protocol                                           
       BufferLength:64512  Date/Time:02/08/2016 15:34:42 TraceTime:5048386

Usage:

   LSN:0                                      - This help
   LSN:1                                      - Debug
   LSN:3                                      - Show session log
   LSN:3 CMD:CLR                              - Clear session log
   LSN:4 CMD:From:To:Subject:Message          - Send internal mail
[Note]Note

To use these commands you need to have administrator or super user rights.

Type the following command to view the SMTP session log:

[15:34:42] ABILIS_CPX:debug res:smtp lsn:3

RES:Smtp ----------------------------------------------------------------------
       Simple_Mail_Transfer_Protocol                                           
       BufferLength:64512  Date/Time:02/08/2016 15:36:09 TraceTime:5136243

02/08 14:10:25 [PORT] Starting server...
02/08 14:10:32 [IN]  Receiving message: 84A582F6
02/08 14:10:32 [  0] Waiting events (listen or wake-up)
02/08 14:10:32 [  1] Waiting events (listen or wake-up)
02/08 14:10:32 [  2] Waiting events (listen or wake-up)
02/08 14:10:32 [  3] Waiting events (listen or wake-up)
02/08 14:10:32 [  0] Start out-bound session
02/08 14:10:32 [  4] Waiting events (listen or wake-up)
02/08 14:10:32 [  5] Waiting events (listen or wake-up)
02/08 14:10:32 [  6] Waiting events (listen or wake-up)
02/08 14:10:32 [  7] Waiting events (listen or wake-up)
02/08 14:10:32 [  8] Waiting events (listen or wake-up)
02/08 14:10:32 [  9] Waiting events (listen or wake-up)
02/08 14:10:33 [IN]  Receiving message: 84A582F7
02/08 14:10:33 [  0] Delivering message: 84A582F6
02/08 14:10:33 [  0] DNS solving relay server: mail.test.it
02/08 14:10:33 [  1] Start out-bound session
02/08 14:10:33 [  1] Delivering message: 84A582F7