diff --git a/server/plugins-available/rspamd_plugin.inc.php b/server/plugins-available/rspamd_plugin.inc.php
index cfb0979eb508000c9c7976c83c7845c35a14850e..212cb2c21c79a18be812d9b61e61c4ad9f20a574 100644
--- a/server/plugins-available/rspamd_plugin.inc.php
+++ b/server/plugins-available/rspamd_plugin.inc.php
@@ -68,7 +68,7 @@ class rspamd_plugin {
 			return false; // invalid character
 		} elseif(strpos($domain, '..') !== false) {
 			return false; // two dots not allowed
-		} elseif(!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\", "", $local))) {
+		} elseif($local && !preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\", "", $local))) {
 			// character not valid in local part unless
 			// local part is quoted
 			if(!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\", "", $local))) {