[Mimedefang] RFC822 From: header

Jim McCullars jim at info.uah.edu
Fri Jun 10 14:17:35 EDT 2005



On Fri, 10 Jun 2005, Steve Jordan wrote:

> We want to use the RFC822 From: header to reject mail purporting to be
> from info at uic.edu and some other addresses. I can not find where this
> information is available to me in mimedefang-filter. The RFC822 Subject:

   You will need to do this in filter_begin() or later, since the headers
are not there until after the DATA phase:

(untested, btw)  :-)

  if(open(IN, "./HEADERS")) {
    while (<IN>) {
      if (/^From:.+info\@uic\.edu/i) {
        close(IN);
        return action_bounce("Invalid From: address in message")
      }
    }
    close(IN)
  }

If you want to check for multiple addresses, as in info, staff,
management, etc., change the "if" statement above to something like:

 if (/^From:.+(?:info|staff|management|administration|noreply)\@uic\.edu/i) {

   HTH...

Jim McCullars
University of Alabama in Huntsville




More information about the MIMEDefang mailing list