The Orthodox way of praying for the deceased is to do a conditional prayer. "If X is in Purgatory, please deliver X".
While public prayers for heretics are banned, private prayers are not, as long as they are conditional.
If X is in heaven, or in hell, praying for them is useless. Prayers are only useful for someone in Purgatory. Since it's almost impossible to know if someone is in Purgatory or not, it's better that all prayers for deceased people should be conditional.