addr.addr = string.format('%s@', addr.user)
end
- if addr.name then
- addr.raw = string.format('%s <%s>', addr.name, addr.addr)
+ if addr.name and #addr.name > 0 then
+ addr.raw = string.format('"%s" <%s>', addr.name, addr.addr)
else
addr.raw = string.format('<%s>', addr.addr)
end
p = lua_tolstring (L, -1, &len);
addr->name = (const gchar *)rspamd_mempool_alloc (task->task_pool, len);
memcpy ((gchar *)addr->name, p, len);
- addr->addr_len = len;
+ addr->name_len = len;
}
lua_pop (L, 1);
}
lua_pop (L, 1);
+ addr->flags = RSPAMD_EMAIL_ADDR_VALID;
*paddr = addr;