Skip to content

Commit dbed4e5

Browse files
authored
Merge pull request #12 from josaphatim/added-renamed-script-command
Added support for rename script command and has mechanism method
2 parents 601cb7d + 79c0a7a commit dbed4e5

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/ManageSieve/Client.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,16 @@ public function getSASLMechanisms() {
357357
}
358358
}
359359

360+
/**
361+
* Return true if server support the mechanism
362+
*
363+
* @return bool
364+
*/
365+
public function hasSASLMechanism($mech)
366+
{
367+
return in_array($mech, $this->getSASLMechanisms());
368+
}
369+
360370
/**
361371
* Authenticate to server
362372
*
@@ -717,4 +727,21 @@ public function noop()
717727
}
718728
return false;
719729
}
730+
731+
/**
732+
* Rename a user's Sieve script
733+
*
734+
* @param string $oldName The old Script name
735+
* @param string $newName The new Script name
736+
*
737+
* @return boolean
738+
*/
739+
public function renameScript($oldName, $newName)
740+
{
741+
$return_payload = $this->sendCommand("RENAMESCRIPT", ['"'.$oldName.'"', '"'.$newName.'"',]);
742+
if ($return_payload["code"] == "OK") {
743+
return true;
744+
}
745+
return false;
746+
}
720747
}

0 commit comments

Comments
 (0)