Skip to content
Snippets Groups Projects
Commit 6b3cd6de authored by Stephan Bosch's avatar Stephan Bosch
Browse files

lib-sieve-tool: mail_raw: started using mail_temp_dir setting.

parent c527430b
No related branches found
No related tags found
No related merge requests found
......@@ -56,14 +56,15 @@ struct mail_raw_user {
*/
static int seekable_fd_callback
(const char **path_r, void *context ATTR_UNUSED)
(const char **path_r, void *context)
{
struct mail_user *ruser = (struct mail_user *)context;
const char *dir, *p;
string_t *path;
int fd;
path = t_str_new(128);
str_append(path, "/tmp/dovecot.sieve-tool.");
path = t_str_new(128);
mail_user_set_get_temp_prefix(path, ruser->set);
fd = safe_mkstemp(path, 0600, (uid_t)-1, (gid_t)-1);
if (fd == -1 && errno == ENOENT) {
dir = str_c(path);
......@@ -95,8 +96,8 @@ static int seekable_fd_callback
return fd;
}
static struct istream *create_raw_stream
(int fd, time_t *mtime_r, const char **sender)
static struct istream *mail_raw_create_stream
(struct mail_user *ruser, int fd, time_t *mtime_r, const char **sender)
{
struct istream *input, *input2, *input_list[2];
const unsigned char *data;
......@@ -143,7 +144,7 @@ static struct istream *create_raw_stream
input_list[0] = input2; input_list[1] = NULL;
input = i_stream_create_seekable(input_list, MAIL_MAX_MEMORY_BUFFER,
seekable_fd_callback, NULL);
seekable_fd_callback, (void*)ruser);
i_stream_unref(&input2);
return input;
}
......@@ -227,7 +228,7 @@ struct mail_raw *mail_raw_open_file
if ( path == NULL || strcmp(path, "-") == 0 ) {
path = NULL;
input = create_raw_stream(0, &mtime, &sender);
input = mail_raw_create_stream(ruser, 0, &mtime, &sender);
}
mailr = mail_raw_create(ruser, input, path, sender, mtime);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.