4.3

E-mail Style Processing ModeIn the e-mail style processing mode, processing result messages are retrieved from the NACCS
Center server after a certain period of time. Therefore, the response time for processing request
messages is not as quick as for the interactive processing mode (SMTP two-way). In addition, thisprocessing mode can be used by only computer connected to the user system; which reduces theburden for the user system to create NACCS EDI messages.
Moreover, for e-mail style processing modes, there is the e-mail style processing mode for NACCS
EDI messages and the e-mail style processing mode for EDIFACT messages. However, they arebasically the same method except for the difference in message structure.
Furthermore, the e-mail style processing mode enables the user to send more than one processing
request message in a single request. Processing result messages, however, need to be retrieved (orreceived) from the NACCS Center server in a batch after a certain period of time.

4.3.1
4.3.1.1

E-mail style processing for NACCS EDI messages
Outline of e-mail style processing mode (other than EDIFACT messages)

For E-mail style processing for NACCS EDI messages, software developed by the user is used.
Figure 4.3.1 shows outline of e-mail style processing mode for processing NACCS EDI messages. In
addition, for e-mail sending, refer to "4.6.1 e-mail".

(1) SMTP
SMTP header
SMTPヘッダー
SMTPヘッダー

NACCS EDI
Message

NACCS EDI Message
Air-NACCS EDI電文
Air-NACCS EDI電文(Transmitted
one by one)Core
processing
systemMail server(2) POP3
Gateway
computer(Messages are retrieved by user)

SMTP header
SMTPヘッダー
SMTPヘッダー

NACCS EDI
Message

NACCS EDI Message
Air-NACCS EDI電文
Air-NACCS EDI電文

User system

NACCS Center server

Figure 4.3.1 Outline of Connection Mode of E-mail Processing Mode for NACCS EDI Messages(1) The user creates and sends an NACCS EDI message that contains data required for the
relevant procedure to the mail server over the SMTP protocol. More than one messages canbe sent at a time.
(2) Messages transmitted to the mail server are transferred to the core processing system one byone. The core processing system then processes the message and forwards a processing
result message to the user's mailbox on the mail server. Then the user retrieves theprocessing result message from the mailbox over the POP3 protocol.

4-3-1

4.3.1.2

Details of the communications protocols

In e-mail style processing mode for NACCS EDI messages, TCP/IP is used for the network andtransport layers, and regarding the upper layer, SMTP for sending processing request messages
and POP3 for receiving processing result messages are used as communications protocols.
(1) SMTP specifications in transmission of processing request message(A) Applicable SMTP commands
SMTP commands used in e-mail style processing mode for NACCS EDI messages and their
responses are listed in Table 4.3.1

Command

HELO

MAIL
RCPT
DATA
RSET
QUIT

Table 4.3.1
OutlineList of Available SMTP Commands
Parameter
Response on NACCS’s Mail
Server(Normal response)
To declare use of theSender host name 250
communications channel (Domain name)and identify the hostTo start the mailing
FROM: Sender
250
transaction
nameTo specify the receiver of TO: Receiver user 250
the mailnameTo start sending the mail Message data354
body
To stop sending the mail None250
To close the connection
None
221

4-3-2

(B) Command Sequence in Transmission of Processing Request Messages over SMTP
Figure 4.3.2 shows a sequence of SMTP commands issued for transmission of processing
request messages from the user system to the NACCS Center server. Table 4.3.2 shows
description of each command.
Request to open a connection (TCP Port 25)
Normal response (220)

Identify the client host
HELO ZZZZZ.ABC01.NACCS.CUSTOMSNormal response (250)

To start the mailing transaction
MAIL FROM:AAXXXX@ZZZZZ.ABC01.NACCS.CUSTOMSNormal response (250)
To specify the receiver of the mail
RCPT TO:NACCS@MAIL.MAIN.NACCS.CUSTOMSNormal response (250)

1 Message

Start sending the mail body (processing request message)
DATA
Normal response (354)
Send line by line (Maximum 1000 byte per line)... Send line by line
. CRLF
Normal response (250)Gateway
computer

To start the mailing transaction
MAIL FROM:AAXXXX@ZZZZZ.ABC01.NACCS.CUSTOMS

Mail server
Normal response (250)
To specify the receiver of the mail
RCPT TO:NACCS@MAIL.MAIN.NACCS.CUSTOMSNormal response (250)

1 Message

Start sending the mail body (processing request message)
DATA
Normal response (354)
Send line by line (Maximum 1000 byte per line)... Send line by line
. CRLF
Normal response (250)
To close the connection
QUIT

Note

Normal response (221)
Request to close the connection

NACCS Center
serverUser system

Figure 4.3.2 SMTP Command Sequence on Transmission of a Processing Request Message(Example of 2 messages in a single connection session to the mail server)
4-3-3

(Note)In Figure 4.3.2, if the gateway computer on the user side won't issue a QUIT commandwithin two minutes after the completion of transmission of all messages, the NACCS’s Mail
Server will prompt a connection timeout and close the current connection by force.
Therefore, when using e-mail style processing mode, the QUIT command must be issued
upon the completion of transmission of all processing request messages.

Item
No.

Table 4.3.2. Description about Command when Sending SMTP
Command
Description

1

Request to open aconnection

2

HELO Domain name

3

MAIL FROM: Mail address

4

RCPT TO: Mail address

5

DATA

6

Send mail body

User requests connection to NACCS’s Mail Server at Port 25.
NACCS’s Mail Server sends Response Code 220 as a normal
response.
IP address for NACCS’s Mail Server can be obtained from NACCS
Center’s DNS.
User executes command after setting domain name for user’s
system. NACCS’s Mail Server opens SMTP connection if server isavailable.
NACCS’s Mail Server sends Response Code 250 as a normal
response.
NACCS center notifies user's domain name in advance.
User executes command after setting mail address for user’s
system.
NACCS’s Mail Server sends Response Code 250 as a normal
response.
NACCS center notifies user's mail address in advance.
User executes command after setting mail address(NACCS@MAIL.PROD.NACCS6) for NACCS Center server.
NACCS’s Mail Server sends Response Code 250 as a normal
response.
User executes command to start transmission of processing
request message.
NACCS’s Mail Server sends Response Code 354 as a normal
response.
After that, user can send the message (including communications
protocol header).
User sends processing request message in accordance with
NACCS Procedure Specification. At the end edge of a processing
request message, only the line with dot (.) can be sent.
After receiving the end edge, NACCS’s Mail Server sends
Response Code 250 as a normal response.
(Note 1) It is necessary to make a line (CRLF) after each 1,000
bytes, but because in the NACCS EDI specification, a
new line (CRLF) will be made within 1,000 bytes, it is notnecessary for user to be aware of it.
(Note 2) The terminal of the message is recognized from“<CRLF>.<CRLF>” in SMTP. If a message contains aline beginning with “.”, the user’s system should add
dummy “.”. The NACCS’s Mail Server removes thedummy “.” and forwards the message to the core
4-3-4

Item
No.

Command

7

RSET

8

QUIT

Description
processing system.
If user executes this command, it will return to the status after
HELO.
NACCS’s Mail Server sends Response Code 250 as a normal
response.
(Normally, it is not necessary to execute this command).
User closes SMTP connection.
NACCS’s Mail Server sends Response Code 221 as a normal
response.

(Note 1) Response code of SMTP
There are optional characters behind 3 digits of each response code, but only refer tothese 3 first digits.
Example: Response of HELO
250 MAIL.PROD.NACCS6
Only refer to the response code and carry out the settlement methods described in the Table
4.3.3.
* Reason: Because rear characters can be changed depending on Specification changes
in the NACCS center server.

(Note 2) Timeout observation
The user system must monitor SMTP connection timeouts to detect any failure in the
NACCS’s Mail Server or network.
In this specification, more than one message can be sent in one connection, and as thetimeout period of SMTP connection cannot be prescribed, the monitoring time must be
decided based on operation methods applied by user.

4-3-5

(C) Settlement in abnormal cases

Item
No.

Settlement methods in case if an error occurs when sending SMTP are described in the Table
4.3.3.
Table 4.3.3 Settlement methods for sequential errors of SMTP
Command

Estimated errors and settlement methods

1

Request to open User sends connection request to NACCS’s Mail Server but request is not accepted.
a connection
Reasons and settlement methods:• The destination IP address is faulty.
→ Make sure connection is established to NACCS’s Mail Server’s IP address
notified by NACCS Center.
• The destination port number is faulty.
→ Determine if a request is sent to open a connection to port number 25 or not.
• The NACCS center server is under maintenance.
→ Information about maintenance of the NACCS Center server is announced tothe public on NACCS information, so that should be checked. If the center is under
maintenance, re-send the request to open a connection after the maintenance work
is finished.
• The NACCS Center server or network is damaged.
→ Re-send another request to open a connection after a while. If it is not recovered
for a long time, send an investigation request to the Help desk of NACCS Center.
The information on damages is also updated on the NACCS information.
The information on the server's maintenance or damages used for connection test will
not be notified on the NACCS information, if the server cannot be connected even in
the time when the connection test can be done, confirm the situation with NACCS
Center.

2

HELO

Errors in response (except for normal responses (250)) are returned.
Reasons and settlement methods:
1) For syntax error (500)→ Confirm that the character string for sending the HELO command is correct.
2) For command sequences error (503).
→ Execute the command with the right sequences described in the Figure 4.3.2.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

3

MAIL FROM

Errors in response (except for normal responses (250)) are returned.
Reasons and settlement methods:
1) For syntax error (500) or parameter error (501) or domain name error (553).
→Confirm that the character string for sending MAIL command is correct.
2) For command sequences error (503).
→ Execute the command with the right sequences described in the Figure 4.3.2.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

4-3-6

Item
No.
4

Command

RCPT TO

Estimated errors and settlement methods

Errors in response (except for normal responses (250)) are returned.
Reasons and settlement methods:
1) For syntax error (500) or parameter error (501) or domain name error (553).
→ Confirm that the character string of sending RCPT command is correct.
2) For command sequences error (503).
→ Execute the command with the right sequences described in the Figure 4.3.2.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

5

DATA

Errors in response (except for normal responses (354)) are returned.
Reasons and settlement methods:
1) For syntax error (500)→ Confirm that character string of sending DATA command is correct.
2) For command sequences error (503).
→ Execute the command with the right sequences described in the Figure 4.3.2.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

6

Send processing Errors occur during communication.
request message Reasons and settlement methods:
As NACCS’s Mail Server can be damaged, re-send the request after a while. If it is
not recovered for a long time, send an investigation request to the Help desk of
NACCS Center.

7

RSET

Errors in response (except for normal responses (250)) are returned.
Reasons and settlement methods:
For syntax error (500)→ Confirm that character string of sending RSET command is right.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

8

QUIT

Errors in response (except for normal responses (221)) are returned.
Reasons and settlement methods:
For syntax error (500)→ Confirm that the character string of sending QUIT command is correct.

9

Others

Detect abnormalities during communication.
Reasons and settlement methods:
As damages may be occurring, re-send the request to open a connection.

4-3-7

(2) POP3 specifications in transmission of processing request message(A) Available POP3 commands
In principle, POP3 (Post Office Protocol version 3) in this mode shall comply with "Request forComments" (RFC 1939). However, APOP authentication, one of the authentication exchange
methods, is not supported.
POP3 commands used in e-mail style processing mode for NACCS EDI messages are listed inTable 4.3.4:

Command

Table 4.3.4
OutlineList of Available POP3 Commands
Parameter
Response on NACCS’s Mail Server(Normal response)

USER

To send mail address

Mailbox ID

+OK

PASS

To send mailbox
password

Mailboxpassword

+OK

STAT

To inquire about
number of mailmessages and total
size of mail messages

None

+OK
Number of messages
Total size of messages+OK
Message number

To inquire about entire
message information

None

Message size•••
Message number Message size.

To inquire about
specific message
information

Message number+OK Message number Message size

To request to retrieve
message

Message number+OK
Procedure message (more than 1 line).

Message number

+OK

None

+OK

LIST

RETR
DELE
QUIT

To request message
deletion
End of connection(notice of completion)

4-3-8

(B) POP3 command sequence in receipt of processing request message
Figure 4.3.3 shows a sequence to retrieve processing result messages over POP3 in e-mailstyle processing mode. This sequence is an example of the use of STAT command whenobtaining the number of processing result messages when connecting to the mail server. Table
4.3.5 shows details of each command.

Request to open a connection (TCP Port 110)

Normal response (+OK)

USER ZZZZZ.ABC01.NACCS.CUSTOMS [sending of user's mail address]

Normal response (+OK)

PASS password [Request for authentication]

Normal response (+OK)

STAT [Request for number and total size of the message]

Normal response (+OK, number of messages, total size of messages)

RETR message number [Request to retrieve message]

Normal response (+OK)* Response send by multiple lines(<CRLF>,<CRLF> is end of message)

Gateway
computer

DELE message number [Request to delete message]

Mail server

Normal response (+OK)... (Repeating command sequence between RETR and DELE number of times obtained by STAT
command) ...
Quit [Notice of completion]
Normal response (+OK)
Disconnection

NACCS Center
serverUser system

Figure 4.3.3 POP3 Command Sequence for Receiving a Processing Result Message

4-3-9

Item
No.

Table 4.3.5

Description about Command when Receiving POP3

Command

Description

1

Request to open aconnection

User requests connection to NACCS’s Mail Server at Port 110.
NACCS’s Mail Server sends +OK as normal response.
IP address for NACCS’s Mail Server can be obtained from
NACCS Center’s DNS.

2USER mail address

User executes command after setting mail address for user’s
system. NACCS’s Mail Server sends +OK as normal response.
NACCS center notifies user's mail address in advance.

3

PASS POP password

User executes command after setting POP password.
User authentication is executed based on mail server specified
on USER command plus POP password set on this command. If
successful, +OK normal response is sent.
NACCS Center notifies user of POP password in advance.

4

5

STAT

LIST

When obtaining number and total size of message allowed incurrent connection session, user executes this command.
NACCS’s Mail Server sends normal response as follows:+OKnumbertotal message size (in bytes)
When obtaining message number and message size allowed incurrent session, user executes this command.
NACCS’s Mail Server sends normal response as follows:+OKmessage numbermessage size
message numbermessage size…

message numbermessage size.

6

LIST message number(Note 1) "." is a communications protocol trailer, indicating theterminal of a message.
(Note 2) The unit for message sizes is bytes.
When obtaining message size represented by message number
in current session, user executes this command.
NACCS’s Mail Server sends normal response as follows:+OKmessage numbermessage size (in bytes)

4-3-10

Item
No.
7

Command
RETR message number

Description
When reading out mail from mailbox after specifying message
number, user executes this command. NACCS’s Mail Server
sends normal response as follows:+OK
Procedure message (more than 1 line).
(Note 1) "." is a communications protocol trailer, indicating theterminal of a message. As the terminal of the message isrecognized from <CRLF>.<CRLF> in POP3, if a message
contains a line beginning with ".", the user system adds adummy "." at the beginning of the line when responding.
If a message received is not a <CRLF> string followed by ".",
the user system removes "." placed at the beginning of themessage.

8

DELE message number

When deleting message from mailbox after specifying message
number on RETR command, user executes this command.
NACCS’s Mail Server sends normal response as follows:+OK(Note 1) When deleting a message from a specified domain,
deletion will be successfully completed after being
disconnected in response to the QUIT command.
If an abnormal response is generated over POP3, or an
unintended disconnection is caused due to some kind of
failure before the QUIT is properly accepted, when aconnection is established afresh, any message for which the
DELE command was issued for normal termination will bereceived again.

9

QUIT

When closing POP3connection session, user uses thiscommand.
NACCS’s Mail Server sends following normal response before
disconnecting.
+OK(Note 1) POP Response Codes
After a Response Code (+OK,-ERR), a one-byte space may be inserted, and request
command-specific response information may follow. In this case, however, only thecommands given in Table 4.3.5 should be referred to.
(Note 2)  denotes a space.

4-3-11

When issuing a subsequent request to retrieve a processing result message from the incoming
mailbox after retrieving and deleting a message and issuing the QUIT command for notice ofcompletion of a session, the user is required to wait for a period of time (3 minutes) or moredesignated by NACCS Center. The reason is that if users frequently issue requests to retrieve
processing result messages from their incoming mailbox, the mail server may be overloaded, andas a result, the system response becomes slow and it takes a longer time to verify the contents ofprocessing result messages.
In addition, users must issue a DELE command after retrieving messages by the RETR command
to delete the retrieved messages from their mailbox.

4-3-12

(C) Settlement in abnormal cases

Item
No.

Table 4.3.6 shows how to handle errors occurring during receipt of messages over POP3:
Table 4.3.6
Command

POP3 Sequence Errors and Error Handling Procedures
Estimated errors and settlement methods

1

Request to
open aconnection

User sends connection request to NACCS’s Mail Server but request is not
accepted.
Reasons and settlement methods:• The destination IP address is faulty.
→ Make sure connection is established to NACCS’s Mail Server’s IP
address notified by NACCS Center.
• The destination port number is faulty.
→ Determine if it sends request to open a connection to port number 110 ornot.
• The NACCS Center server is under maintenance.
→ Since NACCS Center’s server maintenance information will beannounced on NACCS information, check that. If the center is under
maintenance, re-send the request to open a connection after the
maintenance work is finished.
• The NACCS Center server or network is damaged.
→ Re-send another request to open a connection after a while. If it is notrecovered for a long time, send an investigation request to the Help desk of
NACCS Center.
The information on damages is also updated on the NACCS information.
The information on the server's maintenance or damages used for connection
test will not be notified on the NACCS information, if the server cannot be
connected even in the time when the connection test can be done, confirm
the situation with NACCS Center.

2

USER

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that character string of sending USER command is correct.
2) For command sequences error→ Execute USER command before executing PASS command.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send
the request for a connection.

3

PASS

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that character string of sending PASS command is correct.
2) For command sequences error→ Execute the command after executing USER command.
3) For authentication error
4-3-13

Item
No.

Command

Estimated errors and settlement methods→ Check user mail address specified on USER command and POP
password specified on PASS command, and start over with requesting
connection again.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send
the request for a connection.
Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that the character string of sending STAT command is correct.
2) For command sequences error→ Execute command after PASS command is completed with normal
response.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send
the request for a connection.

4

STAT

5

LIST

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that the character string of sending LIST command is correct.
2) For command sequences error→ Execute command after PASS command is completed with normal
response.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send
the request for a connection.

6

RETR

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that the character string of sending RETR command is correct.
2) For command sequences error→ Execute command after PASS command is completed with normal
response.
3) No message corresponding to message number specified exists, orrequest has already been issued for message number deletion on DELE
command within the same connection session.
→ Make sure to specify correct message number and execute command.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send
the request for a connection.

4-3-14

Item
No.

Command

Estimated errors and settlement methods

7

DELE

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that the character string of sending DELE command is correct.
2) For command sequences error→ Execute command after PASS command is completed with normal
response.
3) No message corresponding to message number specified exists, orrequest has already been issued for message number deletion on DELE
command within the same connection session.
→ Make sure to specify correct message number and execute command.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send
the request for a connection.

8

QUIT

9

OthersError response is returned (-ERR).
Reasons and settlement methods:
For syntax error→ Confirm that the character string of sending QUIT command is correct.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send
the request for a connection.
Connection breaks during transmission of message.
Reasons and settlement methods:
As damages may be occurring, re-send the request to open a connection.

4-3-15

4.3.1.3

Message format

In the e-mail style processing mode, a communications protocol header and a trailer are added to an
NACCS EDI message, an attachment file transmission message or an XML format message.
The message formats are outlined as follows:(1) NACCS EDI message
Figure 4.3.4 shows the outline of NACCS EDI message format (e-mail style processing mode).

NACCS EDI Message
Communications
Protocol Header(SMTP Header)

Input (Output)
Common Field

Procedure-By-Procedure
Field

Communications
Protocol Header(SMTP Trailer)

Max. 700,000 bytes (Note)(Refer to "3 Message structure and format")・ ・ ・ ・ ・ ・ ・Subject(Refer to "4.3.1.3 (4) Contents of the SMTP header (A) NACCS EDI message")(Refer to "4.3.1.3 (5) Contents of Subject field of the SMTP header")Figure 4.3.4 Outline of NACCS EDI Message Format (E-mail Style Processing Mode)(Note)
Refer to "3.1.2 NACCS EDI message structure Table 3.1.1" for the maximum
allowable message size transmitted between relevant ministers’ systems.

Figure 4.3.5 shows transmission of a NACCS EDI message from a user system to the NACCS
Center server in e-mail style processing mode.
1) A NACCS EDI message body comes after the "<CRLF>" code placed after the SMTP
header.
2) "." (Period) and "<CRLF>" are placed after the NACCS EDI message body, as
communications protocol trailer.

4-3-16

Procedure-By-Procedure Field

Figure 4.3.5

LF

LF

.

CR

LF

…

CR

LF

…

CR

LF

…

CR

LF

…

CR

LF

CR

CR

Communications
Protocol Trailer(SMTP)NACCS EDI message
Input common
fieldContentTransferEncoding:
8bit

LF

ContentType:Text/plain;charset="EUC-JP"CR

LF

MimeVersion:1.0

CR

LF

To:
……

LF

CR

From:
……

CR

Communications Protocol Header(SMTP)

Message Segmentation

Note: The following figure shows segments of a message displayed on text editor tools, etc.
From:XXXXXXXX...XXX<CRLF>
To:XXXXXXXX...XXX<CRLF>
Mime-Version:1.0<CRLF>

Communications protocol header(SMTP header)Content-Type:Text/plain;charset="EUC-JP"<CRLF>
Content-Transfer-Encoding:8bit<CRLF><CRLF>XXXXXXXXXXX.....XXX<CRLF>
XXXX...XXX<CRLF>
XXXX...XXX<CRLF>
XXXX...XXX<CRLF>.<CRLF>*

Input common field
Procedure-by-procedure field

NACCS EDI
messageCommunications protocol trailer(SMTP trailer)
Appearance of <CRLF> may be different depending on text editors, etc.

! Communications protocol trailer
In SMTP, a line filled with ". <CRLF>" (a period line) is added at the end of a massage. The
end of a message is recognized by a sequence of "<CRLF>. <CRLF>", which is acombination of "<CRLF>" placed at the end of a message and this additional period line.

!

How to distinguish between communications protocol trailer and "." (dot)"." is a communications protocol trailer which means the end of a response. In SMTP and
POP3, the end of the message is recognized with <CRLF>.<CRLF>. If a message contains
a line starting with "." in a response message, NACCS adds one "." (byte stuff) as escapecharacter. The user should delete "." if the string to follow is not <CRLF>. This is an
important distinguisher. Failure to delete byte stuff causes errors such as messages
containing an additional unwanted "." (dot) and messages with an extra byte at the user's
system.
4-3-17

(2) Attachment file transmission message
Figure 4.3.6 shows outline of attachment file transmission messages (e-mail style processingmode).
Refer to "4.6.2 Attachment file" for attachment files available for NACCS.

Attachment file transmission message
Communications
Protocol Header(SMTP Header)

NACCS EDI message(attached file registration
procedure, etc.)

Attachmentdata 1・・・

Attachmentdata nCommunications
Protocol Header(SMTP Trailer)

Max. 10,000,000 bytes (Note)(Refer to "3 Message structure and format")(Refer to "4.3.1.3 (4) Content of the SMTP header (B) attachment file transmission message")

Figure 4.3.6 Outline of Attachment File Transmission Messages (E-mail Style Processing Mode)(Note) Refer to "3.1.2 NACCS EDI message structure Table 3.1.1" for allowable maximum message
length of attachment data transmitted among other relevant ministers’ systems.
Figure 4.3.7 shows transmission of an attachment file transmission message from a user system
to the NACCS Center server in e-mail style processing mode.
1) Filing method
In NACCS, BASE64 of MIME (Multipurpose Internet Mail Extensions) is used when sending andreceiving the message. Attachment file transmission message is filled with attached file format.
Details of regulations when sending and receiving the attachment file transmission message areas follow.
• MIME version is 1.0.
• Content-type of SMTP header is Multipart/mixed, Content-type of NACCS message is
Text/plain, Content-type of attached file is specified according to each attached file.
• The Content-Transfer-Encoding of the attached file is appointed as BASE64.
• NACCS EDI message can't be abbreviated. In addition, the attached file needs to beplaced behind the NACCS EDI message.
• In Content-Disposition, specify "attachment" and specify the file's name in "filename".
2) Image of message• The attachment file transmission message is structured with a communications protocolheader, and a message and communications protocol trailer.
• NACCS EDI message, attached file's body encoded with BASE64 comes after the<CRLF> code placed after SMTP header.
•"." (Period) and "<CRLF>" are placed after the NACCS EDI message body, as
communications protocol trailer.

4-3-18

LF
LF

LF

LF

LF

CR

CR
CR

ContentDisposition:
attachment;
filename="file name"

CR

LF

LF

Refer to
NACCS
EDI
message

CR

CR

CR

Content-Type:multipart/mixed;boundary="YYYYYY"

LF

LF

MimeVersion:1.0

CR

LF

CR

To:
XXXX

LF

From:
XXXXX

CR

Communications Protocol Header(SMTP header)

Body

LF

ContentTransferEncoding:
8bit (Note)

CR

LF

ContentType:Text/plain;charset="EUC-JP"

Text

CR

LF

YYY
YYY

CR

- (hyphen)- (hyphen)

Text

Body

ContentTransferEncoding:
BASE64

Body

LF

．

CR

LF

- (hyphen)- (hyphen)- (hyphen)- (hyphen)

LF

CR

YYY
YYY

CR

Communications
protocol trailer (SMTP)

Attachment file

Attached file's
body

CR

LF

Content-Type: "Basing on
attached file";
name="file name"

CR

LF

YYY
YYY

CR

- (hyphen)- (hyphen)

Attachment file

(Note) Setting point of this item is based on email software. "8 bit" is just an example.
Figure 4.3.7 An Example of Attachment File Transmission Message Structure

4-3-19

Note:
Text presentation of the above contents on text editor tool, etc. is described as follow.
From:XXXXX…XXX<CRLF>
To:XXXXX…XXX<CRLF>
Mime-Version:1.0<CRLF>
Content-Type:multipart/mixed; boundary="YYYYYY"<CRLF><CRLF>--YYYYYY<CRLF>
Content-Type:Text/plain; charset="EUC-JP"<CRLF>
Content-Transfer-Encoding:8bit<CRLF><CRLF>

Communications
protocolheader(SMTP header)

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX…XXX<CRLF>

NACCS
EDI
message<CRLF>--YYYYYY<CRLF>
Content-Type: "Basing on attached file"; name="file name"<CRLF>
Content-Transfer-Encoding: BASE64<CRLF>
Content-Disposition: attachment; filename="file name"<CRLF>
Repeatable<CRLF>ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ…ZZ Attached file's body
<CRLF>--YYYYYY-<CRLF>
Communications
protocol.<CRLF>
trailer(SMTP trailer)

4-3-20(3) XML format message
Figure 4.3.8 shows outline of XML format messages (e-mail style processing mode).

XML format message
Communications
Protocol Header

XML message(SMTP Header)Communications
Protocol Trailer(SMTP Trailer)

Max. 700,000 bytes(Refer to "3 Message structure and format")(Refer to "4.3.1.3 (4) Contents of the SMTP header (C) XML format")

Figure 4.3.8 Outline of XML Format Message (E-mail Style Processing Mode)

Lay out of an XML format message sent to NACCS Center server from a user in e-mail styleprocessing mode is described as follow.
1) An XML format message body comes after the "<CRLF>" code placed after the SMTP
header.
2) "<CRLF>" and "." (Period) and "<CRLF>" are placed after the XML format message, as
communications protocol trailer.
3) Make a new line after each 1,000 bytes. If not, an error will occur.
4) <CRLF> exists in each line of XML message.
5) Character code of XML message is EUC-JP. EUC-JP must be recorded in encoding field of
XML header.
For details of XML format message structure which user sends to NACCS center sever in e-mailstyle processing mode, refer to Appendix 15 and Procedure Specifications.

4-3-21

<Reference>
Text presentation of the above contents on text editor tools, etc. is described as follows.
From:XXXXX…XXX<CRLF>
To:XXXXX…XXX<CRLF>
Mime-Version:1.0<CRLF>
Content-Type:Text/xml; charset="EUC-JP"<CRLF>
Content-Transfer-Encoding:8bit<CRLF><CRLF>

Communications protocolheader(SMTP header)<?xml version="1.0" encoding="EUC-JP" standalone="no" ?>- <RootElement>- <Header>- <DocumentType><DocumentTypeCode>XXX</DocumentTypeCode><DocumentTypeDescription>XX…XXX</DocumentTypeDescription></DocumentType>- <DocumentIdentification><MessageFunction> XX…XXX </MessageFunction><MessageTransferSequenceNo>XX</MessageTransferSequenceNo></DocumentIdentification><SenderID> XX…XXX </SenderID></Header>- <Body>•* XML message•
Refer to Appendix 15 and Procedure•Specifications for more details.
•- <AdditionalInformation><InformationType> XX…XXX </InformationType></AdditionalInformation></Body></RootElement><CRLF>.<CRLF>

Communications protocol
trailer(SMTP trailer)

4-3-22

(4) Contents of the SMTP header(A) NACCS EDI message
Contents of the SMTP header included in processing request message and processing result
message are as follows.
(1) Send processing request message
Table 4.3.7 shows contents of the SMTP header in a processing request message sent froma user.
Table 4.3.7 SMTP Header (Processing Request Message)
Item
No.

Item

Contents specified by the user

1

From

2

To

3
4

MIME-version
Content-Type
Content-Transfer-En
coding

5

The sender of the mail.
In NACCS a source (user) e-mail address assigned by NACCS Center is
specified.
If no address is specified, error will occur.
(Refer to "4.3.4 E-mail address."
The receiver of the mail.
In NACCS, the NACCS center server's e-mail address allocated for thee-mail style processing mode is specified.
(Refer to "4.3.4 E-mail address."
In NACCS 1.0 is specified.
Text/plain;charset="EUC-JP" is specified.
In NACCS characters are treated as EUC characters.
8bit is specified.

(2) Processing Result Message
Table 4.3.8 shows contents of the SMTP header in a processing result message (processing
result notification message and output information message) sent from NACCS to a user.
Table 4-3-8
Item
No.

Item

SMTP Header (Processing Result Message)
Contents specified by the mail server in NACCS’s Mail Server

The sender of the mail.
In NACCS, the NACCS center server's e-mail address allocated for thee-mail style processing mode is specified.
(Refer to "4.3.4 E-mail address."
The receiver of the mail.
In NACCS user's e-mail address for mail box for incoming messages
which is used to store processing result messages is specified.
(Refer to "4.3.4 E-mail address.")
The date the message is sent to the receiver is specified.
(See "4.3.1.3 (5) Contents of Subject field of the SMTP header")In NACCS 1.0 is specified.

1

From

2

To

3
4
5
6

Date
Subject
MIME-version
Content-Type
Text/plain;charset="EUC-JP" is specified.
Content-Transfer-E In NACCS characters are treated as EUC characters.
ncoding
8bit is specified.
(B) Attachment file transmission message
4-3-23

7

Contents of the SMTP header included in processing request message and processing result
message are as follows.
(1) Send processing request message
Table 4.3.9 shows contents of the SMTP header in a processing request message sent froma user.
Table 4.3.9
Item
No.

Item
From

1
To
2

3

MIME-version
Content-Type

4

5

6

SMTP Header (Processing Request Message)
Contents specified by the user

The sender of the mail.
In NACCS, a source (user) e-mail address assigned by NACCS center is
specified. If no address is specified, error will occur.
(Refer to "4.3.4 E-mail address."
The receiver of the mail.
In NACCS, the NACCS center server's e-mail address allocated for thee-mail style processing mode is specified.
(Refer to "4.3.4 E-mail address."
In NACCS 1.0 is specified.
If it is not specified, that e-mail will be omitted.
For SMTP header, multipart/mixed; boundary="optional value" is specified.
In addition, NACCS message is specified by Text/plain, and attachment
file by Basing on attached file.

If it is not specified, that e-mail will be omitted.
Content-Transfer-E It is not specified in SMTP header.
ncoding
8bit is specified in NACCS message and BASE64 is specified in attached
file.
Content-Disposition It is not specified in SMTP header and NACCS message.
Attachment is specified in attached file and "file name" in filename.

(2) Processing result message
For details about contents of the SMTP header in a processing result message sent fromNACSS to a user, referred to "4.3.1.3 (4) Content of the SMTP header (A) NACCS EDI
message – Table 4.3.8" above.

4-3-24

(C) XML format message
Contents of the SMTP header included in processing request message and processing result
message are as follows.
(1) Send processing request message
Table 4.3.10 shows contents of the SMTP header in a processing request message sent froma user.

Item

Table 4.3.10 SMTP Header (Processing Request Message)
Contents specified by the user

Item
No.
1

From

2

To

3

MIME-version

4

Content-Type

5

Content-Trans In NACCS characters are treated as EUC characters.
fer-Encoding
8bit is specified.

The sender of the mail.
In NACCS, a source (user) e-mail address assigned by NACCS center is
specified. If no address is specified, error will occur.
(Refer to "4.3.4 E-mail address."
The receiver of the mail.
In NACCS, the NACCS center server's e-mail address allocated for thee-mail style processing mode is specified.
(Refer to "4.3.4 E-mail address."
In NACCS 1.0 is specified.
If it is not specified, that e-mail will be omitted.
In NACCS, due to using message in EUC, Text/xml; charset="EUC-JP" isspecified.

(2) Processing Result Message
For details about contents of the SMTP header in a processing result message sent fromNACSS to a user, referred to "4.3.1.3 (4) Content of the SMTP header (A) NACCS EDI
message – Table 4.3.8" above.

4-3-25(5) Contents of Subject field of the SMTP header
Contents of Subject field of the SMTP header included in a processing result message sent fromthe center server to a user are as follows.
(1) Purpose
The purpose of this is by the NACCS Center server specifying the contents described in (2)following in the "subject" of the SMTP header, details of the processing result messages stored
in the mail can be read without the user opening the mail.

(2) Contents of Subject field
A common format is used for both processing result notification messages and output
information messages.
Table 4.3.11 shows contents of Subject field.
Table 4.3.11 Contents of Subject Field
Field name
Procedure-By-Procedure
Field
Data

lengthOutline64

For example, processing result code, declaration number, andB/L number are specified.
(Refer to Appendix Table 6.8 "Output Information Code List")
A space is used as a data separator.

(3) Others
Since contents of Subject field are included in a NACCS EDI message body, Subject field is
not specifically useful for users who do not need to handle its contents.
(Subject field can be omitted)

4-3-26

4.3.2E-mail style processing for EDIFACT messages

4.3.2.1

Outline of e-mail style processing mode (EDIFACT messages)

For e-mail style processing mode for EDIFACT messages, message structure is different frome-mail style processing mode for NACCS EDI messages. However, other than that it basically has
the same method.
Figure 4.3.9 shows outline of e-mail style processing mode for EDIFACT messages in NACCS. In
addition, for e-mail sending, refer to "4.6.1 e-mail".

(1) SMTP
SMTP header
SMTPヘッダー
SMTPヘッダー

NACCS EDI
Message

NACCS EDI Message
Air-NACCS EDI電文
Air-NACCS EDI電文(Transmitted
one by one)

User’s SMTP
Server(4) POP3(Messages are retrieved by user)

SMTP header
SMTPヘッダー
SMTPヘッダーCoreprocessing
systemMail server
NACCS EDI
Message

NACCS EDI Message
Air-NACCS EDI電文
Air-NACCS EDI電文

User system

NACCS Center server

Figure 4.3.9 Outline of Connection Mode of E-mail Processing Mode for EDIFACT Messages(1) The user creates and sends an EDIFACT message that contains data required for the
relevant procedure to the mail server over the SMTP protocol (EDIFACT message is attachedin MINE format). More than one message can be sent at a time.
(2) The mail server converts the EDIFACT message into a NACCS EDI message, and forwards
this to the core processing system.
(3) The core processing system then processes the message based on the forwarded message,
and forwards a processing result message to the user's mailbox on the mail server. The mailserver converts the NACCS EDI message into a EDIFACT message, and stores this in user
mailbox with in the mail server in MIME format.
(4) Then the user retrieves the processing result message from the mailbox over the POP3
protocol.
4-3-27

4.3.2.2

Details of the communications protocols

In e-mail style processing mode for EDIFACT messages, TCP/IP is used for the network andtransport layers, and regarding the upper layer, SMTP (MIME) for sending processing request
messages and POP3 (MIME) for receiving processing result messages are used as communications
protocols.
(1) SMTP specifications when sending a processing request message on SMTP
(A) Applicable SMTP commands
Table 4.3.12 shows list of SMTP commands available in e-mail style processing mode for
EDIFACT messages, and their responses.
Table 4.3.12 List of Available SMTP Commands
Command

HELO

MAIL
RCPT
DATA
RSET
QUIT

OutlineParameter

To declare use of thecommunications channel
and identify the hostTo start the mailingtransaction
To specify the receiver ofthe mail
To start sending the mailbody
To stop sending the mailTo close the connection

Sender host name(Domain name)Response on NACCS’s
Mail Server(Normal response)
250

FROM: Sendername
TO: Receiver user
nameMessage data

250

None
None

250
221

4-3-28250354

(B) SMTP command sequence for sending a processing request message
Figure 4.3.10 shows a sequence of SMTP commands issued for transmission of processing
request messages from the user system to the NACCS Center server (example of 2 messages
in a single connection session to the mail server).
Table 4.3.13 shows description of each command.

4-3-29Request to open a connection (TCP Port 25)
Normal response (220)

Identify the client host
HELO ZZZZZ.ABC01.NACCS.CUSTOMSNormal response (250)

To start the mailing transaction
MAIL FROM:AAXXXX@ZZZZZ.ABC01.NACCS.CUSTOMSNormal response (250)
To specify the receiver of the mail
RCPT TO:NACCS@EDIFACT.MAIN.NACCS.CUSTOMSNormal response (250)

1 Message

Start sending the mail body (processing request message)
DATA
Normal response (354)
Send line by line (Maximum 1000 byte per line)... Send line by line
. CRLF
Normal response (250)

To start the mailing transaction
MAIL FROM:AAXXXX@ZZZZZ.ABC01.NACCS.CUSTOMS

Gateway
computer

Mail server
Normal response (250)
To specify the receiver of the mail
RCPT TO:NACCS@EDIFACT.MAIN.NACCS.CUSTOMSNormal response (250)

1 Message

DATA indicating start of sending the mail body(processing request message)
Normal response (354)
Send line by line (Maximum 1000 byte per line)... Send line by line
. CRLF
Normal response (250)
To close the connection
QUIT

Note

Normal response (221)
Request to close the connection

NACCS Center
serverUser system

Figure 4.3.10 Sequence of SMTP commands issued for transmission of Processing Request Messages(Example of 2 Messages in a Single Connection Session to the NACCS’s Mail Server)

4-3-30Table 4.3.13 Description about Command when Sending SMTP
Item
No.

Command

Description

1

Request to open a connection

User requests connection to NACCS’s Mail Server at Port 25.
NACCS’s Mail Server sends Response Code 220 as a normal response.
IP address for NACCS’s Mail Server can be obtained from NACCS
Center’s DNS.

2HELO Domain name

User executes command after setting domain name for user’s system.
NACCS’s Mail Server opens SMTP connection if server is available.
NACCS’s Mail Server sends Response Code 250 as a normal response.
NACCS center notifies user's domain name in advance.

3

MAIL FROM: Mail address

User executes command after setting mail address for user’s system.
NACCS’s Mail Server sends Response Code 250 as a normal response.
NACCS center notifies user's mail address in advance.

4

RCPT TO: Mail address

User executes command after setting mail address(NACCS@EDIFACT.PROD.NACCS6) for NACCS Center server.
NACCS Center server sends Response Code 250 as a normal
response.

5

DATA

User executes command to start transmission of processing request
message.
NACCS’s Mail Server sends Response Code 354 as a normal response.
After that, user can send the message (including communications
protocol header).

6

Send mail body

User sends processing request message in accordance with NACCS
Procedure Specification. At the end edge of a processing request
message, only the line with dot (.) can be sent.
After receiving the end edge, NACCS’s Mail Server sends Response
Code 250 as a normal response.
(Note 1) It is necessary to make a line (CRLF) after each 1,000 bytes,
but because in NACCS EDI specification, a new line (CRLF) will bemade within 1,000 bytes, it is not necessary for user to be aware ofit.
(Note 2) The terminal of the message is recognized from“<CRLF>.<CRLF>” in SMTP. If a message contains a line
beginning with “.”, the user’s system should add dummy “.”.
The
NACCS mail server removes the dummy “.” and forwards themessage to the core processing system.

7

RSET

If user executes this command, it will return to the status after HELO.
NACCS’s Mail Server sends Response Code 250 as a normal response.
(Normally, it is not necessary to execute this command).

8

QUIT

User closes SMTP connection.
NACCS’s Mail Server sends Response Code 221 as a normal response.

4-3-31

(Note) In Figure 4.3.10, if the gateway computer on the user side won't issue the QUIT commandwithin two minutes after completion of transmission of all messages, the NACCS’s Mail Server willprompt a connection timeout and close the current connection by force. Therefore, for gateway
connection, when using e-mail style processing mode, the QUIT command must be issued uponcompletion of transmission of all processing request messages.
(Note 1) Response code of SMTP
There are optional characters behind 3 digits of each response code, but only refer to these3 first digits.
Example: Response of HELO
250 EDIFACT.PROD.NACCS6
Only refer to the response code and carry out the settlement methods described in the Table
4.3.14.
* Reason: Because rear characters can be changed depending on Specification changes in
the NACCS center server.

(Note 2) Timeout observation
The user system must monitor SMTP connection timeouts to detect any failure in the
NACCS’s Mail Server or network.
In this specification, more than one message can be sent in one connection, and as thetimeout period of SMTP connection cannot be prescribed, the monitoring time must be
decided based on operation methods applied by user.

4-3-32

(C) Settlement in abnormal cases
Settlement methods in case if an error occurs when sending SMTP are described in the Table
4.3.14.
Table 4.3.14 Settlement methods for sequential errors of SMTP
Item
No.

Command

Estimated errors and settlement methods

1

Request to open User sends connection request to NACCS’s Mail Server but request is not accepted.
a connection
Reasons and settlement methods:• The destination IP address is faulty.
→ Make sure connection is established to NACCS’s Mail Server’s IP address
notified by NACCS Center.
• The destination port number is faulty.
→ Determine if a request is sent to open a connection to port number 25 or not.
• The center is under maintenance.
→ Information about maintenance of the NACCS Center server is announced tothe public on NACCS information, so that should be checked. If the center is under
maintenance, re-send the request to open a connection after the maintenancework is finished.
• The NACCS Center server or network is damaged.
→ Re-send another request to open a connection after a while. If it is not recovered
for a long time, send an investigation request to the Help desk of NACCS Center.
The information on damages is also updated on the NACCS information.
The information on the server's maintenance or damages used for connection test will
not be notified on the NACCS information, if the server cannot be connected even in
the time when the connection test is done, confirm the situation with NACCS Center.

2

HELO

Errors in response (except for normal responses (250)) are returned.
Reasons and settlement methods:
1) For syntax error (500)→ Confirm that the character string for sending the HELO command is correct.
2) For command sequences error (503).
→ Execute the command with the right sequences described in the Figure 4.3.10.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

3

MAIL FROM

Errors in response (except for normal responses (250)) are returned.
Reasons and settlement methods:
1) For syntax error (500) or parameter error (501) or domain name error (553).
→Confirm that the character string for sending MAIL command is correct.
2) For command sequences error (503).
→ Execute the command with the right sequences described in the Figure 4.3.10.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

4

RCPT TO

Errors in response (except for normal responses (250)) are returned.
Reasons and settlement methods:
1) For syntax error (500) or parameter error (501) or domain name error (553).

4-3-33

Item
No.

Command

Estimated errors and settlement methods→ Confirm that the character string of sending RCPT command is correct.
2) For command sequences error (503).
→ Execute the command with the right sequences described in the Figure 4.3.10.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

5

DATA

Errors in response (except for normal responses (354)) are returned.
Reasons and settlement methods:
1) For syntax error (500)→ Confirm that character string of sending DATA command is correct.
2) For Command sequences error. (503).
→ Execute the command with the right sequences described in the Figure 4.3.10.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

6

Send processing Errors occur during communication.
request message Reasons and settlement methods:
As NACCS’s Mail Server can be damaged, re-send the request after a while. If it is
not recovered for a long time, send an investigation request to the Help desk of
NACCS Center.

7

RSET

Errors in response (except for normal responses (250)) are returned.
Reasons and settlement methods:
For syntax error (500)→ Confirm that character string of sending RSET command is correct.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

8

QUIT

Errors in response (except for normal responses (221)) are returned.
Reasons and settlement methods:
For syntax error (500)→ Confirm that the character string of QUIT command is correct.

9

Others

Detect abnormalities during communication.
Reasons and settlement methods:
As damages may be occurring, re-send the request to open a connection.

4-3-34

(2) POP3 specifications when receiving a processing result message(A) Available POP3 commands
In principle, POP3 (Post Office Protocol version 3) in this mode shall comply with "Request forComments" (RFC 1939). However, APOP authentication, one of the authentication exchange
methods, is not supported.
Table 4.3.15 shows list of POP3 commands available in e-mail style processing mode for
EDIFACT messages, and their responses.

Command

Table 4.3.15 List of Available POP3 Commands
OutlineParameter
Response on NACCS’S Mail Server(Normal response)

USER
PASS

STAT

To send mail address
To send mailbox
password
To inquire about
number of mailmessages and total
size of mail messages

Mail address
Mailboxpassword

+OK
+OK
+OK
Number of messages
Total size of messages

None

+OK
Message number
To inquire about entire
message information

None

Message size•••
Message number Message size.

To inquire about
specific message
information

Message number+OK Message number Message size

Message number+OK
Procedure message (more than 1 line).

Message number

+OK

None

+OK

LIST

RETR
DELE
QUIT

To request to retrieve
message
To request message
deletion
End of connection(notice of completion)

4-3-35

(B) POP3 command sequence in receipt of a processing result message
Figure 4.3.11 shows a sequence to retrieve processing result messages over POP3 in e-mailstyle processing mode. This sequence is an example of use of STAT command when obtaining
the number of processing result messages at the time of connection to the mail server. Table
4.3.16 shows description of each command.

Request to open a connection (TCP Port 110)

Normal response (+OK)

USER ZZZZZ.ABC01.NACCS.CUSTOMS [sending of user's mail address]

Normal response (+OK)

PASS password [Request for authentication]

Normal response (+OK)

STAT [Request for number and total size of the message]

Normal response (+OK, number of messages, total size of messages)

RETR message number [Request to retrieve message]

Normal response (+OK)* Response sent by multiple lines(<CRLF>,<CRLF> is end of message)

Gateway
computer

DELE message number [Request to delete message]

Mail server

Normal response (+OK)... (Repeating command sequence between RETR and DELE number of times obtained by STAT
command) ...
QUIT [Notice of completion]
Normal response (+OK)
Disconnection

NACCS Center
serverUser system

Figure 4.3.11 POP3 Command Sequence for Receiving a Processing Result Message

4-3-36

Table 4.3.16 Description about Command when Receiving POP3
Item
CommandNo.
1
Request to open aconnection

Description
User requests connection to NACCS’s Mail Server at Port 110.
NACCS’s Mail Server sends +OK as normal response.
IP address for NACCS’s Mail Server can be obtained from
NACCS Center’s DNS.

2USER mail address

User executes command after setting mail address for user’s
system. NACCS’s Mail Server sends +OK as normal response.
NACCS center notifies user's mail address in advance.

3

PASS POP password

User executes command after setting POP password.
User authentication is executed based on mail server specified
on USER command plus POP password set on this command.
If successful, +OK normal response is sent.
NACCS Center notifies user of POP password in advance.

4

5

STAT

LIST

When obtaining number and total size of message allowed incurrent connection session, user executes this command.
NACCS’s Mail Server sends normal response as follows:+OK△number△total message size (in bytes)
When obtaining message number and message size allowed incurrent session, user executes this command.
NACCS’s Mail Server sends normal response as follows:+OKmessage number△message size
message number△message size…

message numbermessage size.

6

LIST message number(Note 1) "." is a communications protocol trailer, indicating theterminal of a message.
(Note 2) The unit for message sizes is bytes.
When obtaining message size represented by message
number in current session, user executes this command.
NACCS’s Mail Server sends normal response as follows:+OKmessage numbermessage size (in bytes)

4-3-37

Item
Command
No.
7
RETR message number

Description
When reading out mail from mailbox after specifying message
number, user executes this command. NACCS’s Mail Server
sends normal response as follows:+OK
Procedure message (more than 1 line).
(Note 1) "." is a communications protocol trailer, indicating theterminal of a message. As the terminal of the message isrecognized from <CRLF>.<CRLF> in POP3, if a message
contains a line beginning with ".", the user system adds adummy "." at the beginning of the line when responding.
If a message received is not a <CRLF> string followed by".", the user system removes "." placed at the beginning of
the message.

8

DELE message number

When deleting message from mailbox after specifying message
number on RETR command, user executes this command.
NACCS’s Mail Server sends normal response as follows:+OK(Note 1) When deleting a specified message from a maildomain, deletion will be successfully completed after being
disconnected in response to the QUIT command.
If an abnormal response is generated over POP3, or an
unintended disconnection is caused due to some kind of
failure before the QUIT is properly accepted, when aconnection is established afresh, any message for which
the DELE command was issued for normal termination will
be received again.

9

QUIT

When closing POP3 connection session, user uses thiscommand.
NACCS’s Mail Server sends following normal response before
disconnecting.
+OK

Note 1: POP Response Codes
After a Response Code (+OK,-ERR), a one-byte space may be inserted, and request
command-specific response information may follow. In this case, however, only thecommands given in Table 4.3.16 should be referred to.
Note 2:  denotes a space.

4-3-38When issuing a subsequent request to retrieve a processing result message from the incoming
mailbox after retrieving and deleting a message and issuing the QUIT command for notice ofcompletion of a session, the user is required to wait for a period of time (3 minutes) or moredesignated by NACCS Center. The reason is that if users frequently issue requests to retrieve
processing result messages from their incoming mailbox, the mail server may be overloaded.
As a result, the system response becomes slow and it takes a longer time to verify the contents
of processing result messages.
In addition, users must issue the DELE command after retrieving messages by the RETR
command to delete the retrieved messages from their mailbox.
(C) Settlement in abnormal cases
Table 4.3.17 shows how to handle errors occurring during receiving messages via POP3.
Table 4.3.17 POP3 Sequence Errors and Error Handling Procedures
Item
No.

Command

Estimated errors and settlement methods

1

Request to open a User sends connection request to NACCS’s Mail Server but request is not accepted.
connection
Reasons and settlement methods:• The destination IP address is faulty.
→ Make sure connection is established to NACCS’s Mail Server’s IP address
notified by NACCS Center.
• The destination port number is faulty.
→ Determine if it sends request to open a connection to port number 110 or not.
• The NACCS center server is under maintenance.
→ Information about maintenance of the NACCS Center server is announced to the
public on NACCS information, so that should be checked. If the center is under
maintenance, re-send the request to open a connection after the maintenance work
is finished.
• The NACCS Center server or network is damaged.
→ Re-send another request to open a connection after a while. If it is not recovered
for a long time, send an investigation request to the Help desk of NACCS Center.
The information on damages is also updated on the NACCS information.
The information on the server's maintenance or damages used for connection test will
not be notified on the NACCS information, if the server cannot be connected even in
the time when the connection test is done, confirm the situation with NACCS Center.

2

USER

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that character string of USER command is correct.
2) For command sequences error→ Execute USER command before executing PASS command.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

4-3-39

Item
No.
3

CommandPASS

Estimated errors and settlement methods
Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that character string of sending PASS command is correct.
2) For command sequences error→ Execute the command after executing USER command.
3) For Authentication error→ Check user mail address specified on USER command and POP password
specified on PASS command, and start over with requesting connection again.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

4

STAT

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that the character string of sending STAT command is correct.
2) For command sequences error→ Execute command after PASS command is completed with normal response.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

5

LIST

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that the character string of sending LIST command is correct.
2) For command sequences error→ Execute command after PASS command is completed with normal response.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

6

RETR

Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that the character string of sending RETR command is correct.
2) For command sequences error→ Execute command after PASS command is completed with normal response.
3) No message corresponding to message number specified exists, or request has
already been issued for message number deletion on DELE command within the sameconnection session.
→ Make sure to specify correct message number and execute command.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

4-3-40

Item
No.
7

CommandDELE

Estimated errors and settlement methods
Error response is returned (-ERR).
Reasons and settlement methods:
1) For syntax error→ Confirm that the character string of sending DELE command is correct.
2) For command sequences error→ Execute command after PASS command is completed with normal response.
3) No message corresponding to message number specified exists, or request has
already been issued for message number deletion on DELE command within the sameconnection session.
→ Make sure to specify correct message number and execute command.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

8

QUIT

Error response is returned (-ERR).
Reasons and settlement methods:
For syntax error→ Confirm that the character string of sending QUIT command is correct.
Timeout due to no response from NACCS’s Mail Server.
Reasons and settlement methods:
As damages may be occurring, cut off the connection for a while and re-send therequest for a connection.

9

OthersConnection breaks during transmission of message.
Reasons and settlement methods:
As damages may occur, re-send the request to open a connection.

4-3-41

4.3.2.3

Message format(1)EDIFACT message
When using EDIFACT messages, a communications protocol header and a trailer are added to
an EDIFACT message.
Figure 4.3.12 shows outline of message structure.

EDIFACT message
Communications
Protocol Header

EDIFACT message (MIME)

Communications
Protocol Trailer(SMTP Trailer)(SMTP Header)Max. 10,000,000 bytes(Refer to "3 Message structure and format")・ ・ ・ ・ ・ ・ ・Subject(Refer to "4.3.2.3 (2) Contents of the SMTP header")(Refer to "4.3.2.3 (3) Contents of Subject field of the SMTP header")Figure 4.3.12 Outline of EDIFACT messages
To send EDIFACT messages to NACCS Center server, messages should be created in thefollowing format. Figure 4.3.13 and Figure 4.3.14 show examples of EDIFACT message structure.
1) Filing method
In NACCS, MIME (Multipurpose Internet Mail Extensions) is used when sending and receiving
EDIFACT messages. EDIFACT messages are filled with attached file format.
Details of regulations for MIME messages are as follow.
• MIME version is 1.0.
• Content-Type is Text/plain or Multipart/mixed.
• Content-Transfer-Encoding is BASE64 or Quoted-Printable.
• Only EDIFACT messages are encoded.
• The number of files which can be attached is only 1 file (if user send a processing
request message with multiple files attached, NACCS Center server processes only
forefront 1 file among them, and the rest of files are treated as not subject toprocessing).
2)

Image of message• An EDIFACT message comes after the "<CRLF>" code placed after the SMTP header,while being encoded with BASE64 or Quoted-Printable.
• "<CRLF>" and "." (Period) and "<CRLF>" are placed after the NACCS EDI message body,as communications protocol trailer.
4-3-42

<When Text/plain is specified for Content-Type>

LF

CR
LF

ContentTransferEncoding:
BASE64or
Quotedprintable

CR

LF

CR

LF

CR

LF

CR

ContentType:Text/plain;charset="EUC-JP"

Communications
Protocol Trailer (SMTP).

LF

XXXXXXXXXXXXXXX...XXXX(Encoded state)

MimeVersion:1.0

CR

EDIFACT message

LF

Date:
XXXXX

CR

LF

To:
XXXX

CR

LF

From:
XXXXX

CR

Communications Protocol Header(SMTP header)

Figure 4.3.13 Example of EDIFACT Message Structure (When Text/plain is specified for Content-Type)

Note: The following figure shows segments of a message displayed on text editor tools, etc.
From:XXXXXXX…XXXX<CRLF>
To:XXXXXXXX…XXX<CRLF>
Date:XXXXXXX…XXXX<CRLF>
Mime-Version:1.0<CRLF>
Content-Type:Text/plain;charset="EUC-JP"<CRLF>
Content-Transfer-Encoding:BASE64<CRLF>(There are some cases where "BASE64" is usedinstead of "Quoted-printable")<CRLF>

Communications protocol header(SMTP header)

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX…XXX<CRLF>.<CRLF>!

EDIFACT message(Encoded state)Communications protocol trailer(SMTP trailer)

How to distinguish between communications protocol trailer and "." (dot)"." is a communications protocol trailer which means the end of a response. In SMTP, theend edge of a message is recognized with <CRLF>.<CRLF>. If there is a message in which"." is placed in front of the line, in order to distinguish with the communications protocol
trailer, the Center will add "." (byte stuff) in front of the line and send it back to user. In caseif the arrival response message has a "." in front of the line and the next character string is
not <CRLF>, user will delete "." (byte stuff) in front of the line. Failure to delete byte stuff
causes errors such as messages containing an additional unwanted "." (dot) and messages
with an extra byte at the user's system.

4-3-43

<When Multipart is specified for Content-Type>CR
LF

Content-Type:multipart/mixed;boundary="YYYYYY"

CR
LF

LF

MimeVersion:1.0

CR

LF

Date:
XXXXX

CR

LF

CR

To:
XXXX

LF

From:
XXXXX

CR

Communications Protocol Header(SMTP header)

Mail body

CR
LF

LF

CR

LF

- (hyphen)

LF

.

CR

LF

CR

- (hyphen)

YYY
YYY

- (hyphen)- (hyphen)

LF- (hyphen)

CR

LF

CR

LF

CR

Attachment file
EDIFACTmessage
XXXX...XXXX(Encodedstate)YYY
YYY

ContentType;Text/plain;
name="Attachment
file name"Communications
Protocol Header(SMTP)

Mail bodyContentTransferEncoding:
BASE64or
Quoted-printable- (hyphen)

CR

LF

XXX
••XX

CR

ContentTransferEncoding:
7bit (Note)

LF

Attachment fileCR

LF

ContentType:XXXXXX
XX

CR

LF

YYY
YYY

CR

- (hyphen)- (hyphen)

Text(Note) Setting point of this item is based on email software. "7 bit" is just an example.
Figure 4.3.14 Example of EDIFACT Message Structure (When Multipart is specified for Content-Type)

4-3-44

Note: Text presentation of the above contents on text editor tools, etc. is described as follow.
From:XXXXX…XXX<CRLF>
To:XXXXX…XXX<CRLF>
Date:XXXXX…XXX<CRLF>
Communications protocol
Mime-Version:1.0<CRLF>
HeaderContent-Type:multipart/mixed; boundary="YYYYYY"<CRLF>(SMTP header)<CRLF>--YYYYYY<CRLF>
Content-Type:XX…X<CRLF>
Content-Transfer-Encoding:7bit<CRLF>
XXXXX…XXX<CRLF><CRLF>--YYYYYY<CRLF>
Content-Type:Text/plain; name="Attachment file name" <CRLF>
Content-Transfer-Encoding:BASE64<CRLF>(There are some cases where "BASE64" is used instead of "Quoted-printable")<CRLF>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX…XXX
message

EDIFACT(Encoded state)<CRLF>--YYYYYY-<CRLF>.<CRLF>

3)a.

Communications protocol
trailer(SMTP trailer)

File name of attachment files
Processing request message
User assigns an arbitrary file name. File name should be as follows
Format: 8.3 format, Total of 12 characters or less of (XXXXXXXX.XXX)
Available character: One-byte alphanumeric characters (capital letter, lowercase
letter), one-byte numeric charactersb. Processing Result Message
Processing result messages should always have only single file name specified. File nameshould be as follows.
SEANACCS.B64

4-3-45

(2) Contents of the SMTP header
Contents of the SMTP header included in processing request message and processing result
message are as follows.
1) Processing request message
Table 4.3.18 shows contents of the SMTP header in a processing request message sent fromusers.
Table 4.3.18
Item

SMTP Header (Processing Request Message)
Contents specified by the user

Item
No.
1

From

The sender of the mail.
In NACCS, a source (user) e-mail address assigned by NACCS center is
specified (refer to "4.3.4 Mail Address").
NACCS Center server checks that this is registered in the system, andwhen not registered, the mail will be discarded.

2

To

The receiver of the mail.
In NACCS, the mail address for the mail server is specified.
(Refer to "4.3.4 Mail Address")

3

Date

In NACCS, user specifies the date of sending mails.

4

MIME-version

In NACCS 1.0 is specified.
If it is not specified, that e-mail will be omitted.

5

Content-TypeIn NACCS, Text/plain;charset="EUC-JP" is specified. For multipart type,multipart/mixed; boundary="optional value" is specified.
If it is not specified, that e-mail will be omitted.

6

Content-Trans When Text/plain is specified for Content-Type, "BASE64" orfer-Encoding"Quoted-Printable" is specified.
When multipart/mixed is specified for Content-Type, specified value
depends on mail software. In this case, encode format of the attachment
files in the mail body is specified to "BASE64" or "Quoted-Printable".
If it is not specified, that e-mail will be omitted.

4-3-46

2) Processing result message
Table 4.3.19 shows contents of the SMTP header in a transaction response message(processing result notification message and output information message) sent from NACCS to auser.
Table 4.3.19
Item

Item

SMTP Header (Processing Result Message)
Contents specified by NACCS Center server

No.
1

From

The sender of the mail.
In NACCS, the mail address for the mail server is specified.

2

To

The receiver of the mail.
In NACCS user's e-mail address for mail box for incoming messages
which is used to store processing result messages is specified.

3

Date

The date the message is sent to the receiver is specified.

4

Subject(See "4.3.2.3 (3) Contents of Subject field of the SMTP header")5

MIME-Version In NACCS, "1.0" is specified.

6

Content-Type In NACCS, Text/plain;charset="EUC-JP" is specified.

7

Content-Trans In NACCS, "BASE64" is specified.
fer-Encoding

8

Content-

In NACCS, attachment;filename="attachment file name" is specified.

Disposition

4-3-47

(3) Contents of Subject field of the SMTP header
Contents of Subject field of the SMTP header included in a processing result message output
from the center server to a user are as follows.
1) Purpose
The purpose of this is by the NACCS Center server specifying the contents described in 2)
following in the "subject" of the SMTP header, details of the processing result messages stored
in the mail can be read without the user opening the mail.
2) Contents of Subject field
A common format is used for both processing result notification messages and output
information messages.
Table 4.3.20 shows contents of Subject.

Field name
Procedure-by-proc
edure data

Contents of Subject Field

lengthTable 4.3.20

OutlineFor example, processing result code, declaration number, B/L

64 number, and control number are specified.
A space is used as a data separator.
(Refer to Appendix Table 6.8 "Output Information Code List")

3) Others
Since contents of Subject field are included in an EDIFACT message body, Subject field is not
specifically useful for users who do not need to handle its contents.
(Subject field can be omitted)

4-3-48

4.3.3 Mailbox(1) Outline of mailbox
For users using e-mail style processing mode to connect with NACCS, a mailbox for outgoingmessages and mailboxes for incoming messages are available in the NACCS Center server.
1) Mailbox for outgoing messages
The mailbox for outgoing messages is a mailbox that stores processing request messages
sent from the user to NACCS. The user sends a message to the mailbox in the NACCS
Center server.
The mailbox for outgoing messages is shared among all users.
2) Mailbox for incoming messages
The mailbox for incoming messages is a mailbox that stores processing result messages(processing result notification messages and output information messages) in the NACCS
Center server.
The user sends a request to retrieve a message from the mailbox in the NACCS Center
Server and receives the relevant processing result message.
The user uses a mailbox ID and mailbox password when retrieving a processing result
message from the mailbox for incoming messages.
Mailbox ID
A mailbox ID is the identifier for the mailbox where relevant messages are stored.
A mailbox ID is used as an authentication tool for retrieving messages.
Mailbox password
A mailbox password and mailbox ID are used for access authentication for retrieving
messages.
Figure 4.3.15 shows outline of mailbox operation.
Message transmitted
TO: Mail server

Mailbox for
outgoing
messages

Message retrieved
Access authentication
Mailbox ID ********
Password ************

Mailbox for incoming
messages
ID: ********

E-mail styleprocessing
mode

Mail server

User system

Core processing
systemNACCS Center server

Figure 4.3.15 Mailbox Operation

4-3-49(2) Mailbox Assignment
The huge number of mailboxes in the NACCS Center server affects the system's performance.
Therefore, it is desirable that the total number be kept to a minimum.
Table 4.3.21 shows standard for mailbox allocation for each connection mode in NACCS.
Appendix 10 gives examples of usage of the mailbox for incoming messages.

Gateway connection

Table 4.3.21 Mailbox Assignment
Mailbox Assignment
As many mailboxes as the user wishes(3) Processing request messages in sequence
In NACCS, processing request message sent from the user will be stored in the mailbox for
outgoing messages in the NACCS Center server. The messages will be retrieved from the
mailbox one by one on a user code-by-user code basis and then transferred to the core
processing system.

(4) Retrieval of processing result messages
When sending a request to retrieve a processing result message to the mailbox for incoming
messages, an interval of at least 3 minutes (specified by NACCS Center) is required between
the last request and the current one. The reason is that if users frequently issue requests toretrieve processing result messages from their incoming mailbox, the mail server may beoverloaded, and as a result, the system response becomes slow and it takes a longer time toverify the contents of processing result messages.
In addition, users must issue a DELE command after retrieving messages by the RETR
command to delete the retrieved messages from their mailbox.
Figure 4.3.16 gives the cautionary notes for cases where the mailbox for incoming messages isshared among more than one gateway computer.

4-3-50ProcedureA

Send processing
request message

Mailbox for
outgoing
messages

Gateway computer 1

E-mail styleprocessing mode

Procedure
B

Send processing
request message
Core processing system
Procedure A’
Gateway computer 2

Procedure B’

Procedure A’
Procedure B’

E-mail styleprocessing mode

Mailbox forincoming
messages

Processing Result
Message

User system

Processing Result
Message

NACCS Center server

All messages stored in the mailbox
will be retrieved by POP3.
All messages stored in a single mailbox for incoming
messages will be received in response to a single request
for retrieval by POP3.
↓
If more than one computer shares a single mailbox forincoming messages as shown in the illustration above,
Gateway Computer 2 may receive a processing result
message in response to a processing request message
from Gateway Computer 1.

Figure 4.3.16

Cautionary Notes for Cases Where Mailbox is Shared Among Multiple Gateway
Computers(5) Retention period of messages stored in mailbox
In NACCS, processing request messages sent from users or processing result messages
retrieved by users will be deleted in the following manner:
1) Processing request message
A processing request message will be deleted after being transferred from the mail server tothe core processing system.
2) Processing Result Message
A processing result message will be deleted after being retrieved.
Processing result messages which are yet to be retrieved by users will be retained in the
mailbox for 7 days (including Saturdays, Sundays and national holidays) after entering into themailbox. Message deletion will be carried out at a specified time during the night.

4-3-51

For reference: Example of deletion of processing result message stored in mailbox:(Assumption: The specified time for deletion/retention at 0:30.)
August 1 (Fri.) 12:30
August 8 (Fri.) 0:30
August 2 (Sat.) 0:30
August 3 August 4 August 5 August 6 August 7

Message's
retention period

Registration

Deletion(6) Restrictions on re-transmission of a single message
Unnecessary re-transmission of a single message will cause the entire NACCS system tooverload which may cause reduced processing capacity. Therefore, in principle, the user should
not send a single processing request message more than once (e.g., Manifest Information
Registration of a single cargo B/L).
However, if the processing result message is not output within a NACCS Center-specified
retention period, the user can re-send the processing request message, provided that it isconfirmed that the relevant procedure has not been processed yet using the inquiry procedure.
(7) Re-retrieval of a single message
If the processing result message retrieved once (processing result message or output
information message) is inadvertently lost and or is left unretrieved throughout a specified
retention period, the message can still be retrieved in the following manner: However,processing result notification messages cannot be output again.
1) Re-send the processing request message for the inquiry procedure.
2) Implement the output procedure again, if the output information message can be re-retrieved.
(8) Measures against mailbox overflow
In NACCS, the mails user retrieves from the mailbox will be deleted. In addition, theunprocessed mails which are not retrieved from the mailbox will be deleted after 7 days passed.
Therefore, it is unlikely that mails will continue to be stored at the NACCS mailbox, so there islittle possibility the mailbox will become full.
However, if by any chance there is a possibility where the mailbox is overflowed arose, avoid
overflow by implementing the following countermeasures.
1) Mailbox for outgoing messages
In NACCS, if the usage of the mailbox for outgoing messages in the NACCS Center server
exceeds the limit, receipt of all messages from users will be suspended. In this case, a timeout
message will be sent to the users. As the users need to re-send messages timed out, the user
system must be provided with a function to temporarily store messages that have beencreated.
2) Mailbox for incoming messages
In NACCS, if the usage of the mailbox for incoming messages in the NACCS Center server
exceeds the limit, receipt of messages from the core processing system to the mailbox forincoming messages will be suspended. In this case, the users need to retrieve themessages from the mailbox for incoming messages immediately. (NACCS Center will contact
the users by telephone or fax, or an announcement will be posted on the NACCS information).
In addition to the cases mentioned above, when the system is overloaded, overload control
will be activated and receipt of messages from all users may be suspended. (NACCS Center
will contact the users by telephone or fax, or an announcement will be posted on the NACCS
information).
4-3-52

4.3.4E-mail address(1) Outline of user's email address and address assignment policy
The e-mail address account used in e-mail style processing mode on the NACCS system shallmatch the mail box ID. In other words, each user using e-mail style processing mode will have one
mailbox and one mail address.
Figure 4.3.17 shows an example of a mail address given in an SMTP header in processing
request and processing result messages. The user's mail address is displayed in the From field of"1) Processing request message" and in the To field of "2) Processing result message", while
NACCS Center server's mail address is displayed in the To field of "1) Processing request
message" and in the From field of "2) Processing result message".
Mail Address
1) From：AAAAA001@MAIL.PROD.NACCS6
To ：NACCS@MAIL.PROD.NACCS6
NACCS EDI
SMTP Header
MessageCore processing system

NACCS@MAIL.
PROD.NACCS6

E-mail styleprocessing mode
user
(NACCS EDI
message)

SMTP header

NACCS EDI
Message

AAAAA001@MAIL.
PROD.NACCS6

Mail Address：
MAIL.PROD.NACCS6

・・

Mail box ID:AAAAA001
Mail box password：********

Mail Address
From：NACCS@MAIL.PROD.NACCS6
2) To ：AAAAA001@MAIL.PROD.NACCS6
Mail Server

Mail Address
1) From：BBBBB001@EDIFACT.PROD.NACCS6
To ：NACCS@EDIFACT.PROD.NACCS6
SMTP header

Mail Address：
EDIFACT.PROD.NACCS6EDIFACT Message
NACCS@EDIFACT.
PROD.NACCS6

E-mail styleprocessing mode
user
(NACCS EDI
message)

SMTP header

EDIFACT Message

BBBBB001@EDIFACT.
PROD.NACCS6

Mail box ID:BBBBB001
Mail Box password：********

・・

Mail Address
From：NACCS@EDIFACT.PROD.NACCS6
2) To ：BBBBB001@EDIFACT.PROD.NACCS6

NACCS Center server

User system
Figure 4.3.17 Mail Address in SMTP Header

4-3-53

(2) User's mail address in e-mail style processing mode
Figure 4.3.18 shows the format of user's mail address used in e-mail style processing mode:
In addition, format of mail account is similar to Mailbox ID.

○○○○○○○○@(NACCS Center server name)Mail account (8 digits)(assigned by NACCS Center)

Domain name(See Figure 4.3.20)

Figure 4.3.18 Format of User’s Mail Address in E-mail Style Processing Mode (one-byte capital letters)(3) NACCS Center server's mail address in e-mail style processing mode
Figure 4.3.19 shows the format of the Center server's mail address used in e-mail styleprocessing mode:

NACCS @(NACCS Center server’s server name))
E-mail account(Fixed)Domain name(See Figure 4.3.20)

Figure 4.3.19 Format of NACCS Center Server’s Mail Address in E-mail Style Processing Mode(one-byte capital letters)(4) Domain name in e-mail style processing mode
Figure 4.3.20 shows the domain name format in e-mail style processing mode:(For NACCS EDI messages or XML messages)

MAIL.PROD.NACCS6
Server name(="MAIL")(Fixed)(For EDIFACT messages)

EDIFACT.PROD.NACCS6
Server name(="EDIFACT")(Fixed)Figure 4.3.20 Domain Name Format in E-mail Style Processing mode (one-byte capital letters)

4-3-54Moreover, the main center and the backup center can be switched by changing the DNS serverdata in NACCS Center. As a result, the user does not need to recognize the NACCS server's mailaddress when the backup center is operated.
In addition, Figure 4.3.21 shows the format of the domain name of NACCS Center server whenswitched to the backup center when disasters, etc. occur at the main center.
(For NACCS EDI messages or XML messages)

MAIL.PROD.NACCS6
Server name (Fixed)(="MAIL")(For EDIFACT messages)

EDIFACT.PROD.NACCS6
Server name(="EDIFACT")(Fixed)Figure 4.3.21 Domain Name for Backup Site (one-byte capital letters)(5) Mail address used when sending a message
Email addresses in the From and To fields given in the SMTP header in a processing request
message sent from the user to the NACCS Center server shall be given as follows:
From: User mail address (e.g.: AAAAA001@MAIL.PROD.NACCS6)
To: NACCS center server e-mail address (e.g.: NACCS@MAIL.PROD.NACCS6)
or,
From: User mail address (e.g.: AAAAA001@EDIFACT.PROD.NACCS6)
To: NACCS center server e-mail address (e.g.: NACCS@EDIFACT.PROD.NACCS6)
Mail addresses in the From and To fields are mandatory: as a communications protocol for the From
field; as a means to identify the destination’s mail server for the To field.
(6) Mail address used when receiving a message
Mail addresses in the From and To fields given in the SMTP header in a processing result
message sent from the NACCS Center server to the user shall be given as follows:
From: NACCS center server e-mail address (e.g.: NACCS@MAIL.PROD.NACCS6)
To: User mail address (e.g.: AAAAA001@MAIL. PROD.NACCS6)
or,
From: NACCS center server e-mail address (e.g.: NACCS@EDIFACT.PROD.NACCS6)
To: User mail address (e.g.: AAAAA001@EDIFACT.PROD.NACCS6)
The above addresses will be provided on the NACCS’s Mail Server.
(7) Notification of mail address
The e-mail address used in a message sent to / from a user is provided and announced by
NACCS Center. Users must use these addresses.
4-3-55

4.3.5

Procedure processing sequence
Figure 4.3.22 shows a message processing sequence in e-mail style processing mode:

E-mail style processing
mode user

Core processing
systemNACCS Center mail server

1) Processing Request Message2) Processing Request Message3) Procedure
Processing6) Processing result message (for screen)
Message Type R

4) Processing result message(for screen) Message Type R

7) Processing result message (for screen)
Message Type C

5) Processing result message(for screen) Message Type C

10) Processing Result Message (for printer)
Message Type P

8) Processing result message(for printer) Message Type P
9) Processing result message(for printer) Message Type P

11) Processing Result Message (for printer)
Message Type P

Mailbox forincoming
messages

Figure 4.3.22 Message processing sequence
1) The user sends a processing request message using SMTP to the NACCS’s Mail Server.
• See "4.3.1.2 Details of Communications Protocol" for a SMTP command sequence in sending aprocessing request message.
• Processing request message format varies depending on the procedure. See the ProcedureSpecification for individual formats.
• Processing request message formats are represented by NACCS EDI format, MIME format andXML format.
2) The mail server checks the processing request message received and forwards it to the core
processing system.
• The mail server also converts an EDIFACT message to a
NACCS EDI message.
3) The core processing system checks the processing request message forwarded and executes theprocedure.
4), 5) The core processing system registers a processing result message (for screen) with the mailbox forincoming messages.
(According to the procedure specifications, there are cases in which more than one processing
result message (for screen) will occur. Figure 4.3.22 shows the case in which Message Type [R]and [C] of processing result messages (for screen) are sent).
• The mail server also converts a NACCS EDI message to an EDIFACT message.
6), 7) Using e-mail processing mode, the user receives a processing result message (for screen)transmitted to the user's mailbox in the mail server using POP.
• See "4.3.1.2 Details of Communications Protocol" for POP command sequence.
• Processing result message format (for screen) varies depending on the procedure. See the4-3-56

Procedure Specification for individual formats.
• Processing result message formats (for screen) are represented by NACCS EDI format, MIME
format and XML format.
8), 9) The core processing system transmits a processing result message (for printer) to the mail server.
(No processing result message (for printer) may be generated or multiple processing result
messages (for printer) may be generated depending on the procedure. Figure 4.3.22 shows anexample in which two processing result messages (for printer) are transmitted.
• The mail server also converts a NACCS EDI message to an EDIFACT message.
10), 11) Using e-mail style processing mode, the user receives a processing result message (for printer)transmitted to the user's inbox in the mail server using POP.
• See "4.3.1.2 Details of Communications Protocol" for POP command sequence.
• Processing result message format (for screen) varies depending on the procedure. See theProcedure Specification for individual formats.
• Processing result message formats (for screen) are represented by NACCS EDI format, MIME
format and XML format.
(Note 1) When the user sends a retrieval request using POP, all messages available at that time can be
retrieved.
(Note 2) The order of arrival as mentioned in 6), 7), 10) and 11) above is not guaranteed.
(Note 3) An EXC type message and an EXZ type message are generated upon implementation of aprocedure by a third person, which applies only to portions of a sequence as presented in 8) and10) (or 9) and 11)) of Figure 4.3.22 above.

4-3-57

4.3.6

Others(1) Access lines for e-mail style processing mode
E-mail style processing mode (for gateway computers) is available when a gateway computer is
set up for the user’s system, and connect to NACCS via a dedicated access line or fiber optic
broadband.
(2) Restrictions
E-mail style processing mode (for gateway computers) users must observe the following
restrictions:
1) When sending a request to receive a processing result message in the mailbox for incoming
messages, after transmission of a notification of completion upon issuance of the QUIT command
following deletion of a message in response to the previous request for retrieving a processing
result message, longer than a specific period of time specified by NACCS Center (3 minutes)
must have lapsed before reconnecting to NACCS. The reason is that if users frequently issue
requests to retrieve processing result messages from their incoming mailbox, the mail server may
be overloaded,
2) When establishing a connection to NACCS via a gateway server, the DELE command must be
issued to delete a message which has already been retrieved from the mailbox in response to the
RETR command for the retrieval of the message. (Note)3) The QUIT command must be sent upon completion of transmission of all the processing
request messages. If the QUIT command is not issued from the gateway computer within a
specified period of time after transmission of all the processing request messages, a connection
timeout notification must be issued from the NACCS's Mail Server to force a disconnection.
(Note)
4) If the usage rate of the mailbox for incoming messages at the NACCS Center server exceeds a
specified limit, receipt of messages sent from the core processing system to the mailbox forincoming messages will be suspended. In this case, the user must retrieve the messages fromthe mailbox for incoming messages immediately.
5) Multiple connections from the same e-mail address are prohibited (the same as connections
within the period specified by the NACCS Center).
6) Add "<CRLF>" at the end of the message (a line with only a period) as the SMTP
communications protocol trailer. The last chunk of the data is recognized with "<CRLF>.<CRLF>",
with "<CRLF>" placed at the end of the data and "<CRLF>" placed as the communications
protocol trailer. (Note)(3) Retention period for attachment files stored in attachment file storage table
For retention period for attachment files for each procedure, refer to Procedure Specifications.

4-3-58

(4) Other provisions
When establishing a connection in e-mail style processing mode (for gateway computers), users mustobserve the following restrictions:
1) E-mail style processing mode (for gateway computers) is not compatible with APOP (RFC1321 andRFC1939), a mode of authentication exchange in POP3.
2) When sending a processing request message, any message in which the domain name of the user
system in the “From” field of the SMTP header is not in the form of XXX.XXX.NACCS6,” will be ignored by
the mail server. The user system must re-send such messages with the correct settings.
3) In e-mail style processing mode (for gateway computers), multiple processing request messages can besent consecutively, but processing request messages sent from the user are not always processed on afirst in, first out basis in the core processing system due to the architecture of the mail server.
4) If more than one processing result messages are generated for a single procedure requested, the orderof arrival to the mailbox for incoming messages is not guaranteed. Figure 4.3.23 shows an example.
Therefore, the user system must not be so built that processing result notification messages are processed
first.
5) If the usage of the mailbox for outgoing messages in the NACCS Center server exceeds the limit, receipt
of all messages from users will be suspended. In this case, a timeout message will be sent to the users. As
the users need to re-send messages timed out, the user system must be provided with a function totemporarily store messages that have been created.
6) In case of an overload in the system, operation limit such as halts of receiving transaction request
messages from all users may be used. In this case, NACCS Center will contact users by telephone, fax, or
NACCS Information, etc.
7) As there is a limit to the number of users who can access the mail server at the same time, there may be
a case where the connection between the user system and mail server cannot be established.
8) In the event of NACCS operation from a backup site following a disaster, the user must make sure toconnect to the mail server located at the backup site.
9) An environment to test the connection is built partly in the back up center. Therefore, if the main center isaffected due to great disaster, system will be operated in the back up center, and connection test may be
unavailable.
If more than one processing result messages are generated fora single procedure requested, the order of arrival to the mailbox
between the processing result notification message and output
information message (for printer) is not guaranteed.
Send processing request
message

Mailbox for
outgoing
messages
Processing result
notification message

Gateway
computer

Mailbox for incoming
messages

User system

Core processing
systemOutput information message(for printer)

NACCS Center server

Figure 4.3.23 Sequence of Arrival of More than One Processing Result Messages (Example)
4-3-59(5) Value of each timer classification
Table 4.3.22 shows a list of timer settings predefined for connections established in e-mail styleprocessing mode. Individual timer settings are given in Figure 4.3.24 to Figure 4.3.26.
Table 4.3.22 List of Timer Settings
ID
Observation content
Timer's value
T01
Time required for monitoring the SMTP connection
Specified by user
between the user system and the mail server on the
NACCS Center side during transmission of a message by
the user
T02
Time required for monitoring the POP3 connection between Specified by user
the user system and the mail server on the NACCS Centerside during receipt of a message sent by the user
T03
Idle time following the establishment of an SMTP
2 minutes
connection between the user system and the mail server on
the NACCS Center side
T04
Idle time following the establishment of a POP3 connection 2 minutes
between the user system and the mail server on the
NACCS Center side
T05
Time to re-send in case if errors occur in NACCS center
At least 3 minutes
server and the transaction response message notifying that
"Center busy" returns(Note) The timer's value is specified a value in the present system.
(Note) T01 to T05 given in the ID column of the table above are the ID numbers of each timer shown in
Figure 4.3.24 to Figure 4.3.26.

User system

NACCS Center
mail server
Request to open a connection
HELO
MAIL
RCPT
T03

T01
DATA
Message transmitted<CRLF>.<CRLF>
QUIT

Figure 4.3.24 Timer Set for SMTP Connection

4-3-60NACCS Center
mail server

User system
Request to open a connection
USER
PASS
STAT/LIST

T04

T02
RETR
DELE
QUIT

Figure 4.3.25 Timer Set for POP3 Connection

User system

NACCS Center
mail server

Send processing request message
Processing result message (Center busy)

T05
Send processing request message
Processing result message (normal)

Figure 4.3.26 Setting Timer in Case Center Is busy

4-3-61