[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vps-mail] Question re syntax for hosts.allow file



Abigail Marshall wrote:

If I want to block an entire Class C of IP addresses as opposed to
individual IP's in the hosts.allow file, what is the correct syntax?

smtp : 207.164.7.0/24 : deny
The above probably works on VPS1 (where sendmail is started by iservd for each incoming e-mail message). On VPS2--where sendmail is running as a daemon--you should change the first "smtp" to "sendmail". (It is probably a good idea to restart sendmail to force it to re-read hosts.allow).

or

smtp : 207.164.7. : deny

FWIW, I've noticed that, during an SMTP conversation with the VPS2 sendmail daemon, sendmail appears to consult hosts.allow at about the same time as it consults the access.db. (One would expect hosts.allow to block incoming connections earlier in the conversation, but it doesn't appear to happen that way in sendmail's implementation ... where sendmail is doing the consulting of hosts.allow ...)

You could also accomplish the same (i.e., block a class C network) in access.db, with a line that begins something like:

207.264.7

OR

Connect:207.264.7

(or other variations), and an appropriate RHS such as REJECT:

207.264.7      REJECT


======================================================================
This is <vps-mail@xxxxxxxxxxxx>       <http://www.perlcode.org/lists/>
======================================================================


Main Index | Thread Index
Match: Format: Sort by:
Search: