Hi and welcome to LQ
For the incoming you'll need procmail, that comes with most distros. Create or edit /etc/procmailrc (if teamA has a homedir it's better to use ~/.procmailrc) and use the following:
Code:
:0
* ! ^From:.*gooddomain.com
To: teamA@mydomain.com
/dev/null
If you use ~/.procmailrc the line "To: ..." is not needed
For the outgoing, edit /etc/mail/access and use
Code:
From:teamA@mydaomain.com REJECT
The run
Code:
makemap hash /etc/mail/access < /etc/mail/access
Regards