SMTP authentication bug -- Apple Mail cutting off first letter of username

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Normal user
Normal user
Posts: 31
Joined: 2014-07-17 23:32

SMTP authentication bug -- Apple Mail cutting off first letter of username

Post by bcpaul » 2015-01-15 01:03

hmailserver install is working well for 50 users. I have a couple of Apple Mail users (Mavericks and Yosemite) that intermittently try to send email SMTP and the first letter of the username gets cut-off.
So they get autobanned. This is not every time and I have ruled out any issues with incorrect data from the app itself.

So username to login to hmailserver changes to

I did a google search and this is what I found:
michaelfromhoejslev Jul 15, 2014 11:44 AM
Re: mail smtp authentication bug: first character of user missing in response to zantafio

I am witnessing the same problem with hMailserver and the applemail client.

I would seem that the way apple sends imap requests to the server may have

been altered in Mavericks (10.9.4).

If wrong login info is sent to the server (missing letter as in this case)

4 times ( or how autoban is configured )

the server will ban the IP for a pre defined period

If you are sending from a static IP you can "whitelist" the IP on your server

/Settings/Advanced/IP Ranges

Which should help as applemail apparently only sends the wrong login request intermittently.

It would be my guess that the issue will need to be addressed by hMail update.

- hope you found this helpful
CRAP...My version is 5.4.1. I will update and report back

Does anyone know how to solve this issue and/or why it is occurring?



User avatar
Posts: 20971
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: SMTP authentication bug -- Apple Mail cutting off first letter of username

Post by mattg » 2015-01-15 10:50

I'd guess it is occurring because Apple gets it wrong

Your options are to do as that post suggested, and create a whitelist entry for the IP, or to disable Autoban.

I'm unsure how this could be a hMailsevrer issue
Just 'cause I link to a page and say little else doesn't mean I am not being nice.

Normal user
Normal user
Posts: 31
Joined: 2014-07-17 23:32

Re: SMTP authentication bug -- Apple Mail cutting off first letter of username

Post by bcpaul » 2015-01-16 01:24

Still getting the same issue after the update to 5.6 B2145. Any idea how I can troubleshoot this? Where is the character getting lopped off?
The login info in the SMTP logs is masked so I cannot see the username that is used. However, in the banned list, the first character of the username is gone.

Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: SMTP authentication bug -- Apple Mail cutting off first letter of username

Post by percepts » 2015-01-16 01:40

the login is in base64. You can run it through a base64 decoder and you can see it.

this will do it for you if you post that section/line of the log into it

This issue cropped up before if memory serves me correctly and is in the forum somewhere. Can't remember what the resolution was.

Normal user
Normal user
Posts: 31
Joined: 2014-07-17 23:32

Re: Apple Mail SMTP authentication bug [solved] ban issue

Post by bcpaul » 2015-01-16 20:26

lol You talk to Apple people and they say Apple could NOT get it wrong.

Thanks for the tip about the BASE64 encoded string.

What Apple Mail is doing is it attempts to login with the username appended to itself: paul@mydomain.compaul@mydomain.comPASSWORD
Hmail responds with "Authentication Failed" message. It tries again with the paul@mydomain.comPASSWORD and gets authenticated.

This happens every time the user sends an email. This explains why some emails are getting out.
If they attempt to send email 7 times (my auto ban limit) within the hmailserver "minutes before reset" then they get banned.

Why would Apple Mail send username twice??

Yes, I did find this thread from last year -- I hope it is ok to post a quote from it:
Bill48105 wrote:
MiloMali wrote:
Bill48105 wrote: Are you confirming you had that option enabled & disabling solved it or that Apple mail tries even though it's not enabled?
Macs can't login using AUTH LOGIN. You must at least provide AUTH PLAIN. If you do that, the mac client logs in according to the rfc using the format

authzid UTF8NUL authcid UTF8NUL passwd

If this is rejected (and hMailServer rejects it)

the mac tries again with

UTF8NUL authcid UTF8NUL passwd

This latter attempt is accepted by hMailServer. But all rejected attempts are added up so that the login is banned, if the autoban feature is enabled.

I see two solutions:

1. accept the complete PLAIN login. For hMailServer this means to accept the following format:
mailAddress UTF8NUL mailAddress UTF8NUL password
where the two instances of mailAddress should be equal.

2. set the invalid login counter for a certain ip to 0, if a login is successful.
You can't be serious.. I thought AUTH PLAIN was long dead. Is your Mac from the 90's or something? lol Besides that how have we not heard of this before if this was indeed the case (you can't be the one & only person using a mac with hmail. heck I am pretty sure I have mac users) and how is it they could not support AUTH LOGIN like every other email client on the planet?

As much as I like percepts' suggestion you do have the option of using a better email client even. ;)
HERE IS MY SMTP LOG for an Apple Mail typical login: First time fail, second time login
"xx.xx.70.127" "SENT: 220 Welcome to, go ahead."
"SMTPD" 12896 14925 "2015-01-16 07:36:07.651" "x.x.70.127" "RECEIVED: EHLO []"
"SMTPD" 12896 14925 "2015-01-16 07:36:07.651" "x.x.70.127" "SENT:[nl]250-SIZE 100480000[nl]250 AUTH LOGIN PLAIN"
"SMTPD" 2188 14925 "2015-01-16 07:36:09.177" "x.x.70.127" "RECEIVED: AUTH PLAIN username username password="
"SMTPD" 2188 14925 "2015-01-16 07:36:09.181" "x.x.70.127" "SENT: 535 Authentication failed. Restarting authentication process."
"SMTPD" 6688 14925 "2015-01-16 07:36:09.227" "x.x.70.127" "RECEIVED: AUTH PLAIN username password="
"SMTPD" 6688 14925 "2015-01-16 07:36:09.229" "x.x.70.127" "SENT: 235 authenticated."
"SMTPD" 2188 14925 "2015-01-16 07:36:09.265" "x.x.70.127" "RECEIVED: MAIL FROM:<>"
"SMTPD" 2188 14925 "2015-01-16 07:36:09.266" "x.x.70.127" "SENT: 250 OK"
I have "Allow Plain Text Authentication" selected in the SMTP settings selected

Postby Bill48105 » 2014-04-25 17:07
From what this person says turning off AUTH PLAIN option in hmail fixes the problem & apple mail seems to use AUTH LOGIN instead:

SMTP settings DO NOT SELECT "Allow Plain Text Authentication"


Post Reply