72 lines
3.7 KiB
HTML
72 lines
3.7 KiB
HTML
<!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;"
|
|
/>
|
|
<span>iRedMail</span>
|
|
</a>
|
|
// <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>
|
|
<div class="toc">
|
|
<ul>
|
|
<li><a href="#authenticate-without-domain-part-in-email-address">Authenticate without domain part in email address</a><ul>
|
|
<li><a href="#dovecot">Dovecot</a></li>
|
|
<li><a href="#roundcube-webmail">Roundcube Webmail</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<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>
|
|
<h2 id="dovecot">Dovecot</h2>
|
|
<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>
|
|
<h2 id="roundcube-webmail">Roundcube Webmail</h2>
|
|
<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' => '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> |