How can I remove the "Administrator Email Address" from the Pi-hole web interface?

How can I remove the "Administrator Email Address" from the Pi-hole web interface? I put in my email to test it but I don't want my email there.

Suggestion: add a "Remove Administrator Email Address" button for people to remove the email from the web interface. Because when I make it empty it goes back to what it previously was and not empty.

You are right: UI will rewrite the email address it already knows rather than deleting it.

Completely remove the line starting with ADMIN_EMAIL from setupVars.conf:

sudo nano /etc/pihole/setupVars.conf

I just found out that pihole -a email also works, it removes the email. But I would like a button on the web interface though as that would be convenient.

Hi there,

I have also noticed this behaviour.

This is due to this lines:
https://github.com/pi-hole/AdminLTE/blob/release/v5.0/scripts/pi-hole/php/savesettings.php#L555-L567

I am wondering why $adminemail gets set to noadminemail if no address is entered, especially because the exec command not gets fired due to the if...elseif...else instructions.

I think the lines above should look something like following to allow saving an empty address (this would be the easiest way to fix this :wink:):

$adminemail = trim($_POST["adminemail"]);
if(strlen($adminemail) == 0 || !isset($adminemail))
{
	$adminemail = '';
}
if(strlen($adminemail) > 0 && !validEmail($adminemail))
{
$error .= "Administrator email address (".htmlspecialchars($adminemail).") is invalid!<br>";
}
else
{
exec('sudo pihole -a -e \''.$adminemail.'\'');
}
3 Likes

Ok, I am hoping the code gets fixed in the next release.

I have also made a GitHub issue regarding this: [Suggestion + Fix] Add an option to remove the administrator email (by leaving the input box blank) in the web interface. · Issue #1188 · pi-hole/web · GitHub

1 Like

https://github.com/pi-hole/AdminLTE/pull/1190

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.