fat: Greatly simplify and clean up dosfs_get_file_map().
[haiku.git] / src / preferences / mail / AutoConfig.h
blobce16b51d9bbcb80457365fbe1c841f3d9ce07b4d
1 /*
2 * Copyright 2007-2011, Haiku, Inc. All rights reserved.
3 * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
4 * Distributed under the terms of the MIT License.
5 */
6 #ifndef AUTO_CONFIG_H
7 #define AUTO_CONFIG_H
10 #include <List.h>
11 #include <Node.h>
12 #include <String.h>
14 #define INFO_DIR "Mail/ProviderInfo"
16 #define ATTR_NAME_POPSERVER "POP Server"
17 #define ATTR_NAME_IMAPSERVER "IMAP Server"
18 #define ATTR_NAME_SMTPSERVER "SMTP Server"
19 #define ATTR_NAME_AUTHPOP "POP Authentication"
20 #define ATTR_NAME_AUTHSMTP "SMTP Authentication"
21 #define ATTR_NAME_POPSSL "POP SSL"
22 #define ATTR_NAME_IMAPSSL "IMAP SSL"
23 #define ATTR_NAME_SMTPSSL "SMTP SSL"
24 #define ATTR_NAME_USERNAME "Username Pattern"
28 ATTR_NAME_AUTHPOP:
29 0 plain text
30 1 APOP
32 ATTR_NAME_AUTHSMTP:
33 0 none
34 1 ESMTP
35 2 POP3 before SMTP
37 ATTR_NAME_USERNAME:
38 0 username is the email address (default)
39 1 username is the local-part of the email address local-part@domain.net
40 2 no username is proposed
45 struct provider_info
47 BString provider;
49 BString pop_server;
50 BString imap_server;
51 BString smtp_server;
53 int32 authentification_pop;
54 int32 authentification_smtp;
56 int32 ssl_pop;
57 int32 ssl_imap;
58 int32 ssl_smtp;
60 int32 username_pattern;
64 class AutoConfig
66 public:
67 status_t GetInfoFromMailAddress(const char* email,
68 provider_info *info);
70 // for debug
71 void PrintProviderInfo(provider_info* pInfo);
73 private:
74 status_t GetMXRecord(const char* provider, provider_info *info);
75 status_t GuessServerName(const char* provider,
76 provider_info *info);
78 BString ExtractProvider(const char* email);
79 status_t LoadProviderInfo(const BString &provider, provider_info* info);
80 bool ReadProviderInfo(BNode *node, provider_info* info);
86 #endif