account.h 1.8 KB
Newer Older
1
/*
2
 * Copyright (C) 2000-2007,2012 Brendan Cully <brendan@kublai.com>
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 * 
 *     This program is free software; you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation; either version 2 of the License, or
 *     (at your option) any later version.
 * 
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 * 
 *     You should have received a copy of the GNU General Public License
 *     along with this program; if not, write to the Free Software
 *     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */ 
18 19 20

/* remote host account manipulation (POP/IMAP) */

21 22
#ifndef _MUTT_ACCOUNT_H_
#define _MUTT_ACCOUNT_H_ 1
23

24
#include "url.h"
25 26 27 28

/* account types */
enum
{
29 30 31
  MUTT_ACCT_TYPE_NONE = 0,
  MUTT_ACCT_TYPE_IMAP,
  MUTT_ACCT_TYPE_POP,
32
  MUTT_ACCT_TYPE_SMTP
33 34 35
};

/* account flags */
36 37 38 39 40
#define MUTT_ACCT_PORT  (1<<0)
#define MUTT_ACCT_USER  (1<<1)
#define MUTT_ACCT_LOGIN (1<<2)
#define MUTT_ACCT_PASS  (1<<3)
#define MUTT_ACCT_SSL   (1<<4)
41

42
typedef struct
43
{
44 45
  char user[128];
  char login[128];
46
  char pass[256];
47 48 49 50
  char host[128];
  unsigned short port;
  unsigned char type;
  unsigned char flags;
51
} ACCOUNT;
52

53 54 55 56 57 58 59
int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* m2);
int mutt_account_fromurl (ACCOUNT* account, ciss_url_t* url);
void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url);
int mutt_account_getuser (ACCOUNT* account);
int mutt_account_getlogin (ACCOUNT* account);
int mutt_account_getpass (ACCOUNT* account);
void mutt_account_unsetpass (ACCOUNT* account);
60

61
#endif /* _MUTT_ACCOUNT_H_ */