def cmd(self, cmd, verbose=False):
        """Executes the specified command on the remote host.

        The cmd must be format safe, this means { and } must be doubled, thusly:

          echo /var/local/maildir/{{cur,new}}

        the cmd can include the format word 'maildir' to be replaced
        by self.directory. eg:

          echo {maildir}/{{cur,new}}
        """
        command = cmd.format(maildir=self.directory)
        if verbose:
            print(command)
        p = Popen([
                "ssh",
                "-T",
                self.host,
                command
                ], stdin=PIPE, stdout=PIPE, stderr=PIPE)
        stdout,stderr = p.communicate()
        return stdout
Executes the specified command on the remote host.

        The cmd must be format safe, this means { and } must be doubled, thusly:

          echo /var/local/maildir/{{cur,new}}

        the cmd can include the format word 'maildir' to be replaced
        by self.directory. eg:

          echo {maildir}/{{cur,new}}