Multiple /home partitions and Exims virtual_localdelivery problem

websafe

Verified User
Joined
Jun 15, 2010
Messages
105
Location
Opole, PL
Hello :-)

What I did:

1. created a new partition and mounted it as /home9
2. moved /home/EXISTINGUSER to /home9/EXISTINGUSER
3. created a link /home/EXISTINGUSER pointing to /home9/EXISTINGUSER
4. modified EXISTINGUSERs home (usermod...)
5. modified all paths in /usr/local/directadmin/data/users/EXISTINGUSER/* from /home/EXISTINGUSER to /home9/EXISTINGUSER
6. modified all paths in /etc/virtual/*/* belonging to EXISTINGUSER (mostly files passwd and filter) (/home to /home9)
7. rewrote httpd configs (task.queue)
8. restarted spamd, exim, dovecot, proftpd, httpd

Everything works fine (exim, dovecot, httpd, proftpd)

Now the bad news ;-)

I have removed the link /home/EXISTINGUSER => /home9/EXISTINGUSER, and what happened?
Mostly everything works fine (httpd, proftpd, dovecot) BUT EXIM!

Exim can't deliver messages to EXISTINGUSER because exim is still looking for a maildir in /home/EXISTINGUSER/... instead of /home9/EXISTINGUSER.

All paths are correct, I've checked it three times, and now I've found what can cause my problems - it's exim.conf.

In exim.conf is an entry:

Code:
virtual_localdelivery:
  driver = appendfile
  create_directory
  delivery_date_add
  directory_mode = 770
  envelope_to_add
  directory = /home/${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}/imap/${domain}/${local_part}/Maildir
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  maildir_format
  group = mail
  mode = 660
  return_path_add
  user = "${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}"
  quota = ${if exists{/etc/virtual/${domain}/quota}{${lookup{$local_part}lsearch*{/etc/virtual/${domain}/quota}{$value}{0}}}{0}}
  headers_add = "${if def:h_X-DirectAdmin-Sender:{Content-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\n}}"


So in general, I want to get rid of this symlink /home/EXISTINGUSER => /home9/EXISTINGUSER.

And my question:

1. will it be possible to modify exim.conf to lookup users real home directory and not use `/home` "hardcoded" (in exim.conf)?
If not the real /home then maybe the directory stored in `/etc/virtual/existingusersdomain.com/passwd`?

I see other problems: spamcheck_director and local_delivery have "hardcoded" /home too, will it be possible to modify those in the same way?

Code:
spamcheck_director:
    ...
                        {exists{/home/${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}/.spamassassin/user_prefs}} \
    ...

Code:
local_delivery:
  ...
  directory = /home/$local_part/Maildir/
  ...


Why I'm asking this?

Because normally I wouldn't bother about all this path rewriting ;) I would move a userdir to the new /home9 and symlink, and everything would work... Except DirectAdmin :D
When DirectAdmin finds a symlink in a users path, this user wont be able to delete a domain (at least to delete, that's what I've noticed first, I don't know about other problems that may occur).
So all path rewriting tasks (4,5,6,7) are required and I STILL NEED THIS SYMLINK!

Any ideas?
 
Last edited:
LOL, the exact answer to my question! Thank You Alex - EXCELLENT help!

And a small update: after reading http://help.directadmin.com/item.php?id=451 I've decided to leave the symlink instead of modifying exim.conf, because we're having already some disk performance issues on this machine.
 
Last edited:
Back
Top