Add SMTP List Entry (ADDSMTPLE)

The Add SMTP List Entry (ADDSMTPLE) command is used to add elements to SMTP configuration lists. These lists may be enabled or disabled using the Change SMTP Attributes (CHGSMTPA) command or from the SMTP Properties panel in IBM i Navigator. The changes take effect the next time the SMTP server is started either by the Start TCP/IP (STRTCP) command or by the Start TCP/IP Server (STRTCPSVR) command.

Restrictions:

Parameters

Keyword Description Choices Notes
TYPE List type *ACCEPT, *REJECT, *NEAR, *DOMAIN, *SVRBIND, *CLTBIND, *ETRNSVR, *FTRSUBJECT, *FTRORIGIN, *FTRFILNAME, *FTRTYPE, *HOSTAUTH, *ACCEPTIP6, *REJECTIP6, *DOMAINIP6, *SVRBNDIP6, *CLTBNDIP6 Required, Positional 1
INTNETADR Internet address Character value Optional
SUBNETMASK Subnet mask Character value, '255.255.255.255' Optional
HOSTNAME Host name Character value Optional
FTRDATA Filter data Character value Optional
USERNAME User name Character value Optional
PASSWORD User password Character value Optional
IP6PFX IPv6 prefix Character value Optional
IP6NETADR IPv6 address Character value Optional

List type (TYPE)

Specifies which list to add the new element to.

*ACCEPT
The Accept Relay list is updated. Specifies a list of IP addresses with netmasks that will be allowed to relay when "Accept relay messages from" is selected on the SMTP Properties Relay Restrictions page on IBM i Navigator. Parameters valid with this value are INTNETADR and SUBNETMASK.
*REJECT
Adds an IP address and netmask to the Relay Restrictions list. This a list of IP addresses with netmasks that will be rejected if they try to connect to the IBM i SMTP. Parameters valid with this value are INTNETADR and SUBNETMASK.
*NEAR
Adds a domain to the Near Domain list. The Near Domain list is a list of domains for which mail should not be routed through the firewall, when "Forward outgoing mail to router through firewall" is selected on the SMTP Properties General page in IBM i Navigator. Also specifies SMTP should relay mail for recipients whose domains are in the Near Domain list when "Relay mail for only these domains" is selected. Parameter valid with this value is HOSTNAME.
*DOMAIN
Specifies the domain to associate with each IPv4 interface that the SMTP server will bind to. Parameters valid with this value are HOSTNAME, and INTNETADR.
*SVRBIND
Specifies the IPv4 interfaces that the SMTP server will bind to. Parameter valid with this value is INTNETADR.
*CLTBIND
The Client Bind list is updated. Specifies the IPv4 interface the SMTP client should bind to. Parameter valid with this value is INTNETADR.
*ETRNSVR
The ETRN Server list is updated. Specifies the list of hosts from which the server will accept the ETRN command. Parameter valid with this value is HOSTNAME.
*FTRSUBJECT
The Subject Filter list is updated. Adds an item to the Subject comparison list. Mail is discarded or quarantined, as specified on the SMTP properties Filters Page, if comparison conditions are met. Parameter valid with this value is FTRDATA.
*FTRORIGIN
The Originator Filter list is updated. Adds an item to the Originator's address comparison list. Mail is discarded or quarantined, as specified on the SMTP properties Filters Page, if comparison conditions are met. Parameter valid with this value is FTRDATA.
*FTRFILNAME
The File Name Filter list is updated. Adds an item to the "Filename / extension comparison" list. Mail is discarded or quarantined, as specified on the SMTP properties Filters Page, if comparison conditions are met. Parameter valid with this value is FTRDATA.
*FTRTYPE
The File Type Filter list is updated. Adds an item to the Type / subtype comparison list. Mail is discarded or quarantined, as specified on the SMTP properties Filters Page, if comparison conditions are met. Parameter valid with this value is FTRDATA.
*HOSTAUTH
The host logon information is updated. Adds the username and password which will be used to authenticate the specified host. The information is stored encrypted in a database file using base64. Parameters valid with this value are HOSTNAME, USERNAME, and PASSWORD. The USERNAME and PASSWORD values will be used to logon to the next host.
*ACCEPTIP6
The Accept Relay list is updated. Specifies a list of IPv6 addresses or prefixes that will be allowed to relay when "Accept relay messages from" is selected on the SMTP Properties Relay Restrictions page on IBM i Navigator. Parameter valid with this value is PREFIXIP6.
*REJECTIP6
Adds an IPv6 address or prefix to the Relay Restrictions list. This a list of IPv6 addresses with prefixes that will be rejected if they try to connect to SMTP. Parameter valid with this value is PREFIXIP6.
*DOMAINIP6
Specifies the domain to associate with each IPv6 interface that the SMTP server will bind to. Parameters valid with this value are IP6NETADR and HOSTNAME.
*SVRBINDIP6
Specifies the IPv6 interfaces that the SMTP server will bind to. Parameter valid with this value is IP6NETADR.
*CLTBINDIP6
The Client Bind list is updated. Specifies the IPv6 interface the SMTP client should bind to. Parameter valid with this value is IP6NETADR.

IPv4 address (INTNETADR)

Specifies the IPv4 internet address to add to the specified list. This address should be in dotted decimal format. Up to 15 characters can be specified.

Subnet mask (SUBNETMASK)

Specifies the mask to use with the IPv4 internet address.

255.255.255.255
This value selects only a single address value.
subnet-mask
The mask to use with the IPv4 internet address. Up to 15 characters can be specified. Valid mask values are 128.0.0.0 - 255.255.255.255

Host name (HOSTNAME)

Specifies the host name to add to the list. Up to 255 characters can be specified.

Filter data (FTRDATA)

Specifies the data to match when filtering. Up to 512 characters can be specified.

User name (USERNAME)

Specifies the identifier used to logon to the SMTP server. Up to 80 characters can be specified.

Valid characters are case sensitive and include all alpha-numeric characters (a-z, A-Z, and 0-9), and the following special characters:

PERIOD(.),
COMMA(,),
EXCLAMATION MARK(!),
NUMBER SIGN(#),
DOLLAR SIGN($),
PERCENT SIGN(%),
AMPERSAND(&),
ASTERISK(*),
PLUS SIGN(+),
HYPHEN(-),
SLASH(/),
COLON(:),
SEMICOLON(;),
EQUAL SIGN(=),
COMMERCIAL AT(@),
QUESTION MARK(?),
UNDERSCORE(_),
TILDE,
CIRCUMFLEX ACCENT.

User password (PASSWORD)

Specifies the password that corresponds to the username to logon to the SMTP server. If the password needs to be changed, you must first issue the RMVSMTPLE TYPE(*HOSTAUTH) CL command to remove the specified hostname and then issue the ADDSMTPLE TYPE(*HOSTAUTH) to add the hostname. Up to 128 characters can be specified.

Valid characters are case sensitive and include all alpha-numeric characters (a-z, A-Z, and 0-9), and the following special characters:

PERIOD(.),
COMMA(,),
EXCLAMATION MARK(!),
NUMBER SIGN(#),
DOLLAR SIGN($),
PERCENT SIGN(%),
AMPERSAND(&),
ASTERISK(*),
PLUS SIGN(+),
HYPHEN(-),
SLASH(/),
COLON(:),
SEMICOLON(;),
EQUAL SIGN(=),
COMMERCIAL AT(@),
QUESTION MARK(?),
UNDERSCORE(_),
TILDE,
CIRCUMFLEX ACCENT.

IPv6 prefix (IP6PFX)

Specifies the IPv6 internet address or a IPv6 prefix to add to the specified list. This address should be in IPv6 network format. Up to 44 characters can be specified.

IPv6 address (IP6NETADR)

Specifies the IPv6 internet address to add to the specified list. This address should be an IPv6 address and not a network. Up to 40 characters can be specified.

Examples

Example 1: Adding an IPv4 Element to the Accept Relay List

ADDSMTPLE   TYPE(*ACCEPT)  INTNETADR('1.2.3.4')

This command adds an address 1.2.3.4 to the Accept Relay list. The assumed mask is 255.255.255.255. This means that this address can be used to connect to the SMTP server to relay mail to another server.

Example 2: Adding an Element to the Subject Filter List

ADDSMTPLE   TYPE(*FTRSUBJECT)  FTRDATA('Love you.')

This command adds an element to the Subject Filter list. Any mail with an exact match to the subject 'Love you.' will be filtered as specified by the CHGSMTPA attributes.

Example 3: Adding an Element to the Host Authentication List

ADDSMTPLE   TYPE(*HOSTAUTH)  HOSTNAME('xyz.com')
            USERNAME(admin) PASSWORD(secret)

This command adds an element to the Host logon list. The SMTP server will be able to logon to the host 'xyz.com'.

Example 4: Adding a Single IPv6 Element to the Accept Relay List

ADDSMTPLE   TYPE(*ACCEPTIP6)  IP6PFX('2001:DB8::1')

This command adds the IPv6 Address 2001:DB8::1 to the accept relay list.

Example 5: Adding a IPv6 Prefix Element to the Accept Relay List

ADDSMTPLE   TYPE(*ACCEPTIP6)  IP6PFX('2001:DB8::/32')

This command adds the IPv6 Prefix 2001:DB8::/32 to the accept relay list.

Example 6: Adding a IPv6 Address Element to the Server Bind List

ADDSMTPLE   TYPE(*SVRBINDIP6)  IP6NETADR('2001:DB8::1')

This command adds the IPv6 Address 2001:DB8::1 to the server bind list.

Error messages

*ESCAPE Messages

TCP1901
Internet address &2 not valid.
TCP1903
Specified host name not valid.
TCP96B7
USERNAME value not valid.
TCP96B8
USERNAME value required for specified list type.
TCP96B9
PASSWORD value required for specified list type.
TCP96BA
PASSWORD value not allowed for specified list type.
TCP96BB
USERNAME value not allowed for specified list type.
TCP96BC
PASSWORD value not valid.
TCP264F
SUBNETMASK parameter value &2 not valid.
TCP265F
INTNETADR parameter value &2 not valid.
TCP8050
*IOSYSCFG authority required to use &1.
TCP96AE
Duplicate entry found in SMTP list type &1.
CPF9847
Error occurred while closing file &1 in library &2.
CPF9848
Cannot open file &1 in library &2 member &3.
CPF9849
Error while processing file &1 in library &2 member &3.