dovecot-2.1-pigeonhole: lib-sieve-tool: mail_raw: started using ...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Tue Dec 27 12:56:33 EET 2011


details:   http://hg.rename-it.nl/dovecot-2.1-pigeonhole/rev/fc9923837fa0
changeset: 1585:fc9923837fa0
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Tue Dec 27 11:56:25 2011 +0100
description:
lib-sieve-tool: mail_raw: started using mail_temp_dir setting.

diffstat:

 src/lib-sieve-tool/mail-raw.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (51 lines):

diff -r 35639e4925a7 -r fc9923837fa0 src/lib-sieve-tool/mail-raw.c
--- a/src/lib-sieve-tool/mail-raw.c	Tue Dec 20 20:05:21 2011 +0100
+++ b/src/lib-sieve-tool/mail-raw.c	Tue Dec 27 11:56:25 2011 +0100
@@ -56,14 +56,15 @@
  */
 
 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 @@
 	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 @@
 
 	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 @@
 	
 	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);


More information about the dovecot-cvs mailing list