POSTCONF -E /or/ SED & CAT?
Hi all linux gurus,
i'm a little newbie in linux yet, but i'm trying to configure a script that allow simply modifing a text file (we'll call it spam-server.txt) to change the /etc/postfix/mainf.cf I know that some could be modified by "postconf -e" command, but, perhaps, not my case, 'couse i'm trying to modify "smtpd_recipient_restrictions" line to add a series of checks. Tryed this Code:
postconf -e 'smtpd_recipient_restrictions= `cat spam-server.txt`' So i've a file containing all check to add (spam-server.txt) and what i was supposed to do is something like Code:
sed 's/,permit/`cat spam-server.txt`&/g' /testing/main.cf > /testing/main.cf.new Code:
smtpd_recipient_restrictions = `cat spam-server.txt`,permit PS: sorry newbie question :rolleyes: |
I've simply put this in my main.cf file:-
Code:
smtpd_client_restrictions = permit_mynetworks, reject_rbl_client zen.spamhaus.org, reject_rbl_client cbl.abuseat.org, reject_rbl_client bl.spamcop.net, reject_rbl_client list.dsbl.org, reject_rbl_client dnsbl.njabl.org, reject_rbl_client dnsbl.sorbs.net, permit |
hi,
i want a list in a text file becouse we are an isp provider, we have a lot of computers in housing and many customers have an "home mail server" so the idea is: - create a text file contains rules - do a script that download this file in each client once a day, read it and modify main.cf if any changes are done to the original one, restart postfix program - add script to any client crontab so , becouse it happens that sometimes we change this parameters, changing simple one file in our server any client will download the new one and upgrade itself. |
Then I would build a new main.cf file on the fly each time you want to restart postfix. Something like:-
Code:
cp main.cf.template main.cf |
Quote:
what i could do is: Code:
export DATA=`date +%Y%m%d%H$M%S` |
I wasn't clear enough. The main.cf.template file that I suggest you copy to main.cf and then append to, would NOT contain the smtpd_client_restrictions entry - it would contain everything except that.
|
Quote:
this correct, it's Monday Morning :p |
All times are GMT -5. The time now is 03:40 PM. |