diff -U4 -r exim-4.69/src/receive.c exim-4.69+authenticated-id/src/receive.c --- exim-4.69/src/receive.c 2007-09-28 13:21:57.000000000 +0100 +++ exim-4.69+authenticated-id/src/receive.c 2008-01-26 10:07:36.000000000 +0000 @@ -3405,10 +3405,15 @@ if (sender_host_authenticated != NULL) { s = string_append(s, &size, &sptr, 2, US" A=", sender_host_authenticated); - if (authenticated_id != NULL) - s = string_append(s, &size, &sptr, 2, US":", authenticated_id); + if (authenticated_id != NULL && Ustrlen(authenticated_id) > 0) + { + if (Ustrchr(authenticated_id, ' ') != NULL) + s = string_append(s, &size, &sptr, 3, US":\"", authenticated_id, US"\""); + else + s = string_append(s, &size, &sptr, 2, US":", authenticated_id); + } } sprintf(CS big_buffer, "%d", msg_size); s = string_append(s, &size, &sptr, 2, US" S=", big_buffer);