[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 563
  • Last Modified:

/etc/mail/access

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:[1.1.1.1] OK
From:[1.1.1.2] OK
File: /nas/companyA
File: /nas/companyB

This way, I need thousands of lines in /etc/mail/access
0
md168
Asked:
md168
1 Solution
 
wesly_chenCommented:
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
http://www.sendmail.org/m4/anti_spam.html
0
 
stetorCommented:
not directly but the problem can be solved with DIY ;-)
follow this step
1) write your file as /etc/mail/access.my
2) write this simple script in /etc/mail/expAccessMy
#/bin/bash
echo "including single line"
grep -v "^File: " /etc/mail/access.my >/etc/mail/access
for name in `grep "^File: " /etc/mail/access.my | sed -e "s/^File: //"`
do
     echo "including file: $name"
     cat "$name" >>/etc/mail/access
done
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/access.my

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

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now