How to create webmail login web page?

fredcwk

Registered
Jul 30, 2009
4
0
51
I have search in this forum, other forums and also googled the same question but found no answer. I hope cpanel support staff can reply or suggest a solution.

Email created in cpanel can be access via Webmail. However the login access is via a pop up window after you type in the url, "http://www.domain-name.com/webmail/".

Is there anyway to actually create a simple login form displayed on a web page to allow user to login to the webmail and not through the pop up window? :confused:

A simple two fields, user/email address and password, on a static web page will be more user friendly rather than an URL link that cause a pop up window.:(
 

logicsupport

Well-Known Member
Jun 5, 2007
138
0
166
From WHM >> Server Configuration >> Tweak Settings >>

Disable Http Authentication for cPanel/WebMail/WHM Logins (forces cookie authentication)

'Tick' the above option .

It will Skip HTTP Authentication and pop-up window will not appear .
 

fredcwk

Registered
Jul 30, 2009
4
0
51
Still looking for login screen form/script

I managed to get the hosting guy to disable the pop up but the log in screen is the standard screen.

I wanted to do a webpage with a form to allow user to login to check their email and not going to the standard webmail log in page. My hosting guy don't know scripting. Anyone out there knows? :confused:
 

bribur

Registered
May 29, 2010
3
1
51
Here's a login page script that worked for us

The following script put a simple webmail login box on our webpage for our users. You just have to change the server info in the first line to your server info and it should work for you. Here it is:

<div id="content-wrap"><form action="https://ns5.ourchurch.com:2096/login/" method="post"> <input name="login_theme" type="hidden" value="cpanel" />
<table class="login" style="width: 200px;" border="0" cellspacing="0" cellpadding="0">
<tbody style="text-align: left;">
<tr style="text-align: left;">
<td style="text-align: left;"><strong>Login</strong></td>
<td style="text-align: left;">&nbsp;</td>
</tr>
<tr style="text-align: left;">
<td class="login_lines" style="text-align: left;">Email:</td>
<td class="login_lines" style="text-align: left;"><input id="user" name="user" size="16" type="text" tabindex="1" /></td>
</tr>
<tr class="row2" style="text-align: left;">
<td class="login_lines" style="text-align: left;">Password:</td>
<td class="login_lines" style="text-align: left;"><input id="pass" name="pass" size="16" type="password" tabindex="2" /></td>
</tr>
<tr style="text-align: left;">
<td style="text-align: left;" colspan="2"><input id="login" class="input-button" type="submit" value="Login" tabindex="3" /></td>
</tr>
</tbody>
</table>
<input name="goto_uri" type="hidden" value="/?login_theme=cpanel" /> </form> <br /> <br />
<script type="text/javascript"><!--
/* Must not include external javascript -jnk 06.20.09 */
var init = function() {
document.getElementById("user").value = '';
document.getElementById("pass").value = '';
document.getElementById("user").focus();
};
if( window.addEventListener ) {
window.addEventListener('load',init,false);
} else if( document.addEventListener ) {
document.addEventListener('load',init,false);
}
// --></script>
</div>
 
  • Like
Reactions: ordonezgs

fredcwk

Registered
Jul 30, 2009
4
0
51
tested and it works

Thanks for your suggestion. The script works.

The only thing is that I have to include the domain name for my email address. example: [email protected]

I can't just type 'fred' without the '@domain.com'. I believe its due the reason I used shared hosting where I have multiple domain name hosted in the same principal hosting account.

If my email is 'fred' at the 'principaldomainname.com' then I don't need to type the full domain name but if I host a second domain name (example: seconddomainname.com) to the hosting, then I will need to input as '[email protected]' to access my email.

Do you have a solution to above problem of including the '@domain.com' with the email address?

Anyway thanks a lot!

Fred:)
 

Spiral

BANNED
Jun 24, 2005
2,020
8
193
Outside of installing your own webmail with mods to detect the domain from the hostname used to connect, then the answer would be no ---

Squirrelmail has a plugin to allow you login using only the base "user" at the login but what it really does is detects the web address domain used to connect to the webmail login page and appends it to the user name that you use to login if you fail to include an "@" in your login name.

Just some technicals ---

Cpanel based systems (as well as most others for that matter) require that you always use the full email address as the username for connecting to mail.

If you were to login with just the "user" only then the email account you would actually access is at the main server hostname instead of your web hosting account's domain name.

In example --

domain.com is you domain and host.server.com is your server's hostname

If you login with just "fred" alone then the email you connect to is actually "[email protected]" instead of "[email protected]" --- OOPS!
 

minasedhom

Registered
Aug 21, 2010
1
0
51
no cetifcate

thank you for this code , it works . but we have aproplem of certficate as in firefox ask for it and in internet explorer wchihc means that it will prevent my ppl from using it as they don't know how to read this risk or how to add exciptions , so plz give me acertfication code , no matter what is it , i just wanna to disappear any msg that could slow down my ppl , Thanks alot this code helped me so much .
 

nielcleo

Registered
Mar 14, 2011
1
0
51
the code is not working with me its too long to load and always saying the connection was interrupt
can you explain it detailed? thanks
 
Last edited:

Onama

Registered
Jul 4, 2020
2
0
1
Uganda
cPanel Access Level
Root Administrator
Here's a login page script that worked for us

The following script put a simple webmail login box on our webpage for our users. You just have to change the server info in the first line to your server info and it should work for you. Here it is:

<div id="content-wrap"><form action="https://ns5.ourchurch.com:2096/login/" method="post"> <input name="login_theme" type="hidden" value="cpanel" />
<table class="login" style="width: 200px;" border="0" cellspacing="0" cellpadding="0">
<tbody style="text-align: left;">
<tr style="text-align: left;">
<td style="text-align: left;"><strong>Login</strong></td>
<td style="text-align: left;">&nbsp;</td>
</tr>
<tr style="text-align: left;">
<td class="login_lines" style="text-align: left;">Email:</td>
<td class="login_lines" style="text-align: left;"><input id="user" name="user" size="16" type="text" tabindex="1" /></td>
</tr>
<tr class="row2" style="text-align: left;">
<td class="login_lines" style="text-align: left;">Password:</td>
<td class="login_lines" style="text-align: left;"><input id="pass" name="pass" size="16" type="password" tabindex="2" /></td>
</tr>
<tr style="text-align: left;">
<td style="text-align: left;" colspan="2"><input id="login" class="input-button" type="submit" value="Login" tabindex="3" /></td>
</tr>
</tbody>
</table>
<input name="goto_uri" type="hidden" value="/?login_theme=cpanel" /> </form> <br /> <br />
<script type="text/javascript"><!--
/* Must not include external javascript -jnk 06.20.09 */
var init = function() {
document.getElementById("user").value = '';
document.getElementById("pass").value = '';
document.getElementById("user").focus();
};
if( window.addEventListener ) {
window.addEventListener('load',init,false);
} else if( document.addEventListener ) {
document.addEventListener('load',init,false);
}
// --></script>
</div>
It failed for me .I couldn't login after embeding the codes.maybe the script shdnt be in HTML file
 

ordonezgs

Registered
Oct 6, 2020
1
0
0
Colombia
cPanel Access Level
Website Owner
This still works, confirmed.

Can you elaborate how to manage the logout or even a wrong password please?

Did you use .htaccess or something?

or rather do you use a proxy through your login page to proxy webmail page?
 
Last edited: