Posted on 2011-04-27
Last Modified: 2012-05-11
Redhat, /etc/mail/access

I am adding thousands of DISCARDs to /etc/mail/access.  Is it possible to have the access file reference external files.

For example, can I have:

From:[] OK
From:[] OK
File: /nas/companyA
File: /nas/companyB

This way, I need thousands of lines in /etc/mail/access
Question by:md168
    LVL 38

    Expert Comment

    As far as I know, /etc/mail/access doesn't have the feature to reference external file.
    Also, you need to use the makemap utility program to create the database map.
    To create the access database map, use the following command:
    # makemap hash /etc/mail/access.db < /etc/mail/access

    For more details, check
    LVL 3

    Accepted Solution

    not directly but the problem can be solved with DIY ;-)
    follow this step
    1) write your file as /etc/mail/
    2) write this simple script in /etc/mail/expAccessMy
    echo "including single line"
    grep -v "^File: " /etc/mail/ >/etc/mail/access
    for name in `grep "^File: " /etc/mail/ | sed -e "s/^File: //"`
         echo "including file: $name"
         cat "$name" >>/etc/mail/access
    makemap hash /etc/mail/access.db < /etc/mail/access

    Open in new window

    3) give the permission to the script (chmod +x /etc/mail/expMyAccess
    4) execute the script (this step every time you modify the /etc/mail/

    N.B: if you have a valid content in /etc/mail/access, save it in another file (can be the starting point for with "cp access") before executing this script because it overwrite the /etc/mail/access evaluating the /etc/mail/

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    The purpose of this video is to demonstrate how to use PicMonkey software to customize images for a Mailchimp campaign. Picmonkey is free and simple online software which can be used by users who don’t have robust editing software such as Photoshop,…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now