26 #ifndef _SMF_MESSAGE_H
27 #define _SMF_MESSAGE_H
51 typedef enum _SMFMultipartType {
64 SMFMessage_T *smf_message_new(
void);
71 void smf_message_free(SMFMessage_T *message);
79 void smf_message_set_sender(SMFMessage_T *message,
const char *sender);
95 char *smf_message_get_sender_string(SMFMessage_T *message);
103 void smf_message_set_message_id(SMFMessage_T *message,
const char *message_id);
111 char *smf_message_get_message_id(SMFMessage_T *message);
118 char *smf_message_generate_message_id(
void);
127 int smf_message_set_header(SMFMessage_T *message,
const char *header);
140 int smf_message_update_header(SMFMessage_T *message,
const char *header,
const char *value);
153 int smf_message_add_header(SMFMessage_T *message,
const char *header,
const char *value);
162 SMFHeader_T *smf_message_get_header(SMFMessage_T *message,
const char *header);
170 SMFList_T *smf_message_get_headers(SMFMessage_T *message);
179 int smf_message_remove_header(SMFMessage_T *message,
const char *header_name);
189 int smf_message_add_recipient(SMFMessage_T *message,
const char *recipient,
SMFEmailAddressType_T t);
197 SMFList_T *smf_message_get_recipients(SMFMessage_T *message);
205 void smf_message_set_content_type(SMFMessage_T *message,
const char *s);
213 char *smf_message_get_content_type(SMFMessage_T *message);
221 void smf_message_set_content_transfer_encoding(SMFMessage_T *message,
const char *s);
229 char *smf_message_get_content_transfer_encoding(SMFMessage_T *message);
237 void smf_message_set_content_id(SMFMessage_T *message,
const char *s);
245 char *smf_message_get_content_id(SMFMessage_T *message);
257 void smf_message_set_mime_version(SMFMessage_T *message,
const char *s);
265 char *smf_message_get_mime_version(SMFMessage_T *message);
273 void smf_message_set_date(SMFMessage_T *message,
const char *s);
281 char *smf_message_get_date(SMFMessage_T *message);
289 int smf_message_set_date_now(SMFMessage_T *message);
297 void smf_message_set_boundary(SMFMessage_T *message,
const char *boundary);
305 char *smf_message_get_boundary(SMFMessage_T *message);
312 char *smf_message_generate_boundary(
void);
319 void smf_message_add_generated_boundary(SMFMessage_T *message);
327 void smf_message_set_subject(SMFMessage_T *message,
const char *s);
335 char *smf_message_get_subject(SMFMessage_T *message);
346 int smf_message_from_file(SMFMessage_T **message,
const char *filename,
int header_only);
355 int smf_message_to_file(SMFMessage_T *message,
const char *filename);
364 int smf_message_to_fd(SMFMessage_T *message,
int fd);
372 char *smf_message_to_string(SMFMessage_T *message);
383 int smf_message_from_string(SMFMessage_T **message,
const char *content,
int header_only);
391 void smf_message_prepend_subject(SMFMessage_T *message,
const char *s);
399 void smf_message_append_subject(SMFMessage_T *message,
const char *s);
408 int smf_message_set_body(SMFMessage_T *message,
const char *content);
417 int smf_message_append_part(SMFMessage_T *message,
SMFPart_T *part);
425 int smf_message_get_part_count(SMFMessage_T *message);
433 void smf_message_add_attachment(SMFMessage_T *message,
char *attachment);
443 SMFMessage_T *smf_message_create_skeleton(
const char *sender,
const char *recipient,
const char *subject);
462 SMFPart_T *smf_message_part_first(SMFMessage_T *message);
470 SMFPart_T *smf_message_part_last(SMFMessage_T *message);
482 int smf_message_write_skip_header(FILE *src, FILE *dest);