Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUTH LOGIN returns unicode 334 answer #24

Open
reikjarloekl opened this issue Mar 27, 2015 · 2 comments
Open

AUTH LOGIN returns unicode 334 answer #24

reikjarloekl opened this issue Mar 27, 2015 · 2 comments

Comments

@reikjarloekl
Copy link

With Python 2.7.3, I am getting the strange effect, that the answer to AUTH LOGIN apparently is transmitted as a unicode string which clients do not understand.

This is a tcpflow snippet demonstrating this:

046.163.077.142.01025-176.083.128.183.54917: 250-AUTH LOGIN PLAIN
250 EHLO
176.083.128.183.54917-046.163.077.142.01025: AUTH LOGIN
....163.077.142.01025-176.083.128.183.54917: 3...3...4... ...V...X...N...l...c...m...5...h...b...W...U...=...

Dots are zeros in tcpflow-speak.

If I change encode_b64 as follows (i.e., remove the final 'decode' statement), it works like a charm:

def encode_b64(data):
    '''Wrapper for b64encode, without having to struggle with bytestrings.'''
    byte_string = data.encode('utf-8')
    encoded = base64.b64encode(byte_string)
    return encoded
@thestick613
Copy link

Can you please post the full smtp transaction? Also, if you are trying to build a bigger system, you might want to try python-slimta.

@st2000
Copy link

st2000 commented Oct 13, 2019

Years later I see this same problem. However, running the server using python3 instead of python solved it. I only saw this problem when AUTH LOGIN is used. The test client in the examples directory uses AUTH PLAIN. And the server running under python works fine with AUTH PLAIN. Perhaps that is why it is difficult to reproduce the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants