How to modify "Mail information" button?

Created:

2017-07-26 09:28:12 UTC

Modified:

2017-08-16 15:53:28 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to modify "Mail information" button?

Applicable to:

  • Plesk for Linux

Question

How to modify/customize the information shown in "Mail information" pop-up help icon in Domains > example.com > Email Addresses ?

1.jpg

Answer

1.  Connect to the server using SSH.

2. Create backup of configuration file:

# cp /usr/local/psa/admin/application/smb/views/scripts/email-address/_configuration.phtml /usr/local/psa/admin/application/smb/views/scripts/email-address/_configuration.phtml.orig

3. Change 54 line from:

new Ajax.Request(Jsw.prepareUrl('/email-address/configuration/id/' + Smb.Views.Emails.selectedEmailId), {

to:

new Ajax.Request('/email-configuration.php?email-id=' + Smb.Views.Emails.selectedEmailId, {

4. Create php page in /usr/local/psa/admin/htdocs/ directory:

# vi /usr/local/psa/admin/htdocs/email-configuration.php

5. Add the desired content, below is an example on how to make users to connect using server hostname:

PLESK_INFO: <?php
require_once('sdk.php');
if (empty($_GET['email-id'])) {
die("No email-id specified");
}
$emailId = $_GET['email-id'];

$db = pm_Bootstrap::getDbAdapter();
$select = $db->select()
->from('mail')
->join('domains', 'domains.id = mail.dom_id')
->where('mail.id = ?', $emailId);
$email = $db->fetchRow($select);

$hostname = gethostname();

$params = [
"Mail server username" => "{$email['mail_name']}@{$email['displayName']}",
"Incoming mail server" => "mail.{$hostname}",
"Outgoing mail server" => "mail.{$hostname}",
"Supported incoming mail protocols" => "POP3, IMAP",
"Supported outgoing mail protocols" => "SMTP",
];

foreach ($params as $title => $value) {
echo $title . ": " . htmlspecialchars($value) . "<br/>\n";
}

6. If it is required to modify a link for "View instructions on configuring MS Outlook, Outlook Express, Apple Mail, and Thunderbird", do the following:

6.1 Open /usr/local/psa/admin/application/smb/views/scripts/email-address/_configuration.phtml file for editing:

# vi /usr/local/psa/admin/application/smb/views/scripts/email-address/_configuration.phtml

6.2 Replace the following default line:

 '<p><a href="' + Jsw.baseUrl + '/help/redirect/controller-name/email-address/action-name/configuration" target="_blank">' +

with:

 '<p><a href="http://link.here">' +

This way a link will be changed to a custom one:
Untitled.png

Have more questions? Submit a request
Please sign in to leave a comment.