Exemple #1
0
int
_pop_user (mu_authority_t auth)
{
  mu_folder_t folder = mu_authority_get_owner (auth);
  mu_mailbox_t mbox = folder->data;
  struct _pop3_mailbox *mpd = mbox->data;
  int status;
  
  status = pop_get_user (auth);
  if (status)
    return status;
  status = mu_pop3_user (mpd->pop3, mpd->user);
  if (status == 0)
    {
      /* Fetch the secret from them.  */
      status = pop_get_passwd (auth);
      if (status == 0) 
	{
	  status = mu_pop3_pass (mpd->pop3, mu_secret_password (mpd->secret));
	  mu_secret_password_unref (mpd->secret);
	  mu_secret_unref (mpd->secret);
	  mpd->secret = NULL;
	}
    }
  free (mpd->user);
  mpd->user = NULL;
  return status;
}
Exemple #2
0
static PyObject *
api_secret_password (PyObject *self, PyObject *args)
{
  const char *pass;
  PySecret *py_secret;

  if (!PyArg_ParseTuple (args, "O!", &PySecretType, &py_secret))
    return NULL;

  pass = mu_secret_password (py_secret->secret);
  return _ro (PyString_FromString (pass ? pass : ""));
}