About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
A scanner that emails documents, a printer that sends reports or a fax machine hands its message to Gmail and gets 501 5.5.4 back, with the connection closed. The error is about how the sending machine introduces itself at the start of the conversation, before any message is sent. Google says the sender must introduce itself with its fully-qualified domain name or IP address.
Everything before the Fix section only reads.
What the error means
Google's Gmail Help page "Fix bounced or rejected emails" has a section headed You get a "HELO/EHLO" error message. It explains: "When the mail server that responds to Google identifies itself with an invalid value, you get a "HELO/EHLO argument invalid" error message." It gives two examples:
501 5.5.4 Empty HELO/EHLO argument not allowed, closing connection.
501 5.5.4 HELO/EHLO argument “...” invalid, closing connection.
Each is followed on the page by a line with the address https://support.google.com/mail/?p=helo. Google's page "Gmail SMTP errors and codes" lists the same two as rows with code 501 and status 5.5.4.
The page explains the rule: "When mail servers talk to each other, they're required to identify themselves to the receiving server with a HELO or EHLO command. This identification should be the sending machine's fully-qualified IP address or domain name (like mail.example.com). Any other value is considered invalid and can reject your email."
The Fix page says where it shows up: "This error usually occurs with devices like printers, scanners, and fax machines that also send mail."
The neighbouring messages
Three other messages mention HELO or EHLO, and each is a different fault:
503 5.5.1, "EHLO/HELO first. An email transaction protocol command was issued out of sequence." The commands arrived in the wrong order. The page links this row to the same HELO/EHLO help as the501rows.550 5.7.0"Email relay denied" and the relay messages from Google Workspace's SMTP relay, which ask the sending client to use "an appropriate value for both the HELO command; ideally, the fully qualified domain name (FQDN) of the sending device". That error is covered in Google Workspace SMTP relay: email relay denied (5.7.0).421 4.7.0"Connection expired, try reconnecting" is a connection fault covered in Gmail 421 4.7.0.
Likely causes
Google's pages name two values that fail, plus one place where the guidance is stricter for relay users.
| What the sender presents | What Google's pages say | Message |
|---|---|---|
| Nothing at all | "Empty HELO/EHLO argument not allowed, closing connection." | 501 5.5.4 empty argument |
| Anything other than the machine's fully qualified domain name or IP address | "Any other value is considered invalid and can reject your email." | 501 5.5.4 argument invalid |
| A generic name when the mail goes through Google Workspace's SMTP relay | "We recommend that servers present unique identifiers in the HELO or EHLO arguments during SMTP connections." Google's examples of generic identifiers are localhost and smtp-relay.gmail.com. |
Relay guidance, in a separate section about denial of service limits |
The third row applies to mail sent to smtp-relay.gmail.com; the 501 rows on the Fix page are not tied to that service.
Prove the cause before changing anything
Every step here reads and changes nothing.
-
Write down the exact bounce or log line: the code, the text after it, the time, and the device or server that sent the message. Compare it with the two examples above. If the text is
503 5.5.1, the fault is a command sequence fault, a different error. -
Find out which device or server presents itself. The bounce shows the sender. Google says the error is typical of "printers, scanners, and fax machines", so the first candidates are those devices.
-
Read the device's mail settings for the field that sets the name the device announces when it connects, which may not be labelled "HELO". Our own advice: the device's manual shows where this field is. Write down what the field holds, or that it is empty.
-
If the device sends through Google Workspace's SMTP relay, compare the value with Google's guidance for that service: a domain name or the server name rather than
localhostorsmtp-relay.gmail.com.
An example, labelled as an illustration: a multifunction printer at example.com.au is set to email scans and its name field is blank. Every scan to a Gmail address returns 501 5.5.4 Empty HELO/EHLO argument not allowed. The first row of the table applies.
Fix
Google's instruction on the Fix page for this error is short. Under "What you can do" it says: "Contact your email provider. If you use Gmail for work or school, ask your administrator to send the fully-qualified domain name or IP address of the sending server when they contact Gmail servers."
Our own reading: the change that follows from it is made on the sending device or server, and is the value it announces when it connects.
Write down the current value of the field that sets the name the device announces, or that the field is empty, and the time.
Risk: the next step changes the mail settings of the device. A wrong value in it can stop every scan-to-email or report from that device until it is set back. Changes to a shared printer affect everyone who uses it.
Set the field to the fully qualified domain name of the sending machine, in the form Google gives, such as mail.example.com, or to the machine's IP address, and save the setting.
To undo it: set the field back to the value you wrote down, or clear it if you wrote down that it was empty.
The route Google documents for devices
If the device cannot present a fully qualified name, Google's page "Send email from a printer, scanner, or app" describes three routes for sending through Google Workspace. This is a description of the page, not a set of steps.
| Route | Server | Authentication | Limit or scope on the page |
|---|---|---|---|
| Option 1, SMTP relay (recommended) | smtp-relay.gmail.com, port 25, 465 or 587 |
By IP address; configured in the Admin console | Each user can relay messages up to 10,000 recipients per day |
| Option 2, Gmail SMTP server | smtp.gmail.com, 465 for SSL or 587 for TLS |
Google Workspace email address and an app password | 2,000 messages per day |
| Option 3, restricted Gmail SMTP server | aspmx.l.google.com, port 25 |
None; the IP address is added to an allowlist | Messages to Gmail or Google Workspace users only |
Google says the SMTP relay service authenticates messages with IP addresses, so devices and apps can send messages to anyone inside or outside of the organisation, and that this option is the most secure. For option 2, Google says the device authenticates with the Gmail or Google Workspace account and password when it is set up, and uses those credentials every time it sends.
The page adds that older scanners or printers "might not support OAuth" and that "These devices might not support sending email." It also says that Google does not support issues with third-party devices or apps, and sends the reader to the device or app vendor.
Confirm the fix
- Send a test message from the device to a Gmail address and check that no
501 5.5.4returns. - Check the device's own log, if it keeps one, for an accepted message rather than a refusal.
- Send a scan or report that was refused earlier, to the same recipients.
- If the device sends through the SMTP relay, send a second message on the same day and check that no relay message such as
550 5.7.0or454 4.7.0appears. The 454 message is covered in Google Workspace SMTP relay 454 4.7.0.
What to watch afterwards
- A device replaced or reset, which may need the same field set again.
- A changed host name or IP address, which the value the device announces has to follow.
- Other Gmail errors. A sender that now introduces itself correctly can meet the next requirement, for example the
5.7.25message about a missing PTR record, covered in Gmail 550 5.7.25. - The administrator's part. For Gmail used at work or school, Google's instruction is to ask the administrator to send the fully-qualified domain name or IP address of the sending server.
Read next
Related articles you may want next.
- TroubleshootingGmail 550 5.7.25: the sending IP has no PTR, or forward DNS does not match itGmail blocked mail with 550 5.7.25. Check the PTR on the sending IP and the A or AAAA for that hostname, then publish a matching pair.Read article
- TroubleshootingGoogle Workspace SMTP relay: 5.7.0 Email relay deniedGoogle Workspace SMTP relay returns 5.7.0 Email relay denied when the sender is not registered. Register the public IP or use SMTP authentication on smtp-relay.gmail.com.Read article
- TroubleshootingGmail 421 4.7.0: Connection expired, try reconnectingGmail returned 421 4.7.0 Connection expired, try reconnecting. Distinguish it from other 4.7.0 replies, reconnect the SMTP session, and confirm the message leaves the deferred queue.Read article
Risks and limits
Google's page on bounced email refers readers to RFC 5321, section 4.1.1.1 for more about the error. The relay rows apply only to Google Workspace's SMTP relay.
Sources
- Fix bounced or rejected emails — Gmail Help, no date shown, accessed 4 December 2026
- Gmail SMTP errors and codes — Google Workspace Help, page dated 2 December 2026, accessed 4 December 2026
- SMTP relay service error messages — Google Workspace Help, page dated 2 December 2026, accessed 4 December 2026
- Route outgoing SMTP relay messages through Google — Google Workspace Help, page dated 2 December 2026, accessed 4 December 2026
- Send email from a printer, scanner, or app — Google Workspace Help, page dated 2 December 2026, accessed 4 December 2026
This article was originally published on .