Firewall rules function by defining specific criteria that network traffic must meet to be allowed or denied access. These criteria can be based on factors such as IP addresses, domain names, protocols, and ports. In email marketing, these rules can be tailored to ensure that only legitimate emails are sent and received, thereby reducing the risk of spam and other malicious activities.