It’s very late here and I’m tired. So my mind is not working like I would want it too. But the solution to your problems is in one of the treads here. That is something I know for sure.

It is something like this,
With the old setup:
mail > other prog > avast > mail client
new setup:
mail > avast > other prog > mail client

Could be the other way around. Like I said, I’m tired and it is late here. But I’m pretty sure that is the problem/solution