Except as provided in section five, every non-resident doing business in the commonwealth shall file a certificate with the clerk of each city or town where he does business, setting forth his full name, address and place of business and the trade name under which he does business, and also a statement whereby he appoints the clerk of each such city or town, or his successor in office, his true and lawful agent upon whom all lawful processes may be served in any action arising out of such business in this commonwealth. If such person fails to appoint an agent and does business in this commonwealth, service of process may be made upon the clerk of any city or town where such business is conducted. When legal process against any such person is served upon such clerk, a copy of such process shall forthwith be sent by registered mail with a return receipt requested by the plaintiff to the defendant at his last known address. The plaintiff's affidavit of compliance herewith, and the defendant's return receipt, if received by the plaintiff, or other proof of actual notice shall be filed in the case on or before the date on which the defendant's answer must be filed, or within such further time as the court may allow.
Mass. Gen. Laws ch. 227, § 5A