(void *)offsetof(transport_instance, driver_name) },
{ "envelope_to_add", opt_bool|opt_public,
(void *)(offsetof(transport_instance, envelope_to_add)) },
+#ifdef EXPERIMENTAL_EVENT
+ { "event_action", opt_stringptr | opt_public,
+ (void *)offsetof(transport_instance, event_action) },
+#endif
{ "group", opt_expand_gid|opt_public,
(void *)offsetof(transport_instance, gid) },
{ "headers_add", opt_stringptr|opt_public|opt_rep_str,
(void *)offsetof(transport_instance, shadow_condition) },
{ "shadow_transport", opt_stringptr|opt_public,
(void *)offsetof(transport_instance, shadow) },
-#ifdef EXPERIMENTAL_TPDA
- { "tpda_event_action",opt_stringptr | opt_public,
- (void *)offsetof(transport_instance, tpda_event_action) },
-#endif
{ "transport_filter", opt_stringptr|opt_public,
(void *)offsetof(transport_instance, filter_command) },
{ "transport_filter_timeout", opt_time|opt_public,
{
int sep = ':'; /* This is specified as a colon-separated list */
uschar *s, *ss;
- uschar buffer[128];
- while ((s = string_nextinlist(&list, &sep, buffer, sizeof(buffer))))
+ while ((s = string_nextinlist(&list, &sep, NULL, 0)))
{
int len;
int sread = 0;
int wwritten = 0;
uschar *dkim_signature = NULL;
-off_t size = 0;
/* If we can't sign, just call the original function. */
}
}
-/* Fetch file size */
-size = lseek(dkim_fd, 0, SEEK_END);
-
-/* Rewind file */
-lseek(dkim_fd, 0, SEEK_SET);
-
#ifdef HAVE_LINUX_SENDFILE
/* We can use sendfile() to shove the file contents
to the socket. However only if we don't use TLS,
before the data finally hits the socket. */
if (tls_out.active != fd)
{
+ off_t size = lseek(dkim_fd, 0, SEEK_END); /* Fetch file size */
ssize_t copied = 0;
off_t offset = 0;
+
+ /* Rewind file */
+ lseek(dkim_fd, 0, SEEK_SET);
+
while(copied >= 0 && offset < size)
copied = sendfile(fd, dkim_fd, &offset, size - offset);
if (copied < 0)
save_errno = errno;
rc = FALSE;
}
- goto CLEANUP;
}
+else
+
#endif
-/* Send file down the original fd */
-while((sread = read(dkim_fd, sbuf, 2048)) > 0)
{
- char *p = sbuf;
- /* write the chunk */
+ /* Rewind file */
+ lseek(dkim_fd, 0, SEEK_SET);
- while (sread)
+ /* Send file down the original fd */
+ while((sread = read(dkim_fd, sbuf, 2048)) > 0)
{
+ char *p = sbuf;
+ /* write the chunk */
+
+ while (sread)
+ {
#ifdef SUPPORT_TLS
- wwritten = tls_out.active == fd
- ? tls_write(FALSE, US p, sread)
- : write(fd, p, sread);
+ wwritten = tls_out.active == fd
+ ? tls_write(FALSE, US p, sread)
+ : write(fd, p, sread);
#else
- wwritten = write(fd, p, sread);
+ wwritten = write(fd, p, sread);
#endif
- if (wwritten == -1)
- {
- /* error, bail out */
- save_errno = errno;
- rc = FALSE;
- goto CLEANUP;
+ if (wwritten == -1)
+ {
+ /* error, bail out */
+ save_errno = errno;
+ rc = FALSE;
+ goto CLEANUP;
+ }
+ p += wwritten;
+ sread -= wwritten;
}
- p += wwritten;
- sread -= wwritten;
}
- }
-if (sread == -1)
- {
- save_errno = errno;
- rc = FALSE;
- goto CLEANUP;
+ if (sread == -1)
+ {
+ save_errno = errno;
+ rc = FALSE;
+ }
}
CLEANUP:
argv = child_exec_exim(CEE_RETURN_ARGV, TRUE, &i, FALSE, 0);
- #ifdef EXPERIMENTAL_DSN
/* Call with the dsn flag */
if (smtp_use_dsn) argv[i++] = US"-MCD";
- #endif
if (smtp_authenticated) argv[i++] = US"-MCA";