git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Logging: disable the verbose DKIM verification line by default; add a tag to <= lines.
[exim.git]
/
src
/
src
/
dkim_transport.c
diff --git
a/src/src/dkim_transport.c
b/src/src/dkim_transport.c
index 85a73dcaeb872c20b7c45ffbecf8a7bb6d36fbd2..f707595cb8449ab9cdaf611ffc13cbb53ad87705 100644
(file)
--- a/
src/src/dkim_transport.c
+++ b/
src/src/dkim_transport.c
@@
-2,7
+2,7
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 201
6
*/
+/* Copyright (c) University of Cambridge 1995 - 201
7
*/
/* See the file NOTICE for conditions of use and distribution. */
/* Transport shim for dkim signing */
/* See the file NOTICE for conditions of use and distribution. */
/* Transport shim for dkim signing */
@@
-37,9
+37,17
@@
return TRUE;
/* Send the file at in_fd down the output fd */
static BOOL
/* Send the file at in_fd down the output fd */
static BOOL
-dkt_send_file(int out_fd, int in_fd, off_t off, size_t size)
+dkt_send_file(int out_fd, int in_fd, off_t off
+#ifdef OS_SENDFILE
+ , size_t size
+#endif
+ )
{
{
+#ifdef OS_SENDFILE
DEBUG(D_transport) debug_printf("send file fd=%d size=%u\n", out_fd, (unsigned)(size - off));
DEBUG(D_transport) debug_printf("send file fd=%d size=%u\n", out_fd, (unsigned)(size - off));
+#else
+DEBUG(D_transport) debug_printf("send file fd=%d\n", out_fd);
+#endif
/*XXX should implement timeout, like transport_write_block_fd() ? */
/*XXX should implement timeout, like transport_write_block_fd() ? */
@@
-118,7
+126,7
@@
int save_fd = tctx->u.fd;
int save_options = tctx->options;
BOOL save_wireformat = spool_file_wireformat;
uschar * hdrs;
int save_options = tctx->options;
BOOL save_wireformat = spool_file_wireformat;
uschar * hdrs;
-
blob
* dkim_signature;
+
gstring
* dkim_signature;
int hsize;
const uschar * errstr;
BOOL rc;
int hsize;
const uschar * errstr;
BOOL rc;
@@
-133,8
+141,8
@@
tctx->options = tctx->options & ~(topt_end_dot | topt_use_bdat)
| topt_output_string | topt_no_body;
rc = transport_write_message(tctx, 0);
| topt_output_string | topt_no_body;
rc = transport_write_message(tctx, 0);
-hdrs =
tctx->u.msg
;
-h
drs[hsize = tctx->msg_ptr] = '\0'
;
+hdrs =
string_from_gstring(tctx->u.msg)
;
+h
size = tctx->u.msg->ptr
;
tctx->u.fd = save_fd;
tctx->options = save_options;
tctx->u.fd = save_fd;
tctx->options = save_options;
@@
-163,8
+171,8
@@
tctx->options &= ~topt_escape_headers;
spool_file_wireformat = TRUE;
transport_write_reset(0);
if ( ( dkim_signature
spool_file_wireformat = TRUE;
transport_write_reset(0);
if ( ( dkim_signature
- && dkim_signature->
len
> 0
- && !write_chunk(tctx, dkim_signature->
data, dkim_signature->len
)
+ && dkim_signature->
ptr
> 0
+ && !write_chunk(tctx, dkim_signature->
s, dkim_signature->ptr
)
)
|| !write_chunk(tctx, hdrs, hsize)
)
)
|| !write_chunk(tctx, hdrs, hsize)
)
@@
-204,7
+212,7
@@
int dkim_fd;
int save_errno = 0;
BOOL rc;
uschar * dkim_spool_name;
int save_errno = 0;
BOOL rc;
uschar * dkim_spool_name;
-
blob
* dkim_signature;
+
gstring
* dkim_signature;
int options, dlen;
off_t k_file_size;
const uschar * errstr;
int options, dlen;
off_t k_file_size;
const uschar * errstr;
@@
-258,7
+266,7
@@
if (!(dkim_signature = dkim_exim_sign(dkim_fd, 0, NULL, dkim, &errstr)))
}
}
else
}
}
else
- dlen = dkim_signature->
len
;
+ dlen = dkim_signature->
ptr
;
#ifndef OS_SENDFILE
if (options & topt_use_bdat)
#ifndef OS_SENDFILE
if (options & topt_use_bdat)
@@
-280,7
+288,7
@@
if (options & topt_use_bdat)
{
if ( tctx->chunk_cb(tctx, dlen, 0) != OK
|| !transport_write_block(tctx,
{
if ( tctx->chunk_cb(tctx, dlen, 0) != OK
|| !transport_write_block(tctx,
- dkim_signature->
data
, dlen, FALSE)
+ dkim_signature->
s
, dlen, FALSE)
|| tctx->chunk_cb(tctx, 0, tc_reap_prev) != OK
)
goto err;
|| tctx->chunk_cb(tctx, 0, tc_reap_prev) != OK
)
goto err;
@@
-294,10
+302,14
@@
if (options & topt_use_bdat)
goto err;
}
goto err;
}
-if(dlen > 0 && !transport_write_block(tctx, dkim_signature->
data
, dlen, TRUE))
+if(dlen > 0 && !transport_write_block(tctx, dkim_signature->
s
, dlen, TRUE))
goto err;
goto err;
-if (!dkt_send_file(tctx->u.fd, dkim_fd, 0, k_file_size))
+if (!dkt_send_file(tctx->u.fd, dkim_fd, 0
+#ifdef OS_SENDFILE
+ , k_file_size
+#endif
+ ))
{
save_errno = errno;
rc = FALSE;
{
save_errno = errno;
rc = FALSE;