38 #ifndef _CMIME_MESSAGE_H
39 #define _CMIME_MESSAGE_H
52 #include <sys/types.h>
56 #include <sys/param.h>
70 typedef enum _BoundaryType {
94 typedef enum _CMimeMultipartType {
147 #define cmime_message_get_sender(message) (message->sender)
202 #define cmime_message_get_headers(message) (message->headers)
255 #define cmime_message_get_recipients(message) (message->recipients)
376 #define cmime_message_get_boundary(message) (message->boundary)
437 #define cmime_message_part_count(message) (message->parts->size)
539 #define cmime_message_part_first(message) ((CMimePart_T *)cmime_list_head(message->parts)->data)
545 #define cmime_message_part_last(message) ((CMimePart_T *)cmime_list_tail(message->parts)->data)
void cmime_message_free(CMimeMessage_T *message)
Free a CMimeMessage_T object.
Definition: cmime_message.c:429
void cmime_message_set_mime_version(CMimeMessage_T *message, const char *s)
Set Mime-Version header value. According to RFC 2045, Mime-Version header is required at the top leve...
Definition: cmime_message.c:669
CMimeList_T * recipients
Definition: cmime_message.h:81
int cmime_message_part_remove(CMimeMessage_T *message, CMimePart_T *part)
Remove a mime part from message.
Definition: cmime_message.c:1186
int cmime_message_set_header(CMimeMessage_T *message, const char *header)
Set a header to message object. If header already exists, it will be overwritten. ...
Definition: cmime_message.c:526
int cmime_message_add_recipient(CMimeMessage_T *message, const char *recipient, CMimeAddressType_T t)
Add recipient to message.
Definition: cmime_message.c:560
char * gap
Definition: cmime_message.h:84
char * cmime_message_get_content_type(CMimeMessage_T *message)
Get Content-Type header value.
Definition: cmime_message.c:657
Definition: cmime_message.h:99
Defines functions and structs for mime part handling.
CMimeList_T * parts
Definition: cmime_message.h:85
Definition: cmime_message.h:96
CMimeStringList_T * boundaries
Definition: cmime_message.h:87
char * cmime_message_get_subject(CMimeMessage_T *message)
Get the subject string from CMimeMessage_T object.
Definition: cmime_message.c:1016
void cmime_message_set_content_type(CMimeMessage_T *message, const char *s)
Set Content-Type header.
Definition: cmime_message.c:653
char * linebreak
Definition: cmime_message.h:86
void cmime_message_set_date(CMimeMessage_T *message, const char *s)
Set date string header.
Definition: cmime_message.c:694
int cmime_message_append_part(CMimeMessage_T *message, CMimePart_T *part)
Append mime part to message object and generate boundary if necessary.
Definition: cmime_message.c:1116
char * cmime_message_get_content_id(CMimeMessage_T *message)
Get Content-ID header value.
Definition: cmime_message.c:682
Represents an email address.
Definition: cmime_address.h:57
char * cmime_message_get_content_description(CMimeMessage_T *message)
Get Content-Description header value.
Definition: cmime_message.c:690
int cmime_message_add_child_part(CMimeMessage_T *message, CMimePart_T *part, CMimePart_T *child, CMimeMultipartType_T subtype)
Add a child part to given mimepart, set content type and generate a boundary if necessary.
Definition: cmime_message.c:1215
void cmime_message_append_subject(CMimeMessage_T *message, const char *s)
append string to subject
Definition: cmime_message.c:1031
Definition: cmime_message.h:98
void cmime_message_add_generated_message_id(CMimeMessage_T *message)
Add a newly generated message id to a CMimeMessage_T object.
Definition: cmime_message.c:1068
int cmime_message_to_file(CMimeMessage_T *message, const char *filename)
Write CMimeMessage_T object to file.
Definition: cmime_message.c:837
char * cmime_message_get_content_transfer_encoding(CMimeMessage_T *message)
Get Content-Transfer-Encoding value.
Definition: cmime_message.c:665
CMimeAddressType_T
Possible types of email addresses.
Definition: cmime_address.h:46
void cmime_message_add_generated_boundary(CMimeMessage_T *message)
Add a newly generated boundary to a CMimeMessage_T object.
Definition: cmime_message.c:759
Definition: cmime_message.h:72
int cmime_message_add_recipient_to(CMimeMessage_T *message, const char *recipient)
Add To recipient to message.
Definition: cmime_message.c:623
A mime part.
Definition: cmime_part.h:52
CMimeMessage_T * cmime_message_new(void)
Creates a new CMimeMessage_T object.
Definition: cmime_message.c:398
void cmime_message_set_subject_encode(CMimeMessage_T *message, const char *s)
Set message subject and convert to 7 bit mime encoded string based on RFC 2047.
Definition: cmime_message.c:1004
char * cmime_message_get_mime_version(CMimeMessage_T *message)
Get Mime-Version header value.
Definition: cmime_message.c:674
int cmime_message_set_date_now(CMimeMessage_T *message)
Get current time and set date header.
Definition: cmime_message.c:702
void cmime_message_set_content_transfer_encoding(CMimeMessage_T *message, const char *s)
set Content-Transfer-Encoding value
Definition: cmime_message.c:661
CMimeAddress_T * sender
Definition: cmime_message.h:80
void cmime_message_set_boundary(CMimeMessage_T *message, const char *boundary)
Set message boundary.
Definition: cmime_message.c:718
void cmime_message_set_content_description(CMimeMessage_T *message, const char *s)
Set Content-Description value.
Definition: cmime_message.c:686
CMimeMultipartType_T
Possible multipart mime subtypes.
Definition: cmime_message.h:94
int cmime_message_add_recipient_bcc(CMimeMessage_T *message, const char *recipient)
Add Bcc recipient to message.
Definition: cmime_message.c:643
char * cmime_message_generate_message_id(void)
Generate a message id.
Definition: cmime_message.c:1042
Definition: cmime_message.h:95
CMimeHeader_T * cmime_message_get_header(CMimeMessage_T *message, const char *header)
Get header for given key.
Definition: cmime_message.c:541
Represents an email message.
Definition: cmime_message.h:79
int cmime_message_add_recipient_encode(CMimeMessage_T *message, const char *recipient, CMimeAddressType_T t)
Add recipient to message and convert to 7 bit mime encoded string based on RFC 2047.
Definition: cmime_message.c:597
void cmime_message_set_content_id(CMimeMessage_T *message, const char *s)
Set Content-ID header value.
Definition: cmime_message.c:678
char * cmime_message_get_sender_string(CMimeMessage_T *message)
Get sender of a CMimeMessage_T object as string.
Definition: cmime_message.c:494
void cmime_message_add_attachment(CMimeMessage_T *message, char *attachment)
add attachment to message
Definition: cmime_message.c:1139
void cmime_message_set_sender_encode(CMimeMessage_T *message, const char *sender)
Add sender to CMimeMessage_T object and convert to 7 bit mime encoded string based on RFC 2047...
Definition: cmime_message.c:471
Definition: cmime_message.h:97
CMimeMessage_T * cmime_message_create_skeleton(const char *sender, const char *recipient, const char *subject)
create message skeleton with basic header information
Definition: cmime_message.c:1163
CMimeBoundaryType_T
Possible types of boundaries.
Definition: cmime_message.h:70
char * boundary
Definition: cmime_message.h:83
void cmime_message_set_sender(CMimeMessage_T *message, const char *sender)
Add sender to CMimeMessage_T object. If sender already exists, it will be overwritten.
Definition: cmime_message.c:453
void cmime_message_prepend_subject(CMimeMessage_T *message, const char *s)
prepend string to subject
Definition: cmime_message.c:1020
Double linked list implementation.
Definition: cmime_list.h:55
Defines functions and structs for double linked list.
char * cmime_message_get_date(CMimeMessage_T *message)
Get date string from CMimeMessage_T object.
Definition: cmime_message.c:698
CMimeList_T * headers
Definition: cmime_message.h:82
int cmime_message_from_file(CMimeMessage_T **message, const char *filename, int header_only)
Parse given file and create a CMimeMessage_T object.
Definition: cmime_message.c:769
Defines functions and structs for email address handling.
Defines helper functions and structs for string handling.
char * cmime_message_to_string(CMimeMessage_T *message)
Return a message object as string.
Definition: cmime_message.c:861
Definition: cmime_message.h:71
char * cmime_message_get_message_id(CMimeMessage_T *message)
Get MessageID of message object.
Definition: cmime_message.c:522
Defines utility functions.
void cmime_message_set_subject(CMimeMessage_T *message, const char *s)
Set message subject.
Definition: cmime_message.c:1000
A simple list with strings.
Definition: cmime_string.h:46
char * cmime_message_generate_boundary(void)
Generate a message boundary.
Definition: cmime_message.c:742
void cmime_message_set_message_id(CMimeMessage_T *message, const char *mid)
Set message id to CMimeMessage_T object, if alreay exists, value will be overwritten.
Definition: cmime_message.c:503
int cmime_message_from_string(CMimeMessage_T **message, const char *content, int header_only)
Parse given string and create a new CMimeMessage_T object.
Definition: cmime_message.c:974
int cmime_message_set_body(CMimeMessage_T *message, const char *content)
Set plain body to non multipart message.
Definition: cmime_message.c:1077
int cmime_message_add_recipient_cc(CMimeMessage_T *message, const char *recipient)
Add Cc recipient to message.
Definition: cmime_message.c:633