Sendmail access_db configuration. How is it used and how to write it

configurationsendmail

I am reading about the access_db feature of sendmail. Apparently it looks promising as a preventive way to stop spamming.

I have several questions related to how access_db is used. So basically I specify a set of rules in the access file, and sendmail will check this database to see if it should do anything about an email.

  1. How about the mails that do not fit any of the specify rules? What's the default behavior?
  2. Can I use regular expression? For example, will "To:*@spam.com REJECT" work?
  3. If I only have "paypal.com RELAY", does it mean my sendmail will accept and send emails originated from or destined to paypal.com?

Thanks a lot!

Best Answer

  1. If a rule does not match the ones in access_db, then it does not affect accepting or denying the message. The message continues to get processed by the rest of the rules.
  2. access_db (and whatever wildcards, but not regular expressions) is described here. If you want regular expressions you either have to write your own rule sets that mimic access_db behavior but use a regular expression map, or use a milter, like MIMEDefang, or milter-regex.
  3. It is best to use rules that begin with From: or Connect: instead of plain IP addresses or domains, so as not to have to think whether the rule is about the domain name of the host that connects to your host, or the domain name of the sender's address (they are not necessarily the same).