The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

smtp auth plain

Discussion in 'E-mail Discussions' started by prasad, Jul 16, 2007.

  1. prasad

    prasad Member

    Joined:
    Jan 24, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    Hi,

    How do we test auth plain from command line. I know how to test auth login from command line, but testing auth plain is giving the following error.

    ---
    535 Incorrect authentication data
    ---

    After, connecting on port 25, and ehlo command, I issue auth plain base64data. The base64data is actually the base 64 encoded string for \0user@domain.com\0password, but that is not working ... :(

    Any help is appreciated.

    Thanks,
    Prasad.
     
  2. prasad

    prasad Member

    Joined:
    Jan 24, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    Can anybody help on it ?
     
  3. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    It's pretty difficult to test from the command line; you'd have to compute some fairly complex hashes. What I do is to use a simple client to test.
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I have in my notes that the syntax is:

    EHLO ...
    AUTH PLAIN
    <base64data>
    MAIL FROM: ...


    Where <base64data> is the base64 incarnation of:

    \0youremail@domain.com\0password

    Another words, I have AUTH PLAIN as a single command to the SMTP server. The next string sent to the server (on a new line) is the base64 username and password. But I'm not sure if that is a requirement or not.
     
  5. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    testing smtp auth via command line for cpanel machines

    Use gen-auth to generate - http://www.jetmore.org/john/code/#gen-auth

    When you run it, type in plain for the auth type

    My guess is that the reason why the normal methods you may be using to convert it to base64 aren't working is possibly because those methods might have a problem handling the @ sign for the login. I'd be willing to bet if you trying to SMTP auth against a server that only requires a username (and not a full email address) for the login, any method you've been using thus far would probably work.

    At any rate, using gen-auth with plain specified as the auth type will allow you to get a base64-encoded auth that actually works in your test.

    mike
     
  6. prasad

    prasad Member

    Joined:
    Jan 24, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    Thank you for the response. When I give the username and password as a base64 encoded string, the following error is shown.

    ---
    535 Incorrect authentication data
    ---

    So it is not recognizing the username and password properly

    If I am trying to input the data in normal form, I am getting the following error.

    ---
    501 Invalid base64 data
    ---

    The auth login is working well, I am not able to test the auth plan :(
     
  7. prasad

    prasad Member

    Joined:
    Jan 24, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    Hi Mike,

    Thanks for the solution :)

    You are right, I was using the URL http://www.thoughtfactory.co.za/b64.php to encode the strings. Using that encoding, I was able to test the auth login, but the plain was failing.

    Using gen-auth, I was able to test auth plain successfully :)
     
Loading...

Share This Page