aboutsummaryrefslogblamecommitdiffstats
path: root/camel/camel-mime-message.h
blob: 47c390a5a5ad8c9672b966e2179625c832bae469 (plain) (tree)
1
2
3
4
5
6
7
                                                                                             
  
                                                       
  
                                                                   






                                                                     
                                                                
















                                                                      
                                  
                                   
                                         
                                            
 

                                      
 
                                                                    

                                                                                                                  
 
                                       
 
                        
 
                                    
 
                           
                                                
 

                                                        
 
                      
                         
                                       
                                                                          
  
                
                                        
 
                                
 


                        
                             
                                                                         

                    






                                                                                                            

                                                                                                             














                                                                                                             
 
                                                                                                            
                                                                                                         
                                                                                                             
                                                                   
                       



                                                                                                             
 



                                 
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
/* camelMimeMessage.h : class for a mime message
 *
 * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
 *      Michael Zucchi <notzed@helixcode.com>
 *
 * Copyright 1999, 2000 Helix Code, Inc. (http://www.helixcode.com)
 *
 * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */


#ifndef CAMEL_MIME_MESSAGE_H
#define CAMEL_MIME_MESSAGE_H 1


#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus }*/

#include <camel/camel-mime-part.h>
#include <camel/camel-mime-utils.h>
#include <camel/camel-internet-address.h>
#include <camel/camel-mime-filter-bestenc.h>

#define CAMEL_RECIPIENT_TYPE_TO "To"
#define CAMEL_RECIPIENT_TYPE_CC "Cc"
#define CAMEL_RECIPIENT_TYPE_BCC "Bcc"


#define CAMEL_MIME_MESSAGE_TYPE     (camel_mime_message_get_type ())
#define CAMEL_MIME_MESSAGE(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_MIME_MESSAGE_TYPE, CamelMimeMessage))
#define CAMEL_MIME_MESSAGE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MIME_MESSAGE_TYPE, CamelMimeMessageClass))
#define CAMEL_IS_MIME_MESSAGE(o)    (CAMEL_CHECK_TYPE((o), CAMEL_MIME_MESSAGE_TYPE))


/* specify local time */
#define CAMEL_MESSAGE_DATE_CURRENT (~0)

struct _CamelMimeMessage
{
    CamelMimePart parent_object;

    /* header fields */
    time_t date;
    int date_offset;    /* GMT offset */

    /* cached internal copy */
    time_t date_received;
    int date_received_offset;   /* GMT offset */

    char *subject;

    char *message_id;

    CamelInternetAddress *reply_to;
    CamelInternetAddress *from;

    GHashTable *recipients; /* hash table of CamelInternetAddress's */
};

typedef struct {
    CamelMimePartClass parent_class;

    /* Virtual methods */   

} CamelMimeMessageClass;



/* Standard Camel function */
CamelType                   camel_mime_message_get_type           (void);


/* public methods */
CamelMimeMessage           *camel_mime_message_new                (void);
void                        camel_mime_message_set_date           (CamelMimeMessage           *mime_message,
                                   time_t                      date,
                                   int                         offset);
time_t                      camel_mime_message_get_date           (CamelMimeMessage           *mime_message,
                                   int                        *offset);
time_t                      camel_mime_message_get_date_received  (CamelMimeMessage           *mime_message,
                                   int                        *offset);
void                        camel_mime_message_set_message_id     (CamelMimeMessage           *mime_message,
                                   const char                 *message_id);
const char                 *camel_mime_message_get_message_id     (CamelMimeMessage           *mime_message);
void                        camel_mime_message_set_reply_to       (CamelMimeMessage           *mime_message,
                                   const CamelInternetAddress *reply_to);
const CamelInternetAddress *camel_mime_message_get_reply_to       (CamelMimeMessage           *mime_message);

void                        camel_mime_message_set_subject        (CamelMimeMessage           *mime_message,
                                   const char                 *subject);
const char                 *camel_mime_message_get_subject        (CamelMimeMessage           *mime_message);
void                        camel_mime_message_set_from           (CamelMimeMessage           *mime_message,
                                   const CamelInternetAddress *from);
const CamelInternetAddress *camel_mime_message_get_from           (CamelMimeMessage           *mime_message);

const CamelInternetAddress *camel_mime_message_get_recipients     (CamelMimeMessage           *mime_message,
                                   const char                 *type);
void                        camel_mime_message_set_recipients     (CamelMimeMessage           *mime_message,
                                   const char                 *type,
                                   const CamelInternetAddress *r);

void                        camel_mime_message_set_source         (CamelMimeMessage           *mime_message,
                                   const char                 *identity);
const char                 *camel_mime_message_get_source         (CamelMimeMessage           *mime_message);
                                   

/* utility functions */
gboolean                    camel_mime_message_has_8bit_parts     (CamelMimeMessage           *mime_message);
void                        camel_mime_message_set_best_encoding  (CamelMimeMessage           *msg,
                                   CamelBestencRequired        required,
                                   CamelBestencEncoding        enctype);
void                        camel_mime_message_encode_8bit_parts  (CamelMimeMessage           *mime_message);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* CAMEL_MIME_MESSAGE_H */
ix CVE-2019-5885swills2019-01-153-6/+17 * Upgrade to v0.2.9.thierry2019-01-132-9/+9 * This port requires USES=compiler:c++11-lang to build on GCC-basedlinimon2019-01-131-2/+2 * Disable flavors for Python ports without PYTHON_PKGNAMEPREFIX/SUFFIX.mat2019-01-111-1/+1 * Update KDE Applications to 18.12.1tcberner2019-01-1115-45/+45 * - fix BUILD_DEPENDSdinoex2019-01-091-1/+3 * net-im/py-slixmpp: Add missing RUN_DEPENDS and fix some other issues0mp2019-01-083-9/+13 * Do not set SHEBANG_FILES twicetobik2019-01-081-1/+0 * Do not set CONFLICTS{,_INSTALL} twicetobik2019-01-081-2/+0 * Do not set WRKSRC{,_SUBDIR} twicetobik2019-01-081-1/+0 * net-im/mikutter: Update to 3.8.4meta2019-01-072-5/+5 * - update to 1.9.0 snapshotdinoex2019-01-0715-831/+816 * net-im/ekiga: Remove unneeded perl5 dependencyswills2019-01-061-2/+2 * Remove stale IGNORE_WITH_PHP=56 values.rene2019-01-051-1/+0 * Allow overriding rust dependencyjbeich2019-01-041-1/+1 * Update to 2.2.9sunpoet2019-01-022-6/+7 * Cleanup net-im after KDE4 removal.adridg2019-01-024-28/+10 * net-im/libqtelegram-ae: Fix build with OpenSSL 1.1xswills2019-01-012-1/+329 * net-im/telegram-desktop: Update to 1.5.4swills2019-01-0135-191/+163 * Remove KDE4, part 5rene2019-01-0168-3457/+0 * net-im/ekiga: remove optional dependency on expired KDE4rene2018-12-312-27/+3 * Remove expired ports:rene2018-12-314-32/+0 * This port requires USES=compiler:c11 to build on GCC-basedlinimon2018-12-301-1/+1 * - Update to 18.12.1ashish2018-12-286-21/+31 * New port: net-im/py-slimxmpp: Threadless Poezio-oriented fork of SleekXMPP us...0mp2018-12-284-0/+39 * net-im/py-matrix-synapse: update to 0.34.0swills2018-12-273-16/+10 * net-im/purple-discord: update to new snapshotswills2018-12-273-5/+7 * Fix up various kde ports to build on GCC-based architecturestcberner2018-12-261-1/+2 * Change cmake default behaviour to outsource.tcberner2018-12-2620-20/+20 * net/pidgin-icyque: strip libicyque.so unless built WITH_DEBUGeugen2018-12-251-0/+3 * net/pidgin-icyque: style fixeseugen2018-12-251-3/+2 * New port: net-im/pidgin--icyqueeugen2018-12-244-0/+39 * New ports required for gitlab-ce upgrade to 11.6.mfechner2018-12-234-0/+28 * net-im/kopete-kde4: remove optional dependency on expired multimedia/xmmsrene2018-12-211-8/+1 * Remove expired ports:rene2018-12-219-153/+0 * Fix build on GCC architectures.lx2018-12-201-2/+1 * net-im/qTox: Add USES=gnomeyuri2018-12-191-1/+1 * net-im/telegram-desktop: Change SED -> REINPLACE_CMDyuri2018-12-191-2/+2 * Set c++11 on some more kde@ ports.tcberner2018-12-177-7/+9 * Use regular DEPRECATED and EXPIRATION_DATE variables in an "if FLAVOR" blockrene2018-12-171-3/+2 * net-im/ssh-chat: Add pkg-message with the security warningyuri2018-12-151-0/+10 * New port: net-im/ssh-chat: Chat over SSHyuri2018-12-154-0/+56 * Update KDE Applications to 18.12.0tcberner2018-12-1438-100/+45 * - Update to 18.12ashish2018-12-123-40/+49 * net-im/py-slackclient: Update to 1.3.0 [1]koobs2018-12-122-5/+7 * Bump PORTREVISION for ports depending on the canonical version of GCCgerald2018-12-1225-16/+25 * devel/boost-*: update to 1.69.0jbeich2018-12-127-7/+7 * Set c++11 on some more kde@ ports.tcberner2018-12-082-2/+2 * - Add LICENSEamdmi32018-12-071-0/+2 * lang/rust: update to 1.31.0jbeich2018-12-071-1/+1 * Remove version 7.0 from the IGNORE_WITH_PHP list.rene2018-12-061-1/+1 * - Add LICENSEamdmi32018-12-062-3/+5 * - Fix LICENSEamdmi32018-12-051-2/+3 * - Update to 0.33.9miwi2018-12-044-36/+319 * Update devel/protobuf to 3.6.1sunpoet2018-12-041-1/+1 * Update to 2.7.8sunpoet2018-12-041-1/+1 * net-im/mikutter: Update to 3.8.3meta2018-12-033-22/+15 * Fix LIB_DEPENDSantoine2018-12-031-2/+2 * Deprecate ports depending on php 5.6antoine2018-12-031-0/+3 * Mark QT4 ports/functionality for removal on 2019-03-15rene2018-12-0212-8/+42 * - Add LICENSEamdmi32018-12-022-1/+4 * - Add LICENSEamdmi32018-11-282-1/+4 * pyqt: Change install directories for Python flavor supporttcberner2018-11-231-1/+1 * net-im/fractal: unbreak with OpenSSL 1.1.1jbeich2018-11-211-0/+1096 * - Add LICENSEamdmi32018-11-212-1/+4 * - Add LICENSEamdmi32018-11-182-1/+5 * net-im/telegram-desktop:makc2018-11-111-1/+2 * Update ImageMagick to 6.9.10.14 [1]kwm2018-11-111-2/+2 * Install texinfo files (GNU info) into ${PREFIX}/share/infobapt2018-11-11