|
Lines 72-74
Link Here
|
| 72 |
The DONT_BLAME_SENDMAIL option GroupReadableSASL[DB]File is needed when you |
72 |
The DONT_BLAME_SENDMAIL option GroupReadableSASL[DB]File is needed when you |
| 73 |
are using cyrus-imapd and sendmail on the same server that requires access |
73 |
are using cyrus-imapd and sendmail on the same server that requires access |
| 74 |
to the sasldb database. |
74 |
to the sasldb database. |
|
|
75 |
|
| 76 |
---- |
| 77 |
|
| 78 |
To test Authentication with the sendmail server: |
| 79 |
|
| 80 |
You'll need to install the following PERL ports: |
| 81 |
converters/p5-MIME-Base64 |
| 82 |
security/p5-Digest-MD5 |
| 83 |
security/p5-Digest-HMAC |
| 84 |
|
| 85 |
Then use one of the following procedures to test: |
| 86 |
|
| 87 |
A. PLAIN Mech: |
| 88 |
1. Create your Base64 encoded username/password. |
| 89 |
|
| 90 |
#perl -MMIME::Base64 -e 'print encode_base64("username\0username\0password");' |
| 91 |
dXNlcm5hbWUAdXNlcm5hbWUAcGFzc3dvcmQ= |
| 92 |
|
| 93 |
2. telnet to port 25 of your sendmail server |
| 94 |
|
| 95 |
3. send "EHLO <client.host.name>" |
| 96 |
a. check for "250-AUTH *" in the response |
| 97 |
b. check that the PLAIN mech is listed. |
| 98 |
|
| 99 |
4. Send "AUTH PLAIN <Base64 username/password>" |
| 100 |
|
| 101 |
AUTH PLAIN dXNlcm5hbWUAdXNlcm5hbWUAcGFzc3dvcmQ= |
| 102 |
|
| 103 |
you should now see the following response from the server: |
| 104 |
|
| 105 |
235 Authentication successful |
| 106 |
|
| 107 |
5. Type "QUIT" to close the telnet session to sendmail. |
| 108 |
|
| 109 |
B. LOGIN Mech: |
| 110 |
1. Create your Base64 encoded username and password. |
| 111 |
|
| 112 |
#perl -MMIME::Base64 -e 'print encode_base64("username");' |
| 113 |
dXNlcm5hbWU= |
| 114 |
#perl -MMIME::Base64 -e 'print encode_base64("password");' |
| 115 |
cGFzc3dvcmQ= |
| 116 |
|
| 117 |
2. telnet to port 25 of your sendmail server |
| 118 |
|
| 119 |
3. send "EHLO <client.host.name>" |
| 120 |
a. check for "250-AUTH *" in the response |
| 121 |
b. check that the LOGIN mech is listed. |
| 122 |
|
| 123 |
4. Send "AUTH LOGIN", then the base64 encoded username and passwords. |
| 124 |
|
| 125 |
C: AUTH LOGIN |
| 126 |
S: 334 VXNlcm5hbWU6 (base64 encoded "Username:") |
| 127 |
C: dXNlcm5hbWU= |
| 128 |
S: 334 UGFzc3dvcmQ6 (base64 encode "Password:") |
| 129 |
C: cGFzc3dvcmQ= |
| 130 |
S: 235 2.0.0 OK Authenticated |
| 131 |
|
| 132 |
5. Type "QUIT" to close the telnet session to sendmail. |
| 133 |
|
| 134 |
C. DIGEST-MD5 Mech: |
| 135 |
|
| 136 |
1. telnet to port 25 of your sendmail server |
| 137 |
|
| 138 |
2. send "EHLO <client.host.name>" |
| 139 |
a. check for "250-AUTH *" in the response |
| 140 |
b. check that the DIGEST-MD5 mech is listed. |
| 141 |
|
| 142 |
3. Send "AUTH DIGEST-MD5" |
| 143 |
|
| 144 |
C: AUTH DIGEST-MD5 |
| 145 |
S: 334 ? |
| 146 |
|
| 147 |
4. Calculate the DIGEST-MD5 response (use another telnet, ssh, or X Window) |
| 148 |
|
| 149 |
? |
| 150 |
|
| 151 |
5. Send the DIGEST-MD5 response to the server. |
| 152 |
|
| 153 |
C: ? |
| 154 |
S: 235 2.0.0 OK Authenticated |
| 155 |
|
| 156 |
6. Type "QUIT" to close the telnet session to sendmail. |
| 157 |
|
| 158 |
D. CRAM-MD5 Mech: |
| 159 |
|
| 160 |
1. telnet to port 25 of your sendmail server |
| 161 |
|
| 162 |
2. send "EHLO <client.host.name>" |
| 163 |
a. check for "250-AUTH *" in the response |
| 164 |
b. check that the CRAM-MD5 mech is listed. |
| 165 |
|
| 166 |
3. Send "AUTH CRAM-MD5" |
| 167 |
|
| 168 |
C: AUTH CRAM-MD5 |
| 169 |
S: 334 PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ+ |
| 170 |
(base64 encoded timestamp and hostname) |
| 171 |
|
| 172 |
4. Calculate the CRAM-MD5 response (use another telnet, ssh, or X Window) |
| 173 |
|
| 174 |
perl '-MDigest::HMAC_MD5 qw(hmac_md5 hmac_md5_hex)' -MMIME::Base64 \ |
| 175 |
-e 'print encode_base64("username " . hmac_md5_hex(decode_base64("<ticket>"),"password"));' |
| 176 |
|
| 177 |
The "<ticket>" is the response received from the server in step 3. |
| 178 |
|
| 179 |
(i.e. PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ+) |
| 180 |
|
| 181 |
Using the above ticket our CRAM-MD5 response is: |
| 182 |
|
| 183 |
dXNlcm5hbWUgMDZkMGEzMjVmMDU0NjQ4NjQ2ZTA3MmNkNGZlYjE3YzQ= |
| 184 |
|
| 185 |
5. Send the CRAM-MD5 response to the server. |
| 186 |
|
| 187 |
C: dXNlcm5hbWUgMDZkMGEzMjVmMDU0NjQ4NjQ2ZTA3MmNkNGZlYjE3YzQ= |
| 188 |
S: 235 2.0.0 OK Authenticated |
| 189 |
|
| 190 |
6. Type "QUIT" to close the telnet session to sendmail. |