human hand off fix reputation
This commit is contained in:
parent
249fb79aaf
commit
223f846782
2 changed files with 8 additions and 10 deletions
|
|
@ -724,10 +724,9 @@ async def process_human_reply(
|
||||||
def _mirror_from_identity(
|
def _mirror_from_identity(
|
||||||
source: dict, agent_name: str, agent_email: str
|
source: dict, agent_name: str, agent_email: str
|
||||||
) -> tuple[str, str]:
|
) -> tuple[str, str]:
|
||||||
|
# Always send From the Gentic mailbox so SPF/DKIM/DMARC stay aligned.
|
||||||
if source.get("direction") == "inbound":
|
if source.get("direction") == "inbound":
|
||||||
sender = source.get("sender") or {}
|
return sender_display_name(source.get("sender") or {}), agent_email
|
||||||
address = (sender.get("address") or "").strip()
|
|
||||||
return sender_display_name(sender), address or agent_email
|
|
||||||
return agent_name, agent_email
|
return agent_name, agent_email
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,21 +72,21 @@ def test_quote_trail_is_detected_in_forwarded_history():
|
||||||
assert _body_has_quote_trail("sender: E", None) is False
|
assert _body_has_quote_trail("sender: E", None) is False
|
||||||
|
|
||||||
|
|
||||||
def test_mirror_from_uses_one_address_not_both():
|
def test_mirror_from_stays_on_gentic_address():
|
||||||
name, address = _mirror_from_identity(
|
name, address = _mirror_from_identity(
|
||||||
{
|
{
|
||||||
"direction": "inbound",
|
"direction": "inbound",
|
||||||
"sender": {
|
"sender": {
|
||||||
"name": "Suyash Dixit",
|
"name": "Parth Dixit",
|
||||||
"address": "suyashdixit091@gmail.com",
|
"address": "parthdixit091@gmail.com",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"Suyash Dixit",
|
"Suyash Dixit",
|
||||||
"suyash@gentic.email",
|
"suyash@gentic.email",
|
||||||
)
|
)
|
||||||
assert name == "Suyash Dixit"
|
assert name == "Parth Dixit"
|
||||||
assert address == "suyashdixit091@gmail.com"
|
assert address == "suyash@gentic.email"
|
||||||
assert "gentic.email" not in address
|
assert "gmail.com" not in address
|
||||||
|
|
||||||
agent_name, agent_address = _mirror_from_identity(
|
agent_name, agent_address = _mirror_from_identity(
|
||||||
{"direction": "outbound", "sender": {"address": "suyash@gentic.email"}},
|
{"direction": "outbound", "sender": {"address": "suyash@gentic.email"}},
|
||||||
|
|
@ -95,7 +95,6 @@ def test_mirror_from_uses_one_address_not_both():
|
||||||
)
|
)
|
||||||
assert agent_name == "Suyash Dixit"
|
assert agent_name == "Suyash Dixit"
|
||||||
assert agent_address == "suyash@gentic.email"
|
assert agent_address == "suyash@gentic.email"
|
||||||
assert "gmail.com" not in agent_address
|
|
||||||
|
|
||||||
|
|
||||||
def test_private_subject_contains_customer_name_and_external_subject():
|
def test_private_subject_contains_customer_name_and_external_subject():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue