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

Re: Exim rewrite question



hi there,

"inspired" by the remote_smtp config at
http://web.inter.nl.net/users/jws/mysystem.html
i created a similar system:


change the rewriting rule at the end of exim.conf to

*@your-qualify_domain    ${lookup{$1}lsearch{/etc/email-addresses}\
                                                {$value}fail} F

this will rewrite the envelope addresses, which are neccesary for remote
delivery, but should be so far irrelevant for local delivery. note, that
the headers in the message are not rewritten.


add this to the smtp-transport in exim.conf:

remote_smtp:
  transport_filter = "/usr/local/sbin/adrrewr"

this will rewrite the messages sent to "outside".
the attached file is a gawk script, which takes care of rewriting the
message according to /etc/email-addresses. remember to "chmod 755" it
after saving it.


this should be quite flexible (in fact, adding new users is no different,
than with a "normal" debian config) and it does not require a second exim
running somewhere.

does this make sense? please report your experiences with it.

have fun!

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Real programmers don't comment their code.
It was hard to write, it should be hard to understand.
--
Become part of the world's biggest computer cluster - 
join http://www.distributed.net/
#! /usr/bin/gawk -f

BEGIN {
  while((getline inp < "/etc/email-addresses") > 0) {
   if(inp !~ /^ *#/) {
    split(inp, p, "[ \t]*:[ \t]*")
    tr[p[1]]=p[2]
   }
 }
 while((getline inp < "/etc/exim.conf") > 0) {
  if(inp ~ /^ *qualify_domain\>/) {
   split(inp, p, "[ \t]*=[ \t]*")
   qdom=p[2]
   break
  } 
 }
}

/^$/ {
 body=1
}

{
 if(body==0)
  for(i in tr)
   gsub("\\<" i "@" qdom "\\>", tr[i])
 print
}

Reply to: