Skip to content

Mail Testing Task

The Mail Testing Task defines a Mail (POP3/IMAP) protocol testing task for mail functionality, performance, stability, and custom testing.

Main Parameter List

ParameterTypeRequiredLength LimitDescription
targetenumYes-Task Type
Fixed value: MAIL
namestringYes≤400 charsTask Name
Unique identifier for the mail task
descriptionstringNo≤800 charsTask Description
Detailed explanation of task purpose
enabledbooleanYes-Enable Status
true: Enabled (default)
false: Disabled
beforeNamestringNo≤400 charsPredecessor Task
Controls task execution order
protocolenumYes-Mail Protocol
POP3: Post Office Protocol
IMAP: Internet Message Access Protocol
serverobjectYes-Server Configuration
See server configuration details below
mailobjectYes-Mail Configuration
See mail configuration details below

Note

Multiple Mail interfaces can be orchestrated simultaneously, but only one Mail task can be enabled for testing at a time.

Complete Mail configuration example:

yaml
- target: MAIL
  name: Get mail messages (IMAP)
  description: Using IMAP protocol to obtain emails
  enabled: true
  protocol: IMAP
  server:
    # Mail server configuration ...
  mail:
    # Mail configuration

Mail Server Configuration (server)

Field NameTypeRequiredRange/LengthDefaultDescription
serverstringYes--Mail Server Address
Supports domain/IP
Example: mail.example.com
portintegerYes1-65535-Service Port
Standard ports:
SMTP:25, POP3:110, IMAP:143
Secure ports:
SMTPS:465, POP3S:995, IMAPS:993
securityobjectYes--Security Configuration Object
See security configuration details
useAuthbooleanYes-trueEnable Authentication
true: Requires username/password
false: Anonymous access
usernamestringConditional≤400 chars-Authentication Account
Required when useAuth=true
Full email format: user@domain.com
passwordstringConditional≤4096 chars-Authentication Credential
Required when useAuth=true
Supports encrypted storage
connectTimeoutstringNo1s-24h6sConnection Timeout
Format: number+unit (e.g., 10s)
Maximum wait time for TCP connection
readTimeoutstringNo1s-24h60sRead Timeout
Format: number+unit (e.g., 30s)
Maximum wait time for single data read

Mail server configuration example:

yaml
server:
  server: 192.168.0.211
  port: 993
  security:
    # Security configuration ...
  useAuth: true
  username: test001@xcan.cloud
  password: test001@xcan
  readTimeout: 60s
  connectTimeout: 6s

Mail Server Security Configuration (security)

ParameterTypeRequiredLength LimitDefaultDescription
useenumYes-NONEEncryption Type
NONE: Plaintext
USE_SSL: SSL encryption
USE_STARTTLS: STARTTLS upgrade
trustAllCertsbooleanNo-falseTrust All Certificates
true: Skip certificate verification (dangerous)
false: Verify certificate validity
enforceStartTLSbooleanNo-falseEnforce STARTTLS
true: Reject unsupported servers
false: Fallback to plaintext
useLocalTrustStorebooleanNo-falseUse Local Trust Store
true: Use custom certificates
false: Use system defaults
trustStorePathstringConditional≤4096 chars-Trust Store Path
Local certificate file path
Example: /etc/ssl/custom.pem
trustStoreBase64ContentstringConditional≤40KB-Trust Store Content
Base64-encoded certificate content
tlsProtocolsstringNo≤80 chars-Enforce Protocol Version
Example: TLSv1.2, TLSv1.3

Note

When using trustStorePath, ensure the file has been uploaded to the corresponding execution node path.

Mail server security configuration example:

yaml
security:
  use: USE_START_TLS
  trustAllCerts: true
  enforceStartTLS: false
  useLocalTrustStore: false
  trustStorePath: ""
  trustStoreBase64Content: VGhpcyBpcyBhIGNlcnRpZmljYXRlIGNvbnRlbnQ=
  tlsProtocols: TLSv1.2

Mail Configuration (mail)

Field NameTypeRequiredLength/Quantity LimitDescription
folderstringNo≤100 charsTarget Mail Folder
Default: INBOX
Supports standard folders (SENT/DRAFTS/TRASH) or custom paths
deleteMessagebooleanNo-Mail Deletion Policy
true: Automatically delete after processing
false: Keep mail (default)
storeMimeMessagebooleanNo-Original Mail Storage
true: Save complete MIME-formatted mail to task directory
false: Do not store (default)
numMessagesintegerNo≥0Mail Processing Quantity
Default: 1
0: Process all mail
N: Limit to N messages

Mail configuration example:

yaml
mail:
  folder: INBOX
  deleteMessage: false
  storeMimeMessage: true
  numMessages: 1

Script Examples (target)

Complete Parameter Configuration Example

yaml
- target: MAIL
  name: Get mail messages (IMAP)
  description: Using IMAP protocol to obtain emails
  enabled: true
  protocol: IMAP
  server:
    server: 192.168.0.211
    port: 993
    security:
      use: USE_START_TLS
      trustAllCerts: true
      enforceStartTLS: false
      useLocalTrustStore: false
      trustStorePath: ""
      trustStoreBase64Content: VGhpcyBpcyBhIGNlcnRpZmljYXRlIGNvbnRlbnQ=
      tlsProtocols: TLSv1.2
    useAuth: true
    username: test001@xcan.cloud
    password: test001@xcan
    readTimeout: 60s
    connectTimeout: 6s
  mail:
    folder: INBOX
    deleteMessage: false
    storeMimeMessage: false
    numMessages: 1

Retrieve Emails Using IMAP Protocol

yaml
- target: MAIL
  name: Get mail messages (IMAP)
  description: Using IMAP protocol to obtain emails
  enabled: true
  protocol: POP3
  server:
    server: 192.168.0.211
    port: 995
    security:
      use: USE_START_TLS
      trustAllCerts: true
    useAuth: true
    username: test001@xcan.cloud
    password: test001@xcan
    readTimeout: 60s
    connectTimeout: 6s
  mail:
    folder: INBOX
    deleteMessage: false
    storeMimeMessage: false
    numMessages: 1

Retrieve Emails Using POP3 Protocol

yaml
- target: MAIL
  name: Get mail messages (POP3)
  description: Using POP3 protocol to obtain emails
  enabled: true
  protocol: POP3
  server:
    server: 192.168.0.211
    port: 995
    security:
      use: USE_START_TLS
      trustAllCerts: true
    useAuth: true
    username: test001@xcan.cloud
    password: test001@xcan
    readTimeout: 60s
    connectTimeout: 6s
  mail:
    folder: INBOX
    deleteMessage: false
    storeMimeMessage: false
    numMessages: 1

Released under the GPL-3.0 License.