2011-11-14 15:57:52 +01:00
|
|
|
/*
|
|
|
|
* parser.h, SJ
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PARSER_H
|
|
|
|
#define _PARSER_H
|
|
|
|
|
|
|
|
#include "cfg.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "defs.h"
|
|
|
|
|
2017-08-08 15:34:45 +02:00
|
|
|
struct parser_state parse_message(struct session_data *sdata, int take_into_pieces, struct data *data, struct config *cfg);
|
2020-12-13 08:36:12 +01:00
|
|
|
void post_parse(struct session_data *sdata, struct parser_state *state, struct config *cfg);
|
2018-10-17 09:26:07 +02:00
|
|
|
int parse_line(char *buf, struct parser_state *state, struct session_data *sdata, int take_into_pieces, char *writebuffer, unsigned int writebuffersize, char *abuffer, unsigned int abuffersize, struct data *data, struct config *cfg);
|
2011-11-14 15:57:52 +01:00
|
|
|
|
2015-11-21 23:06:47 +01:00
|
|
|
void init_state(struct parser_state *state);
|
2016-04-05 21:10:09 +02:00
|
|
|
time_t parse_date_header(char *s);
|
2015-11-21 23:06:47 +01:00
|
|
|
int extract_boundary(char *p, struct parser_state *state);
|
2014-02-11 15:34:12 +01:00
|
|
|
void fixupEncodedHeaderLine(char *buf, int buflen);
|
2015-11-21 23:06:47 +01:00
|
|
|
void fixupSoftBreakInQuotedPritableLine(char *buf, struct parser_state *state);
|
|
|
|
void fixupBase64EncodedLine(char *buf, struct parser_state *state);
|
|
|
|
void markHTML(char *buf, struct parser_state *state);
|
2021-12-09 11:27:51 +01:00
|
|
|
void setStateHTML(char *htmlbuf, int pos, struct parser_state *state);
|
2015-11-21 23:06:47 +01:00
|
|
|
void translateLine(unsigned char *p, struct parser_state *state);
|
2011-12-05 17:18:03 +01:00
|
|
|
void fix_email_address_for_sphinx(char *s);
|
2012-02-07 17:21:23 +01:00
|
|
|
void split_email_address(char *s);
|
2012-01-09 23:15:39 +01:00
|
|
|
int does_it_seem_like_an_email_address(char *email);
|
2019-01-13 14:40:01 +01:00
|
|
|
void add_recipient(char *email, unsigned int len, struct session_data *sdata, struct parser_state *state, struct data *data, struct config *cfg);
|
2011-11-14 15:57:52 +01:00
|
|
|
void reassembleToken(char *p);
|
|
|
|
void degenerateToken(unsigned char *p);
|
2015-11-27 12:17:19 +01:00
|
|
|
void fixURL(char *buf, int buflen);
|
2018-02-04 10:50:42 +01:00
|
|
|
void extractNameFromHeaderLine(char *s, char *name, char *resultbuf, int resultbuflen);
|
2011-12-30 15:52:59 +01:00
|
|
|
char *determine_attachment_type(char *filename, char *type);
|
2012-09-09 23:16:09 +02:00
|
|
|
char *get_attachment_extractor_by_filename(char *filename);
|
2015-11-21 23:06:47 +01:00
|
|
|
void parse_reference(struct parser_state *state, char *s);
|
2016-04-05 21:10:09 +02:00
|
|
|
int base64_decode_attachment_buffer(char *p, unsigned char *b, int blen);
|
2017-03-05 21:16:18 +01:00
|
|
|
void fix_plus_sign_in_email_address(char *puf, char **at_sign, unsigned int *len);
|
2020-02-16 10:15:11 +01:00
|
|
|
void tokenize(char *buf, struct parser_state *state, struct session_data *sdata, struct data *data, struct config *cfg);
|
2020-03-14 07:43:19 +01:00
|
|
|
void flush_attachment_buffer(struct parser_state *state, char *abuffer, unsigned int abuffersize);
|
|
|
|
void fill_attachment_name_buf(struct parser_state *state, char *buf);
|
2020-12-13 07:50:03 +01:00
|
|
|
int get_first_email_address_from_string(char *str, char *buf, int buflen);
|
2011-11-14 15:57:52 +01:00
|
|
|
|
|
|
|
#endif /* _PARSER_H */
|