{
struct smtp_client_command *cmd;
+ smtp_client_connection_send_xclient(conn);
+
cmd = smtp_client_command_new(conn,
flags | SMTP_CLIENT_COMMAND_FLAG_PIPELINE,
callback, context);
string_t *sasl_output_base64;
const char *init_resp, *error;
+ if (set->username == NULL && set->sasl_mech == NULL) {
+ if (!conn->initial_xclient_sent && !conn->set.xclient_defer) {
+ conn->initial_xclient_sent = TRUE;
+ smtp_client_connection_send_xclient(conn);
+ }
+ return (conn->xclient_replies_expected == 0);
+ }
+
if (!conn->initial_xclient_sent) {
conn->initial_xclient_sent = TRUE;
smtp_client_connection_send_xclient(conn);
if (conn->authenticated)
return TRUE;
- if (set->username == NULL && set->sasl_mech == NULL)
- return TRUE;
if ((conn->caps.standard & SMTP_CAPABILITY_AUTH) == 0) {
smtp_client_connection_fail(conn,
smtp_proxy_data_merge(conn->pool, &conn->set.proxy_data,
&set->proxy_data);
+ conn->set.xclient_defer = set->xclient_defer;
conn->set.peer_trusted = set->peer_trusted;
}
bool debug;
/* peer is trusted, so e.g. attempt sending XCLIENT data */
bool peer_trusted;
+ /* defer sending XCLIENT command until authentication or first mail
+ transaction. */
+ bool xclient_defer;
/* don't clear password after first successful authentication */
bool remember_password;
};