SMTP - mts

advertisement
IMSLoader User Manual / SMTP protocol / version: %VERSION%
User Manual
SMTP protocol
Version: %VERSION%
1/7
IMSLoader User Manual / SMTP protocol / version: %VERSION%
Table of contents
1
2
3
4
5
6
Generalities .................................................................................................................... 3
1.1
Reference documents ............................................................................................ 3
1.2
Short summary....................................................................................................... 3
1.3
Stack implementations ........................................................................................... 3
Protocol elements........................................................................................................... 3
2.1
Message element................................................................................................... 3
2.2
Channel element .................................................................................................... 3
2.3
Listenpoint element ................................................................................................ 3
Protocol operations ........................................................................................................ 4
3.1
<sendMessageSMTP> operation ........................................................................... 4
3.2
<receiveMessageSMTP> operation ....................................................................... 4
3.3
<openChannelSMTP> operation ............................................................................ 5
3.4
<closeChannelSMTP> operation ........................................................................... 5
3.5
<createListenpointSMTP> operation ...................................................................... 5
3.6
<removeListenpointSMTP> operation .................................................................... 6
Message analyze ........................................................................................................... 6
Configuration file ............................................................................................................ 6
Tutorial location .............................................................................................................. 6
2/7
IMSLoader User Manual / SMTP protocol / version: %VERSION%
1
Generalities
1.1
Reference documents
The SMTP protocol is standardized by the IETF in the RFC5321 document.
1.2
Short summary
Here is a short summary of the SMTP protocol:
1) SMTP main feature is to allow a client to send electronic mail messages.
2) SMTP is a text protocol ie the SMTP messages are not encoded and are transported
as a clear text character string. So SMTP is easy to debug.
3) SMTP is a transactional asynchronous protocol : there are a request emitted only
by the client, and a response emitted by the server, to answer the request.
4) RFC5321 discuss about the transport of SMTP on TCP, but other transports are also
possible like TLS for example.
1.3
Stack implementations
There is one stack implemented on the java.net package. Actually the only transport
supported is TCP.
2
Protocol elements
2.1
Message element
Here is the signification of the message attribute for the SMTP protocol:
Message attribute
Description
protocol
= SMTP
request
type
= true for request
= false for response
= the SMTP command passed in the request
result
= the reply code of message contained in the response
transactionId
N/A
messageId
N/A
scenarioName
= the protocol name SMTP
retransmissionId
N/A
2.2
Channel element
The channel element is supported for the protocol SMTP, so we are able to create client
connections in SMTP scenarios.
2.3
Listenpoint element
The listenpoint element is supported for the protocol SMTP, so we are able to listen
dynamically on socket in SMTP scenarios.
3/7
IMSLoader User Manual / SMTP protocol / version: %VERSION%
3
Protocol operations
For the SMTP protocol we defined the 6 following generic operations.
Generic operations
Features
<sendMessageSMTP>
<openChannelSMTP>
To send a message for the SMTP protocol using a
listenpoint or a channel
To wait until a message of the SMTP protocol is received.
The scenario failed if no message is received.
The user can specify some filtering criteria to accept the
incoming message
To open a channel for the SMTP protocol.
<closeChannelSMTP>
To close a channel for the SMTP protocol.
<createListenpointSMTP>
To start listening for the SMTP protocol.
<removeListenpointSMTP>
To stop listening for the SMTP protocol.
<receiveMessageSMTP>
3.1
<sendMessageSMTP> operation
The standard features of this operation are described in the core operation documentation.
The only way to send SMTP messages is by specifying the channel on which the message
should be sent.
Operation content
XML syntax
<sendMessageSMTP>
content
text
format
CDATA
[1, 1]
description
The text block of the SMTP message exactly as it is
transported on the network.
Example : Send a SMTP message
<?xml version="1.0" encoding="UTF-8"?>
<scenario>
<sendMessageSMTP name="comment" channel="alice_terminal">
<![CDATA[MAIL FROM:<Smith@gmail.com> parametre]]>
</sendMessageSMTP>
</scenario>
3.2
<receiveMessageSMTP> operation
The standard features of this operation are described in the core module documentation.
4/7
IMSLoader User Manual / SMTP protocol / version: %VERSION%
Example : Receive a SMTP message
<?xml version="1.0" encoding="UTF-8"?>
<scenario>
<receiveMessageSMTP name="comment" request=”false” type=”EHLO”
timeout="0.1" failedOnTimeout="false" failedOnReceive="true">
<parameter name="[param1]" operation="protocol.setFromMessage"
value="firstline.replyCode"/>
<parameter name="[param2]" operation="protocol.setFromMessage"
value="firstline.reasonPhrase"/>
<test parameter="[param2]" condition="string.equals"
value="value2"/>
</receiveMessageSMTP>
</scenario>
3.3
<openChannelSMTP> operation
The standard features of this operation are described in the core_module documentation.
Example : Open a SMTP channel
<?xml version="1.0" encoding="UTF-8"?>
<scenario>
<openChannelSMTP name="terminal"
localHost=”172.16.21.32" localPort="7070"
remoteHost=”172.16.21.23" remotePort="5060">
<openChannelSMTP/>
</scenario>
3.4
<closeChannelSMTP> operation
The standard features of this operation are described in the core_module documentation.
Example : Close a SMTP channel
<?xml version="1.0" encoding="UTF-8"?>
<scenario>
<closeChannelSMTP name="terminal"/>
</scenario>
3.5
<createListenpointSMTP> operation
The standard features of this operation are described in the core_module documentation.
Example : Create a SMTP listenpoint
<?xml version="1.0" encoding="UTF-8"?>
<scenario>
<createListenpointSMTP name="terminal"
localHost=”172.16.21.32" localPort="7070">
<createListenpointSMTP/>
</scenario>
5/7
IMSLoader User Manual / SMTP protocol / version: %VERSION%
3.6
<removeListenpointSMTP> operation
The standard features of this operation are described in the core_module documentation.
Example : Remove a SMTP listenpoint
<?xml version="1.0" encoding="UTF-8"?>
<scenario>
<removeListenpointSMTP name="terminal"/>
</scenario>
4
Message analyze
The generic path (available in all protocols) are described in the core_module
documentation.
Here is the list of specific path for the SMTP protocol
Specific path
data.text
data.binary
Feature
Return the data contained in the SMTP message under the
textual format
Return the data contained in the SMTP message under the
binary format
firstline.commandName
Return the command name of the SMTP request
firstline.string
Return the
firstline.from
Return the sender of the message
firstline.to
Return the receiver of the message
firstline.parameter
firstline.replycode
Return the reply code contained in the response
firstline.reasonPhrase
Return the reason phrase contained in the response
5
Configuration file
The protocol config file located at following path:
<InstallDirectory>/conf/smtp.properties
This config files is self-documented and contain the complete description for each parameter
as a comment block just before the parameter definition.
6
Tutorial location
If you want to learn how to use IMSloader for the SMTP protocol, you are have a look to the
tutorial provided by the tool. Of course, you could use these scripts as a starting point too, if
you have to write a some new testcases.
6/7
IMSLoader User Manual / SMTP protocol / version: %VERSION%
Examples of scripts are located in the <InstallDir>/tutorial/smtp
7/7
Download