Re: [exim] smtp authorization test via telnet?

Pàgina inicial
Delete this message
Reply to this message
Autor: Jakob Hirsch
Data:  
A: meburke
CC: exim-users
Assumptes nous: [exim] filtering question
Assumpte: Re: [exim] smtp authorization test via telnet?
meburke@??? wrote:

> Notice that the string produced by gen-auth is different from the string
> produced by normal base64 encoders:
>
> AGp1Z3NAZ29vZnl3ZXJrcy5jb20AQm9pbmdCMDFuZw==


decodes to:

> $ base64decode AGp1Z3NAZ29vZnl3ZXJrcy5jb20AQm9pbmdCMDFuZw== | hexdump -C
> 00000000  00 6a 75 67 73 40 67 6f  6f 66 79 77 65 72 6b 73  |.jugs@goofywerks|
> 00000010  2e 63 6f 6d 00 42 6f 69  6e 67 42 30 31 6e 67     |.com.BoingB01ng|


> anVnc0Bnb29meXdlcmtzLmNvbSBCb2luZ0IwMW5n


decodes to:

> 00000000  6a 75 67 73 40 67 6f 6f  66 79 77 65 72 6b 73 2e  |jugs@goofywerks.|
> 00000010  63 6f 6d 20 42 6f 69 6e  67 42 30 31 6e 67        |com BoingB01ng|


The first of these is valid for AUTH PLAIN, the second one would be
valid for AUTH LOGIN if the space was replaced by \0.

> Interestingly enough, the string I get back from mimencode works also:
> printf 'user\0jugs@???\0BoingB01ng' |./mimencode
> dXNlcgBqdWdzQGdvb2Z5d2Vya3MuY29tAEJvaW5nQjAxbmc=


for AUTH PLAIN, that'll work, because the usual exim authenticators
don't use the first parameter ("user").

> Is there a trick to generating the Authentication code in other encoders hat
> will work with exim?


I used this perl script for several years:

#!/usr/bin/perl -w

use strict;
use MIME::Base64;

my $unenc = join ("\000", @ARGV);

print "AUTH LOGIN " . encode_base64("$unenc", '') . "\n";
print "AUTH PLAIN " . encode_base64("\000$unenc", '') . "\n";