Bobcares

How to Rebuild access.db in Sendmail

by | Mar 24, 2025

Learn how to rebuild access.db in Sendmail. Our Sendmail Support team is here to help you with your questions and concerns.

How to Rebuild access.db in Sendmail

Did you know that the access.db file in Sendmail is a powerful tool for controlling email traffic and preventing spam? Understanding how it works can help you manage your mail server more efficiently.

How to Rebuild access.db in Sendmail

It allows administrators to define rules that control whether emails from specific domains or IP addresses are accepted or rejected. This database is generated from the plain text /etc/mail/access file, making it easier to manage filtering rules in a structured format.

Why is access.db Important?

  1. The access.db file enables administrators to create rules that determine which emails should be accepted or rejected. For instance, an entry like the one below ensures that emails from this sender are blocked, effectively reducing unwanted messages.

    spammer@aol.com REJECT

  2. With access.db, Sendmail can block known spam sources, mitigating phishing attempts and malicious emails before they reach users.
  3. This file is also used to manage relaying permissions. Trusted networks can be allowed to relay mail while others are denied, helping to prevent unauthorized use of the mail server.
  4. Administrators can implement custom rules tailored to their organization’s needs, considering factors such as sender addresses and connection sources.
  5. Sendmail’s access.db works alongside other security tools, like DNS Blackhole Lists (DNSBL), to block spam sources dynamically in real time.
  6. If an incoming email does not match any rule in access.db, Sendmail typically accepts it unless otherwise configured. This ensures a balance between security and functionality.

How to Rebuild the access.db File in Sendmail

Whenever changes are made to /etc/mail/access, the access.db file must be updated. Follow these steps to rebuild it:

  1. First, we must edit the /etc/mail/access file. This plain text file contains rules that dictate whether to accept or reject emails. Open the file using a text editor:

    sudo vim /etc/mail/access
    Then, modify entries as needed. Examples include:

    • Block a domain:

      spammer.com REJECT

    • Allow relaying for a specific IP:

      Connect:X.X.X.X RELAY

    • Accept all emails from a domain:

      gooddomain.com OK

    Finally, save and exit the editor.

  2. After editing, convert the plain text file into the database format:


    sudo makemap hash /etc/mail/access.db < /etc/mail/access

  3. To apply changes, restart Sendmail with:

    sudo service sendmail restart

    Or ,

    sudo /etc/init.d/sendmail restart

  4. Instead of restarting Sendmail, we can refresh its configuration:
    • If started using startsrc:

      refresh -s sendmail

    • If started directly via /usr/sbin/sendmail:

      kill -1 `cat /etc/mail/sendmail.pid`

  5. Also, ensure FEATURE(‘access_db’) is enabled in /etc/mail/sendmail.mc. If changes are made to sendmail.mc, rebuild the main configuration file:

    cd /etc/mail
    sudo make

  6. To avoid permission errors, set the correct ownership and access rights:

    sudo chown root /etc/mail/access.db
    sudo chmod g-w /etc/mail/access.db

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

The access.db file is a powerful tool for managing email security in Sendmail. Properly configuring it can prevent spam, block unauthorized relays, and improve overall email handling.

In brief, our Support Experts demonstrated how to rebuild access.db in Sendmail.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF