I'm primarily a
User Developer Sysadmin A mixture Something else entirely .. ( 566 votes ~ 10 comments )
You are not currently logged in. If you do not have a user account then please consider creating one and logging in before you post your comment. This will allow you to track replies to your comment, and take part in the site much more freely.
To add your comment, fill in all the boxes below and then preview it to make sure you're happy with the way that it looks.
This is the comment you were replying to, attached to the article Handling mail for non-system users with Exim4?:
#6 Re: Handling mail for non-system users with Exim4? Posted by ineiti (81.221.xx.xx) on Fri 2 Dec 2005 at 15:52 I started with a simple system where you can have aliases for each domain (I also have multiple domains). Then I added the possibility to have virtual users. But as I (still) don't like databases, I did it in a more directory-oriented way. In /etc/exim4/conf.d/router/360_exim4-local_vdom_aliases I have the following: # # First we look up in /etc/exim4/virtual, if we have to do any aliasas, # based on the virtual domains! # vdom_aliases: driver = redirect allow_defer allow_fail domains = dsearch;/etc/exim4/virtual data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtual/$domain}}} retry_use_local_part pipe_transport = address_pipe file_transport = address_file # # Then, if there is no local delivery, let's go and look if we have # a virtual domain defined at /var/mail/virtual # vdom_aliases_maildir: debug_print = "R: vdom_aliases_maildir for $local_part@$domain" driver = redirect allow_defer allow_fail domains = dsearch;/var/mail/virtual data = /var/mail/virtual/$domain/$local_part/ directory_transport = address_directory pipe_transport = address_pipe file_transport = address_file user = vmail group = vmail Now I have two possibilities to influence the mail-delivery of exim: Use /etc/exim4/virtual/domainname in a "alias"-style way Add a directory in /var/mail/virtual/domain/name to have mail delivered in there If I'd have debian.org, I could have /etc/exim4/virtual/debian.org: postmaster : user@localhost forwarding_adress : user@somewhere.else.org * : trash@localhost Furthermore I'd create the directories /var/mail/virtual/debian.org/user /var/mail/virtual/debian.org/bug to have the users "user@debian.org" and "bug@debian.org". Both directories should be owned by user vmail.vmail. As imap-server I use dovecot with the following line in /etc/dovecot/dovecot.conf default_mail_env = maildir:/var/mail/virtual/%d/%n/ and auth_userdb = passwd-file /etc/passwd.imap for the passwords. This serves mail as stored by exim. One can also add symbolic links in there in order to cover local users. Well, it's a bit hacky, but I wanted something easily extendable (and what is more easy than to write "mkdir -p newdomain.org/user") and I just love my filesystem. (Why does MS want to make the filesystem a DB? One should make the DB a filesystem ;) Hope it helps, ineiti
I started with a simple system where you can have aliases for each domain (I also have multiple domains). Then I added the possibility to have virtual users. But as I (still) don't like databases, I did it in a more directory-oriented way. In /etc/exim4/conf.d/router/360_exim4-local_vdom_aliases I have the following:
# # First we look up in /etc/exim4/virtual, if we have to do any aliasas, # based on the virtual domains! # vdom_aliases: driver = redirect allow_defer allow_fail domains = dsearch;/etc/exim4/virtual data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtual/$domain}}} retry_use_local_part pipe_transport = address_pipe file_transport = address_file # # Then, if there is no local delivery, let's go and look if we have # a virtual domain defined at /var/mail/virtual # vdom_aliases_maildir: debug_print = "R: vdom_aliases_maildir for $local_part@$domain" driver = redirect allow_defer allow_fail domains = dsearch;/var/mail/virtual data = /var/mail/virtual/$domain/$local_part/ directory_transport = address_directory pipe_transport = address_pipe file_transport = address_file user = vmail group = vmail
Now I have two possibilities to influence the mail-delivery of exim:
If I'd have debian.org, I could have /etc/exim4/virtual/debian.org:
postmaster : user@localhost forwarding_adress : user@somewhere.else.org * : trash@localhost
Furthermore I'd create the directories /var/mail/virtual/debian.org/user /var/mail/virtual/debian.org/bug to have the users "user@debian.org" and "bug@debian.org". Both directories should be owned by user vmail.vmail.
As imap-server I use dovecot with the following line in /etc/dovecot/dovecot.conf
default_mail_env = maildir:/var/mail/virtual/%d/%n/
auth_userdb = passwd-file /etc/passwd.imap
Well, it's a bit hacky, but I wanted something easily extendable (and what is more easy than to write "mkdir -p newdomain.org/user") and I just love my filesystem. (Why does MS want to make the filesystem a DB? One should make the DB a filesystem ;)
Hope it helps,
ineiti
Posting Format:
Inappropriate comments will be removed.
Some help on entry formatting is available
Username:
Password:
[ Advanced Login ]
Register Account