Re: [ietf-smtp] SMTP Reply code 500

Alessandro Vesely <> Wed, 04 March 2020 09:10 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2A39F3A09BC for <>; Wed, 4 Mar 2020 01:10:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.077
X-Spam-Status: No, score=-2.077 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1152-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 9-TrcSJPnBIK for <>; Wed, 4 Mar 2020 01:10:03 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 5FBEA3A09A5 for <>; Wed, 4 Mar 2020 01:10:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=delta; t=1583313000; bh=OXYO86DV23TwGvA7OIWowv4XzzacWBCezX/O3qfnKM0=; l=1469; h=To:References:From:Date:In-Reply-To; b=BLWAEQ3PxgxeDdBq+xdOjqvX1r8aQ0U4K0ajYk8iTll+prEXlz1Wv1DGR6LGrLSwh YFpRd60G96zdyfW7bc8lCTUhMRr8otsbuxME+6qi48lZf/kcilfL/qgbcQfpojskBi zJ6heh/E/vn7y33Mn38t9BOTVbIr2Oo6DxK8Y6HphIascs+X7CjSzqFIZ4M+5
Authentication-Results:; auth=pass (details omitted)
Received: from [] (pcale.tana []) (AUTH: CRAM-MD5 uXDGrn@SYT0/k, TLS: TLS1.2, 128bits, ECDHE_RSA_AES_128_GCM_SHA256) by with ESMTPSA id 00000000005DC081.000000005E5F7068.000031B2; Wed, 04 Mar 2020 10:10:00 +0100
References: <>
From: Alessandro Vesely <>
Message-ID: <>
Date: Wed, 4 Mar 2020 10:10:00 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <>
Subject: Re: [ietf-smtp] SMTP Reply code 500
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Discussion of issues related to Simple Mail Transfer Protocol \(SMTP\) \[RFC 821, RFC 2821, RFC 5321\]" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 04 Mar 2020 09:10:11 -0000


On Wed 04/Mar/2020 04:00:45 +0100 Geethapriya Liyanage wrote:
> In SMTP communication, normally SMTP client sends commands and SMTP server
> replies to that with reply codes.  As in RFC 5321 , section 4.2.4, if the
> command is not recognized, code 500 should be returned. My doubt is, if the
> SMTP server sends unrecognized command or code to SMTP client , will the client
> also replies the same 500 code.  if not, how the SMTP client should handle it.

SMTP clients can work well by just recognizing the first digit of the reply
code.  "5", in that case, more or less means that the last command failed,
client should stop the transaction if it's in the middle of one, and not retry
sending without prior human intervention.

A client that cannot recognize the first digit of a reply code is not an SMTP

To precisely recognize the meaning of a reply can be useful to fine tune an
SMTP client's behavior.  Interpretation of reply codes can be done by humans
who read the log files or the bounce messages, or by machines.  The so called
extended (or enhanced) status codes, which some servers display between the
reply code and the human readable text string, can help machine interpretation.

Usually, however, the fine-tuning that can result from a correct interpretation
does not affect the immediate future of the current client/server session.  The
first digit is enough to make immediate decisions.