Greetings fellow Exim users,

I have what seems like a simple issue, but I can't seem to get it quite right. 
I did look in the manual, but I guess I missed the solution if it's there (and 
I would not be surprised if that is so), so please bear with me if this is 
indeed a case of RTFM.

I have a mail server where all the account details will be stored inside a 
MySQL database. What I want is to place the forward address (if there is one) 
in the database also, instead of the user's .forward file. This is because this 
particular server is almost entirely virtual domain users, with almost no-one 
who actually has shell access, so except for the mail directory, many of the 
users don't HAVE a home directory to hold a .forward file in the first place. I 
use the maildir format, so I suppose I could just place the .forward file in 
the base maildir, level with the cur, new, and tmp directories or something, 
but I'd really prefer not to do that. I tried what I thought would be indicated 
by the manual and examples I saw, but they don't seem to be working. The 
forward is ignored. Here's the table:

EmailAccts (
  EmailAddr varchar(90) primary_key not null,
  uid int(5) not null default 12,
  gid int(5) not null default 8,
  ClearPW varchar(60) not null,
  Crypted varchar(90) not null default '*LOCKED*',
  ForwardTo varchar(150),
  HomeDir varchar(60) not null,
  MailDir varchar(70) not null
)

If no forward is defined, the ForwardTo field should be null.

And here's the router entry from the exim.conf (forgive the linewrap):

virtual_forwards:
 driver = redirect
 domains = +local_domains
 router_home_directory = ${lookup mysql{ select HomeDir from EmailAccts where 
EmailAddr = '${quote_mysql:${local_part}}' }}
 data = ${lookup mysql = ${lookup mysql{ select ForwardTo from EmailAccts where 
EmailAddr = '${quote_mysql:${local_part}}' and ForwardTo != null }}
 no_verify
 no_expn
 forbid_filter_existtest
 forbid_filter_lookup
 check_ancestor
 directory_transport = address_directory
 reply_transport = address_reply

Any help on this is appreciated. I've looked at a couple examples, but can't 
seem to find one where the forward address is in the database. Everyone else 
just uses a .forward file at a set location. 

Thanks!
--- Dan Egli


-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to