iredmail-doc/html/authenticate.without.domain...

63 lines
3.5 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Authenticate without domain part in email address</title>
<link rel="stylesheet" type="text/css" href="./css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="/index.html" target="_blank">
<img alt="iRedMail web site"
src="./images/logo-iredmail.png"
style="vertical-align: middle; height: 30px;"
/>&nbsp;
<span>iRedMail</span>
</a>
2016-02-29 02:15:19 -06:00
&nbsp;&nbsp;//&nbsp;&nbsp;<a href="./index.html">Document Index</a></div><h1 id="authenticate-without-domain-part-in-email-address">Authenticate without domain part in email address</h1>
<p>With default settings, client must use full email address as username for
POP3/IMAP/SMTP/webmail login, if you want to login without domain name part in
email address, please follow below steps.</p>
<h3 id="dovecot">Dovecot</h3>
<p>Open Dovecot config file <code>/etc/dovecot/dovecot.conf</code> (Linux/OpenBSD) or
<code>/usr/local/etc/dovecot/dovecot.conf</code> (FreeBSD), find parameter
<code>auth_default_realm</code>, set the domain name you want to allow user to login
without domain name part in email address. For example:</p>
<pre><code>auth_default_realm = mydomain.com
</code></pre>
<p>Restarting Dovecot is required. After restarted Dovecot, user logins as
<code>john.smith</code> will be rewritten to <code>john.smith@mydomain.com</code> by Dovecot.
This works for POP3/IMAP/SMTP services.</p>
<h3 id="optional-roundcube-webmail">[OPTIONAL] Roundcube Webmail</h3>
<p>Open Roundcube webmail
<a href="./file.locations.html#roundcube-webmail">config file <code>config/main.inc.php</code></a>,
find parameter <code>$config['username_domain']</code>, list your domain name
in this parameter. For example:</p>
<pre><code>// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' =&gt; 'domain' values to support multiple hosts
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['username_domain'] = 'mydomain.com';
</code></pre>
<p>Restarting web server (Apache or php-fpm) is recommended.</p><div class="footer">
<p style="text-align: center; color: grey;">All documents are available in <a href="https://bitbucket.org/zhb/iredmail-docs/src">BitBucket repository</a>, and published under <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">Creative Commons</a> license. You can <a href="https://bitbucket.org/zhb/iredmail-docs/get/tip.tar.bz2">download the latest version</a> for offline reading. If you found something wrong, please do <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.</p>
</div>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3293801-21', 'auto');
ga('send', 'pageview');
</script>
</body></html>