# Net::IMAP - Support for 'plain' authentication?

**URL:** <https://www.ruby-forum.com/t/net-imap-support-for-plain-authentication/78496>\
**Category:** Ruby\
**Created:** [March 8, 2006, 4:26pm UTC](https://www.ruby-forum.com/t/net-imap-support-for-plain-authentication/78496 "2006-03-08T16:26:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanhussey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@seanhussey](https://www.ruby-forum.com/u/seanhussey)\
**Post date:** [March 8, 2006, 4:26pm UTC](https://www.ruby-forum.com/t/net-imap-support-for-plain-authentication/78496/1 "2006-03-08T16:26:15Z")

</div>

Hi everyone,

Our IMAP server here is configured to support only the PLAIN  
authentication mechanism, but not LOGIN or CRAM\_MD5. Before I  
approach our mail admin about opening up another auth mech, is there  
another library or add-on to Net::IMAP that supports PLAIN?

Thanks,

Sean

---

<div class="post-metadata">

**Author:** ![seanhussey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@seanhussey](https://www.ruby-forum.com/u/seanhussey)\
**Post date:** [March 8, 2006, 4:50pm UTC](https://www.ruby-forum.com/t/net-imap-support-for-plain-authentication/78496/2 "2006-03-08T16:50:34Z")

</div>

On Thu, Mar 09, 2006 at 12:24:44AM +0900, Sean H. wrote:

> Hi everyone,
> 
> Our IMAP server here is configured to support only the PLAIN  
> authentication mechanism, but not LOGIN or CRAM\_MD5. Before I  
> approach our mail admin about opening up another auth mech, is there  
> another library or add-on to Net::IMAP that supports PLAIN?

Take a look at \<[raa.ruby-lang.org/cache/imap-backend/imap-backend.rb](http://raa.ruby-lang.org/cache/imap-backend/imap-backend.rb)\>  
for a PLAIN authenticator.

Steve P.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![seanhussey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@seanhussey](https://www.ruby-forum.com/u/seanhussey)\
**Post date:** [March 8, 2006, 5:08pm UTC](https://www.ruby-forum.com/t/net-imap-support-for-plain-authentication/78496/3 "2006-03-08T17:08:58Z")

</div>

Interesting…I’ll give it a try. Not much documentation, though.

When I requre the file and run my script (no other modifications), I get  
this:

rmail IMAP backend  
Starting…  
…creating IMAP session service…  
…creating watchdog thread…  
…starting DRb server…  
…started on druby://localhost:31382…  
…done.

Until I Ctrl-C and it moves on. After that, I get other IMAP errors I  
can likely deal with. How do I stop DRB from running?

Thank you!

Sean

---

<div class="post-metadata">

**Author:** ![seanhussey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@seanhussey](https://www.ruby-forum.com/u/seanhussey)\
**Post date:** [March 8, 2006, 6:13pm UTC](https://www.ruby-forum.com/t/net-imap-support-for-plain-authentication/78496/4 "2006-03-08T18:13:01Z")

</div>

Sean H. wrote:

> Hi everyone,
> 
> Our IMAP server here is configured to support only the PLAIN  
> authentication mechanism, but not LOGIN or CRAM\_MD5. Before I  
> approach our mail admin about opening up another auth mech, is there  
> another library or add-on to Net::IMAP that supports PLAIN?

Try IMAP#login instead of IMAP#authenticate, this uses a different  
authentication method. It works with my Dovecot server although Dovecot  
doesn’t support LOGIN authentication.

---

<div class="post-metadata">

**Author:** ![seanhussey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@seanhussey](https://www.ruby-forum.com/u/seanhussey)\
**Post date:** [March 10, 2006, 1:29pm UTC](https://www.ruby-forum.com/t/net-imap-support-for-plain-authentication/78496/5 "2006-03-10T13:29:04Z")

</div>

stick with net::imap. less to install and it’s a really lovely  
library (I know MTAs that were harder to use than irb and Net::IMAP).

(no offence to imap-backend)

---

<div class="post-metadata">

**Author:** ![seanhussey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@seanhussey](https://www.ruby-forum.com/u/seanhussey)\
**Post date:** [March 8, 2006, 8:35pm UTC](https://www.ruby-forum.com/t/net-imap-support-for-plain-authentication/78496/6 "2006-03-08T20:35:11Z")

</div>

Oh, wow, it works. That’s amazing.

Does anyone have any thoughts on whether or not this method is better  
than using imap-backend? They both work, but I’m afraid of the  
overhead and uncertainty of a codebase that’s at 0.1 and has no  
homepage or documentation.

Thanks!

Sean
