2 * Copyright 2009, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
17 #define B_MAIL_ATTR_NAME "MAIL:name" // indexed string
18 #define B_MAIL_ATTR_STATUS "MAIL:status" // indexed string
19 #define B_MAIL_ATTR_PRIORITY "MAIL:priority" // indexed string
20 #define B_MAIL_ATTR_TO "MAIL:to" // indexed string
21 #define B_MAIL_ATTR_CC "MAIL:cc" // indexed string
22 #define B_MAIL_ATTR_BCC "MAIL:bcc" // string
23 #define B_MAIL_ATTR_FROM "MAIL:from" // indexed string
24 #define B_MAIL_ATTR_SUBJECT "MAIL:subject" // indexed string
25 #define B_MAIL_ATTR_REPLY "MAIL:reply" // indexed string
26 #define B_MAIL_ATTR_WHEN "MAIL:when" // indexed time
27 #define B_MAIL_ATTR_FLAGS "MAIL:flags" // indexed int32
28 #define B_MAIL_ATTR_RECIPIENTS "MAIL:recipients" // string
29 #define B_MAIL_ATTR_MIME "MAIL:mime" // string
30 #define B_MAIL_ATTR_HEADER "MAIL:header_length" // int32
31 #define B_MAIL_ATTR_CONTENT "MAIL:content_length" // int32
32 #define B_MAIL_ATTR_READ "MAIL:read" // int32
33 #define B_MAIL_ATTR_THREAD "MAIL:thread" // string
34 #define B_MAIL_ATTR_ACCOUNT "MAIL:account" // string
35 #define B_MAIL_ATTR_ACCOUNT_ID "MAIL:account_id" // int32
49 B_MAIL_PENDING
= 1, // waiting to be sent
51 B_MAIL_SENT
= 2, // has been sent
53 B_MAIL_SAVE
= 4 // save mail after
57 #define B_MAIL_TYPE "text/x-email" // mime type
58 #define B_PARTIAL_MAIL_TYPE "text/x-partial-email" // mime type
61 // WARNING: Everything past this point is deprecated. See MailMessage.h,
62 // mail_encoding.h and MailDaemon.h for alternatives.
65 // #pragma mark - defines
68 #define B_CHECK_NEVER 0
69 #define B_CHECK_WEEKDAYS 1
70 #define B_CHECK_DAILY 2
71 #define B_CHECK_CONTINUOUSLY 3
72 #define B_CHECK_CONTINUOSLY 3
75 #define B_MAX_USER_NAME_LENGTH 32
76 #define B_MAX_HOST_NAME_LENGTH 64
78 // rfc822 header field types
79 #define B_MAIL_TO "To: "
80 #define B_MAIL_CC "Cc: "
81 #define B_MAIL_BCC "Bcc: "
82 #define B_MAIL_FROM "From: "
83 #define B_MAIL_DATE "Date: "
84 #define B_MAIL_REPLY "Reply-To: "
85 #define B_MAIL_SUBJECT "Subject: "
86 #define B_MAIL_PRIORITY "Priority: "
89 // #pragma mark - structs
93 char pop_name
[B_MAX_USER_NAME_LENGTH
];
94 char pop_password
[B_MAX_USER_NAME_LENGTH
];
95 char pop_host
[B_MAX_HOST_NAME_LENGTH
];
98 int32 days
; /* see flags above*/
99 int32 interval
; /* in seconds*/
100 int32 begin_time
; /* in seconds*/
101 int32 end_time
; /* in seconds*/
110 // #pragma mark - global functions
112 int32
count_pop_accounts(void);
113 status_t
get_pop_account(mail_pop_account
*, int32 index
= 0);
114 status_t
set_pop_account(mail_pop_account
*, int32 index
= 0,
118 // #pragma mark - BMailMessage
125 status_t
AddContent(const char* text
, int32 length
,
126 uint32 encoding
= B_ISO1_CONVERSION
,
127 bool clobber
= false);
128 status_t
AddContent(const char* text
, int32 length
,
129 const char* encoding
,
130 bool clobber
= false);
132 status_t
AddEnclosure(entry_ref
* ref
,
133 bool clobber
= false);
134 status_t
AddEnclosure(const char* path
,
135 bool clobber
= false);
136 status_t
AddEnclosure(const char* MIME_type
, void* data
,
137 int32 len
, bool clobber
= false);
139 status_t
AddHeaderField(uint32 encoding
,
140 const char* field_name
, const char* str
,
141 bool clobber
= false);
142 status_t
AddHeaderField(const char* field_name
,
143 const char* str
, bool clobber
= false);
145 status_t
Send(bool sendNow
= false,
146 bool removeAfterSending
= false);
149 int32
concatinate(char**, int32
, char*);
150 int32
count_fields(char* name
= NULL
);
151 status_t
find_field(char*, type_code
*, char**, void**,
152 int32
*, uint32
*, char**, bool*, int32
);
153 BList
* find_field(const char*);
154 status_t
get_field_name(char**, int32
);
155 status_t
set_field(const char*, type_code
, const char*,
156 const void*, int32
, uint32
, const char*,