0

I installed Postfix & Dovecot on Debian.

Then I tried using SMTP authentication according to this guide:

http://www.postfix.org/SASL_README.html

Unfortunately the following test tails:

telnet localhost 25
auth plain <base64 encoded usernaem/password>

We get a "535 5.78 Error: authentication failed:"

in var/log/mail.warn we habe a new line which is: "warning: localhost[127.0.0.1]: SASL PLAIN authentication failed:"

unfortunately it does not say what is wrong. Any ideas?

1 Answer 1

1

It's really stupid. But here is the reason what went wrong:

we generated the base 64 string according to the documentation:

echo -ne '\000username\000password' | openssl base64

unfortunately our password started with a number. After changing the password to start with a character it worked fine!

1
  • The reason this happened is that echo "\0ddd" means interpret as octal value "ddd" (per manpage), so it must interpret "\0dd" as "\00dd", so that if the username or password starts with a character it interprets "\000" as "\0000", but if it starts with a number, say your password is 7computer, it reads "\0007computer" as octal-007 followed by computer. In short, by switching "\000" to "\0000" you should be able to have the password start with a number. Alternatively you can use hex (\x00)
    – David Reed
    May 5, 2023 at 8:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .