This file is indexed.

/usr/include/mimetic/message.h is in libmimetic-dev 0.9.8-6.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/***************************************************************************
    copyright            : (C) 2002-2008 by Stefano Barbato
    email                : stefano@codesink.org

    $Id: message.h,v 1.13 2008-10-07 11:06:25 tat Exp $
 ***************************************************************************/
#ifndef _MIMETIC_MESSAGE_H_
#define _MIMETIC_MESSAGE_H_
#include <time.h>
#include <sys/types.h>
#include <mimetic/libconfig.h>
#include <mimetic/mimeentity.h>
#include <mimetic/utils.h>
#include <mimetic/codec/codec.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

namespace mimetic
{

class ContentType;

/// Base class for text/* MIME entities.
struct TextEntity: public MimeEntity
{
    /**
     *  Sets its content-type to "text/unknown"
     */
    TextEntity();
    TextEntity(const std::string& text);
    /**
     *  Sets its content-type to "text/unknown",
     *  sets its body with the "text" variable and adds
     *  "charset=us-ascii" content-type parameter
     */
    TextEntity(const std::string& text, const std::string& charset);
};

/// text/plain entity class
/*!
    TextPlain is a MimeEntity that defaults its ContentType to "text/plain" 
    and its charset to "us-ascii".
 */
struct TextPlain: public TextEntity
{
    TextPlain(const std::string& text);
    /**
     * constructs a TextPlain object, assigns <i>text</i> to its body and adds
     * a ContentType::Param("charset", <i>charset</i>) to ContentType parameter list
     */
    TextPlain(const std::string& text, const std::string& charset);
};


/// text/enriched entity class
struct TextEnriched: public TextEntity
{
    TextEnriched(const std::string& text);
    /**
     * constructs a TextPlain object, assigns <i>text</i> to its body and adds
     * a ContentType::Param("charset", <i>charset</i>) to ContentType parameter list
     */
    TextEnriched(const std::string& text, const std::string& charset);
};

/// Base multipart/* class
/**
   Base multipart/ * class. Its constructor sets the content-type
   to "multipart/unknown" and adds and fills a "boundary" parameter
 */
struct MultipartEntity: public MimeEntity
{
    MultipartEntity();
};

/// multipart/mixed entity class
struct MultipartMixed: public MultipartEntity
{
    MultipartMixed();
};

/// multipart/parallel entity class
struct MultipartParallel: public MultipartEntity
{
    MultipartParallel();
};

/// multipart/alternative entity class
struct MultipartAlternative: public MultipartEntity
{
    MultipartAlternative();
};

/// multipart/digest entity class
struct MultipartDigest: public MultipartEntity
{
    MultipartDigest();
};


/// application/octet-stream entity class
struct ApplicationOctStream: public MimeEntity
{
    ApplicationOctStream();
    template<typename Codec>
    ApplicationOctStream(const std::string&, const Codec& c=Base64::Encoder());
    std::string type() const;
    void type(const std::string&);
    uint padding() const;
    void padding(unsigned int);
    bool operator()() const { return isValid(); }
    bool isValid() const { return m_status; }
protected:
    std::string m_fqn;
    bool m_status;
};

/// Helper class to embed file attachments
struct Attachment: public MimeEntity
{
    /**
     * defaults to application/octet-stream
     */
    Attachment(const std::string&);
    Attachment(const std::string&, const ContentType&);
    template<typename Codec>
    Attachment(const std::string&, const Codec& c );
    template<typename Codec>
    Attachment(const std::string&, const ContentType&, const Codec& c);
    bool operator()() const { return isValid(); }
    bool isValid() const { return m_status; }
private:
    template<typename Codec>
    void set(const std::string&, const ContentType&, const Codec& c);
    std::string m_fqn;
    bool m_status;
};

/// image/jpeg attachment
struct ImageJpeg: public Attachment
{
    ImageJpeg(const std::string& fqn)
    : Attachment(fqn, ContentType("image","jpeg"))
    {
    }
    template<typename Codec>
    ImageJpeg(const std::string& fqn, const Codec& c)
    : Attachment(fqn, ContentType("image","jpeg"), c)
    {
    }
};

/// audio/basic attachment
struct AudioBasic: public Attachment
{
    AudioBasic(const std::string& fqn)
    : Attachment(fqn, ContentType("audio","basic"))
    {
    }
    template<typename Codec>
    AudioBasic(const std::string& fqn, const Codec& c)
    : Attachment(fqn, ContentType("audio","basic"), c)
    {
    }
};



/// message/rfc822 entity type
struct MessageRfc822: public MimeEntity
{
    MessageRfc822(const MimeEntity&);
protected:
    std::ostream& write(std::ostream&,const char*) const;
private:
    const MimeEntity& m_me;
};



/**
 * defaults to application/octet-stream
 */
template<typename Codec>
Attachment::Attachment(const std::string& fqn, const Codec& codec)
{
    set(fqn, ContentType("application","octet-stream"), codec);
}

template<typename Codec>
Attachment::Attachment(const std::string& fqn, const ContentType& ctype, const Codec& codec)
{
    set(fqn, ctype, codec);
}

template<typename Codec>
void Attachment::set(const std::string& fqn, const ContentType& ctype, const Codec& codec)
{
    Header& h = header();
    m_fqn = fqn;
    m_status = false;
    std::string filename = utils::extractFilename(m_fqn);
    // Content-Type
    h.contentType(ctype);
    h.contentType().paramList().push_back(ContentType::Param("name", filename));
    
    // Content-Transfer-Encoding
    h.contentTransferEncoding().mechanism(codec.name());

    // Content-Disposition
    h.contentDisposition().type("attachment");
    h.contentDisposition().paramList().push_back(ContentDisposition::Param("filename", filename));
    
    m_status = body().load(m_fqn, codec);
}

    
template<typename Codec>
ApplicationOctStream::ApplicationOctStream(const std::string& fqn, const Codec& codec)
{
    Header& h = header();
    m_fqn = fqn;
    m_status = false;
    std::string filename = utils::extractFilename(m_fqn);
    // Content-Type
    h.contentType(ContentType("application", "octet-stream"));
    h.contentType().paramList().push_back(ContentType::Param("name", filename));
    
    // Content-Transfer-Encoding
    h.contentTransferEncoding().mechanism(codec.name());

    // Content-Disposition
    h.contentDisposition().type("attachment");
    h.contentDisposition().paramList().push_back(ContentDisposition::Param("filename", filename));
    
    m_status = body().load(m_fqn, codec);
}

}


#endif