{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"For an electronic mail application you are to describe the SMTP-based communication that takes place between pairs of MTAs. The sender\u0027s User Agent gives a formatted message to the sending MessageTransfer Agent (MTA). The sending MTA communicates with the receiving MTA using the SimpleMail Transfer Protocol (SMTP). The receiving MTA delivers mail to the receiver\u0027s User Agent. Aftera communication link is initialized, the sending MTA transmits command lines, one at a time, to thereceiving MTA, which returns a three-digit coded response after each command is processed. Thesender commands are shown below in the order sent for each message. There is more than one RCPTTO line when the same message is sent to several users at the same MTA. A message to users atdifferent MTAs requires separate SMTP sessions.\n\nHELO myname Identifies the sender to the receiver (yes, there is only one L)\n\nMAIL FROM:\u003csender\u003eIdentifies the message sender\n\nRCPT TO:\u003cuser\u003eIdenti es one recipient of the message\n\nDATA Followed by an arbitrary number of lines of text comprising the messagebody, ending with a line containing a period in column one.\n\nQUIT Terminates the communication.The following response codes are sent by the receiving MTA:\n\n221Closing connection (after QUIT)\n\n250 Action was okay (after MAIL FROM and RCPT TO specifying an acceptable user, or completionof a message)\n\n354 Start sending mail (after DATA)\n\n550 Action not taken; no such user here (after RCPT TO with unknown user)\n\nInput\n\nThe input contains descriptions of MTAs followed by an arbitrary number of messages. Each MTA description begins with the MTA designation and its name (1 to 15 alphanumeric characters). Following the MTA name is the number of users that receive mail at that MTA and a list of the users (1 to 15 alpha numeric characters each). The MTA description is terminated by an asterisk in column 1. Eachmessage begins with the sending user\u0027s name and is followed by a list of recipient identifiers. Each identifier has the formuser@mtaname. The message (each line containing no more than 72 characters)begins and terminates with an asterisk in column 1. A line with an asterisk in column 1 instead of asender and recipient list indicates the end of the entire input.\n\nOutput\n\nFor each message, show the communication between the sending and receiving MTAs. Every MTAmentioned in a message is a valid MTA; however, message recipients may not exist at the destinationMTA. The receiving MTA rejects mail for those users by responding to the RCPT TO command withthe 550 code. A rejection will not affect delivery to authorized users at the same MTA. If there is notat least one authorized recipient at a particular MTA, the DATA is not sent. Only one SMTP sessionis used to send a message to users at a particular MTA. For example, a message to 5 users at the sameMTA will have only one SMTP session. Also a message is addressed to the same user only once. Theorder in which receiving MTAs are contacted by the sender is the same as in the input le. As shownin the sample output, pre x the communication with the communicating MTA names, and indent eachnon-empty communication line. No innecessary spaces should be printed.\n\nSample Input\n\nMTA London 4 Fiona Paul Heather Nevil\nMTA SanFrancisco 3 Mario Luigi Shariff\nMTA Paris 3 Jacque Suzanne Maurice\nMTA HongKong 3 Chen Jeng Hee\nMTA MexicoCity 4 Conrado Estella Eva Raul\nMTA Cairo 3 Hamdy Tarik Misa\n*\nHamdy@Cairo Conrado@MexicoCity Shariff@SanFrancisco Lisa@MexicoCity\n*\nCongratulations on your efforts !!--Hamdy\n*\nFiona@London Chen@HongKong Natasha@Paris\n*\nThanks for the report! --Fiona\n*\n*\n\nSample Output\n\nConnection between Cairo and MexicoCity\n HELO Cairo\n 250\n MAIL FROM:\u003cHamdy@Cairo\u003e\n 250\n RCPT TO:\u003cEminem@MexicoCity\u003e\n 550\n RCPT TO:\u003cConrado@MexicoCity\u003e\n 250\n RCPT TO:\u003cLisa@MexicoCity\u003e\n 550\n RCPT TO:\u003cEva@MexicoCity\u003e\n 250\n DATA\n 354\n Congratulations on your efforts !!\n --Hamdy\n .\n 250\n QUIT\n 221\nConnection between Cairo and SanFrancisco\n HELO Cairo\n 250\n MAIL FROM:\u003cHamdy@Cairo\u003e\n 250\n RCPT TO:\u003cShariff@SanFrancisco\u003e\n 250\n DATA\n 354\n Congratulations on your efforts !!\n --Hamdy\n .\n 250\n QUIT\n 221\nConnection between London and HongKong\n HELO London\n 250\n MAIL FROM:\u003cFiona@London\u003e\n 250\n RCPT TO:\u003cChen@HongKong\u003e\n 250\n DATA\n 354\n Thanks for the report! --Fiona\n .\n 250\n QUIT\n 221\nConnection between London and Paris\n HELO London\n 250\n MAIL FROM:\u003cFiona@London\u003e\n 250\n RCPT TO:\u003cNatasha@Paris\u003e\n 550\n QUIT\n 221\nConnection between London and Paris\n HELO London\n 250\n MAIL FROM:\u003cPaul@London\u003e\n 250\n RCPT TO:\u003cMaurice@Paris\u003e\n 250\n RCPT TO:\u003cJacque@Paris\u003e\n 250\n DATA\n 354\n Testando essa merda pqp!\n .\n 250\n QUIT\n 221\nConnection between London and MexicoCity\n HELO London\n 250\n MAIL FROM:\u003cPaul@London\u003e\n 250\n RCPT TO:\u003cEva@MexicoCity\u003e\n 250\n DATA\n 354\n Testando essa merda pqp!\n .\n 250\n QUIT\n 221\nConnection between London and Cairo\n HELO London\n 250\n MAIL FROM:\u003cPaul@London\u003e\n 250\n RCPT TO:\u003cMisa@Cairo\u003e\n 250\n DATA\n 354\n Testando essa merda pqp!\n .\n 250\n QUIT\n 221\nConnection between London and London\n HELO London\n 250\n MAIL FROM:\u003cPaul@London\u003e\n 250\n RCPT TO:\u003cFiona@London\u003e\n 250\n DATA\n 354\n Testando essa merda pqp!\n .\n 250\n QUIT\n 221"}},{"title":"","value":{"format":"PLAIN","content":"对于一个电子邮件应用程序,你要描述基于SMTP的通信,发生在一对MTA之间。发件人的用户代理向发送的MessageTransfer Agent(MTA)提供一个格式化的消息。发送MTA使用SimpleMail传输协议(SMTP)与接收MTA进行通信。接收MTA将邮件传送给接收方的用户代理。在通信链路初始化后,发送MTA每次向接收MTA发送一条命令行,在每条命令处理完毕后,接收MTA返回一个三位数的编码响应。 下面按每条消息的发送顺序列出了发送命令。当同一报文被发送到同一MTA的多个用户时,会有多个RCPTTO行。发给不同MTA的用户的消息需要单独的SMTP会话。\n\nHELO myname 向接收者指明发送者(是的,只有一个L)。\n\nMAIL FROM:\u003c发件人\u003e确定邮件发件人。\n\nRCPT TO:\u003c用户\u003e确定一个信息的接收者。\n\nDATA 后面跟着任意行数的文本,组成信息体,最后一行包含第一列的句号。\n\nQUIT 终止通信.接收MTA会发送以下响应代码。\n\n221关闭连接(QUIT之后\n\n250 操作正常(在MAIL FROM和RCPT TO指定了一个可接受的用户,或完成了一个消息之后\n\n354 开始发送邮件(DATA后)。\n\n550 未采取任何行动;此处无此用户(与未知用户进行RCPT TO后)\n\n输入\n\n输入包含MTA的描述,后面是任意数量的消息。每个MTA的描述都以MTA名称和它的名字(1至15个字母数字字符)开始。在MTA名称之后是在该MTA接收邮件的用户数量和用户列表(每个用户1到15个字母数字字符)。MTA描述在第1列中以星号结束。每条消息都以发送用户的名字开始,后面是收件人标识符的列表。每个标识符的格式是user@mtaname。信息(每行不超过72个字符)以第1列中的星号开始和结束。第1列中带有星号的行而不是发件人和收件人列表表示整个输入的结束。"}}]}