case 'u':
case 'U':
if (g_ascii_strcasecmp (type, "user") == 0) {
- str = task->user;
+ str = task->auth_user;
}
else {
msg_warn_task ("bad argument to function: %s", type);
trecv.flags |= received_flags::SSL;
}
- if (task->user) {
+ if (task->auth_user) {
trecv.flags |= received_flags::AUTHENTICATED;
}
*/
msg_debug_protocol ("read user header, value: %T", hv_tok);
if (!RSPAMD_TASK_IS_SPAMC (task)) {
- task->user = rspamd_mempool_ftokdup (task->task_pool,
+ task->auth_user = rspamd_mempool_ftokdup (task->task_pool,
hv_tok);
}
else {
ucl_array_append (cb->top, obj);
if (cb->task->cfg->log_urls) {
- if (task->user) {
- user_field = task->user;
- len = strlen (task->user);
+ if (task->auth_user) {
+ user_field = task->auth_user;
+ len = strlen (task->auth_user);
has_user = TRUE;
}
else if (task->from_envelope) {
rspamd_strlcpy (row->message_id, MESSAGE_FIELD (task, message_id),
sizeof (row->message_id));
}
- if (task->user) {
- rspamd_strlcpy (row->user, task->user, sizeof (row->user));
+ if (task->auth_user) {
+ rspamd_strlcpy (row->user, task->auth_user, sizeof (row->user));
}
else {
row->user[0] = '\0';
}
break;
case RSPAMD_LOG_USER:
- if (task->user) {
+ if (task->auth_user) {
ret = TRUE;
}
break;
}
break;
case RSPAMD_LOG_USER:
- if (task->user) {
- var.begin = task->user;
+ if (task->auth_user) {
+ var.begin = task->auth_user;
var.len = strlen (var.begin);
}
else {
rspamd_inet_addr_t *from_addr; /**< from addr for a task */
rspamd_inet_addr_t *client_addr; /**< address of connected socket */
gchar *deliver_to; /**< address to deliver */
- gchar *user; /**< user to deliver */
+ gchar *auth_user; /**< SMTP authenticated user */
const gchar *hostname; /**< hostname reported by MTA */
khash_t(rspamd_req_headers_hash) *request_headers; /**< HTTP headers in a request */
struct rspamd_task_data_storage msg; /**< message buffer */
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
- if (task->user != NULL) {
- lua_pushstring (L, task->user);
+ if (task->auth_user != NULL) {
+ lua_pushstring (L, task->auth_user);
}
else {
lua_pushnil (L);
if (lua_type (L, 2) == LUA_TSTRING) {
new_user = lua_tostring (L, 2);
- if (task->user) {
+ if (task->auth_user) {
/* Push old user */
- lua_pushstring (L, task->user);
+ lua_pushstring (L, task->auth_user);
}
else {
lua_pushnil (L);
}
- task->user = rspamd_mempool_strdup (task->task_pool, new_user);
+ task->auth_user = rspamd_mempool_strdup (task->task_pool, new_user);
}
else {
/* Reset user */
- if (task->user) {
+ if (task->auth_user) {
/* Push old user */
- lua_pushstring (L, task->user);
+ lua_pushstring (L, task->auth_user);
}
else {
lua_pushnil (L);
}
- task->user = NULL;
+ task->auth_user = NULL;
}
}
else {
}
/* First check if plugin should be enabled */
- if ((!dkim_module_ctx->check_authed && task->user != NULL)
+ if ((!dkim_module_ctx->check_authed && task->auth_user != NULL)
|| (!dkim_module_ctx->check_local &&
rspamd_ip_is_local_cfg (task->cfg, task->from_addr))) {
msg_info_task ("skip DKIM checks for local networks and authorized users");