示例#1
0
文件: gsasl.c 项目: cktan/toolchain
static int
logout (void)
{
  if (args_info.imap_flag)
    return imap_logout ();
  if (args_info.smtp_flag)
    return smtp_logout ();

  return 1;
}
示例#2
0
文件: imap.c 项目: 1833183060/wke
/***********************************************************************
 *
 * imap_disconnect()
 *
 * Disconnect from an IMAP server. Cleanup protocol-specific per-connection
 * resources. BLOCKING.
 */
static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection)
{
  struct imap_conn *imapc= &conn->proto.imapc;

  /* The IMAP session may or may not have been allocated/setup at this
     point! */
  if(!dead_connection && imapc->pp.conn)
    (void)imap_logout(conn); /* ignore errors on the LOGOUT */

  Curl_pp_disconnect(&imapc->pp);

  Curl_safefree(imapc->mailbox);

  return CURLE_OK;
}
示例#3
0
/*
 * Logout from the IMAP server and disconnect from the server.
 */
int
request_logout(const char *server, const char *port, const char *user)
{
	int r;
	session *s;

	if (!(s = session_find(server, port, user)))
		return -1;

	r = response_generic(s, imap_logout(s));

	close_connection(s);
	session_destroy(s);

	return r;
}
示例#4
0
文件: curl_imap.c 项目: fquinto/curl
/***********************************************************************
 *
 * imap_disconnect()
 *
 * Disconnect from an IMAP server. Cleanup protocol-specific per-connection
 * resources. BLOCKING.
 */
static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection)
{
  struct imap_conn *imapc= &conn->proto.imapc;

  /* We cannot send quit unconditionally. If this connection is stale or
     bad in any way, sending quit and waiting around here will make the
     disconnect wait in vain and cause more problems than we need to */

  /* The IMAP session may or may not have been allocated/setup at this
     point! */
  if(!dead_connection && imapc->pp.conn)
    (void)imap_logout(conn); /* ignore errors on the LOGOUT */

  /* Disconnect from the server */
  Curl_pp_disconnect(&imapc->pp);

  /* Cleanup our connection based variables */
  Curl_safefree(imapc->mailbox);

  return CURLE_OK;
}
示例#5
0
void try_imap4(void)
{
	char user_account[80];

	imap_connect( "", 0 );	/* connect to default server */
	if (imapi) {		/* connection successful? */
		imap_capability();
		if (get_password_dialog( user_password )) {
		/*	show_status( ErrMsg(EM_LogonValidate) ); */
			strcpy( user_account, prefs.account_name );
			if (user_account[0]=='\0') {
				strcpy( user_account, prefs.email_address );
				strtok( user_account, "@" );
			}
			imap_login( user_account, user_password );
			imap_select( "INBOX" );
			imap_noop();
			imap_logout();
			while (imap_deque_unsolicited( header, (int)sizeof(header) );
		}
	}
}