<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" /> <title> File: README — Documentation by YARD 0.8.7.4 </title> <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" /> <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> hasFrames = window.top.frames.main ? true : false; relpath = ''; framesUrl = "frames.html#!file.README.html"; </script> <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script> <script type="text/javascript" charset="utf-8" src="js/app.js"></script> </head> <body> <div id="header"> <div id="menu"> <a href="_index.html">Index</a> » <span class="title">File: README</span> <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> </div> <div id="search"> <a class="full_list_link" id="class_list_link" href="class_list.html"> Class List </a> <a class="full_list_link" id="method_list_link" href="method_list.html"> Method List </a> <a class="full_list_link" id="file_list_link" href="file_list.html"> File List </a> </div> <div class="clear"></div> </div> <iframe id="search_frame"></iframe> <div id="content"><div id='filecontents'><h1>Mail Autoconfig</h1> <p>A ruby gem to detect and parse any Thunderbird autoconfig file for a domain. Includes a copy of the Mozilla ISPDB.</p> <p>For general information about autoconf visit (<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration">https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration</a>), for the autoconfig schema you should have a look at (<a href="https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat">https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat</a>).</p> <p>Although I've tried to keep parsing as accurate as possible, there may be omissions or errors. Please feel free to submit a patch in these cases.</p> <h2>Installation</h2> <p>Add this line to your application's Gemfile:</p> <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>mail_autoconfig</span><span class='tstring_end'>'</span></span> </code></pre> <p>And then execute:</p> <pre class="code ruby"><code class="ruby">$ bundle </code></pre> <p>Or install it yourself as:</p> <pre class="code ruby"><code class="ruby">$ gem install mail_autoconfig </code></pre> <h2>Usage</h2> <p>Generally, you just want to get any associated configuration for an email address. In this case we'll use '<a href="mailto:example@gmail.com">example@gmail.com</a>'.</p> <pre class="code ruby"><code class="ruby">client_config = MailAutoconfig::for_address('example@gmail.com') client_config.short_name => "GMail" outbound_server = client_config.outgoing_servers.first outbound_server.protocol => "smtp" outnound_server.hostname => "smtp.googlemail.com" </code></pre> <p>When searching for a configuration, autoconfig first looks to it's local database for the domain of the address, if this fails it will check <code>http://autoconfig.#{domain}/mail/config-v1.1.xml</code> and then <code>http://#{domain}/.well-known/autoconfig/mail/config-v1.1.xml</code>. If both of these fail, Autoconfig will then look up the MX records for the address, and perform the same searches on the domain of the primary MX record.</p> <h3>Updating the database</h3> <p>You may wish to update the database at some point to fetch the latest from Mozilla's ISPDB, just run the rake task <code>rake fetch_ispdb</code>.</p> <h2>Contributing</h2> <ol> <li>Fork it ( <a href="http://github.com/atech/mail_autoconfig/fork">http://github.com/atech/mail_autoconfig/fork</a> )</li> <li>Create your feature branch (<code>git checkout -b my-new-feature</code>)</li> <li>Run the test suite, check out haven't broken anything (<code>bundle exec rspec spec</code>)</li> <li>Commit your changes (<code>git commit -am 'Add some feature'</code>)</li> <li>Push to the branch (<code>git push origin my-new-feature</code>)</li> <li>Create new Pull Request</li> </ol> </div></div> <div id="footer"> Generated on Tue Apr 22 22:04:36 2014 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.8.7.4 (ruby-1.9.3). </div> </body> </html>