bug-mailfromd


Search for: Advanced

Re: [Bug-mailfromd] srs (sender rewrite)


> > Is there information (macro?) available that can inform the milter of
> > the destination of a message?
> 
> Yes, the rcpt_addr macro.  Besides, it is passed as $1 to the envrcpt
> handler:
> 
> https://www.gnu.org.ua/software/mailfromd/manual/Handlers.html#index-envrcpt
> 

So I could
- define my network ip ranges 
- get the mx ips from ${rcpt_host}
- if mx ips are not in my ranges, do sender rewriting.

static string mynet "10.10.10.1/24 127.0.0.1/32 "
set remotemx getmx(${rcpt_host},1)

loop while ???through remotemx??
do
  
  loop while ???through mynet???
  do
    if not match_cidr(remotemx[..], mynet[..])
      set $f "new@xxxxxxxxxxx" ?
    fi
  done

done

:) maybe a bit of help with these loops? Can I indeed change the envelope like this? :)