Dean Brandt wrote:
>
> Hi Guys,
>
> I have copied the /etc/smtpd_check_rules file to
> /etc/e-smith/templates-custom/etc/ directory
[This is related to 4.1bX - it should be on the devinfo list. I'm answering it
here as it contains some interesting issues on understanding the template
system]
No, please don't do that. Create custom template fragments for your changes.
If you copy the output file, you will stop all existing rules from applying. So,
for example, if you create a new virtualdomain, it will not appear in the output
file. The template mechanism is very powerful - you can add a one-line fragment
and it will just be added to the output file in the right place.
Have a look at the breadown in
/etc/e-smith/templates/var/spool/smtpd/etc/smtpd_check_rules
Your fragments should be in
/etc/e-smith/templates-custom/var/spool/smtpd/etc/smtpd_check_rules
NOTE: The file is /var/spool/smtpd/etc/smtpd_check_rules, not /etc/smtpd_check_rules. The link in /etc is there for convenience, but the
file which is read by smtpd is in the chroot() jail. We should probably remove
the link to avoid confusion (though it makes life easier when looking around).
> and edited it so
> that I can restrict a certain spammer from sending mail to my
> e-smith box.
>
> I added this line:
>
> noto:ALL:*.domain.com.au:ALL
> noto:*.domain.com.au:ALL:ALL
>
> Then I ran /sbin/e-smith/expand-template /etc/smtpd_check_rules
/sbin/e-smith/expand-template is there for testing. See above for the
real filename.
Use /sbin/e-smith/signal-event console-save, but more importantly, you
need to get the filename correct first.
> Problem is...it still allows amil from that domain to be sent
> to the box. Am I doing this correctly?
See above - just a single/two line fragment in the correct order.
> Do I need to stop or restart qmail?
No.
> Am I editing the right file the right way?
No - you should build a small fragment for your changes and you need the
correct filename (in the chroot() jail).
Gordon