search for: o_stream_create_fd_file

Displaying 3 results from an estimated 3 matches for "o_stream_create_fd_file".

2011 Oct 31
1
Rewrite the ostream output method, to save messages in another directory.
..., that i try to create to another location, without sucessfull. struct ostream * o_stream_create_X_list(struct ostream *output, struct istream *input, const char *type) { struct emexis_ostream *X_stream; struct ostream *new_output; int fd; fd = open("/tmp/email",O_WRONLY); new_output = o_stream_create_fd_file(fd, 0, TRUE); o_stream_cork(new_output); emexis_stream = i_new(struct emexis_ostream, 1); emexis_stream->ostream.sendv = o_stream_X_sendv; emexis_stream->ostream.flush = o_stream_X_flush; emexis_stream->ostream.iostream.close = o_stream_X_close; emexis_stream->output = new_output; emex...
2007 Oct 08
1
API problem (noob)
...like to copy a mail message from the mail store out to a temporary file, less a few headers: static const char *const exclude_headers[] = { "X-DSPAM-Signature" } strcpy(fname, mktemp(fname)); fd = creat(fname, 0600); mail_get_stream(mail, NULL, NULL, &input); output = o_stream_create_fd_file(fd, 0, TRUE); input = i_stream_create_header_filter(input, HEADER_FILTER_EXCLUDE | HEADER_FILTER_NO_CR, exclude_headers, N_ELEMENTS(exclude_headers), null_header_filter_callback, NULL); o_stream_send_istream(output, input); But all I get in the temp file is the message...
2010 Apr 09
4
Patch: support URLAUTH, BURL, CATENATE
...ep + 1), + p_strdup_until(pool, line, sep)); + } + i_stream_destroy(&is); + + return keys; +} + +// write the access keys to the file +static bool urlauth_keys_write(int fd, struct hash_table *keys) +{ + struct ostream *os; + struct hash_iterate_context *iter; + void *key, *value; + + os = o_stream_create_fd_file(fd, 0, FALSE); + if (os == NULL) + return NULL; + + o_stream_send_str(os, URLAUTH_KEYS_FILENAME" version 1\n"); + iter = hash_table_iterate_init(keys); + while (hash_table_iterate(iter, &key, &value)) { + /* key is the mailbox, value is the access key */ + o_stream_send_str(os,...