[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qmail
Subject:    Re: Aliases
From:       Markus Stumpf <maex-qmail () Space ! Net>
Date:       2000-12-07 3:09:52
[Download RAW message or body]

On Wed, Dec 06, 2000 at 04:01:31PM +0200, Peter Gordon wrote:
> Let's assume that incoming mail is addressed to user1@valor.com
> and user2@valor.com. I want to be able to choose that email
> to user1@valor.com continues to vsun14.valor.com, but that mail 
> to user2@valor.com goes to ftp2.valor.com.
> 
> I understand that I have to add aliases to ~alias.

No, you don't need aliases.

> I also have to add 
> a control/virtualdomains file which I don't have at the moment.
> I am working on a live system and don't want to disrupt the email
> by making mistakes. 

Nothing happens unless you    kill -HUP qmail-send   ;-)

First it's important to know that smtproutes applies only to
qmail-remote. This is after the delivery descision (local/remote)
has been made.

What I'd do:
a) Keep the smtproutes file like you have it.
b) Create a directory
      /var/qmail/moved  mode 755
   create in this directory a file  .qmail-user1  mode 644
   and put inside this file
#------------------------------------------------------------------------
&user2@ftp2.valor.com
#------------------------------------------------------------------------
   You have to choose a user und whos permissions this kind of email
   will be handled. I usually use (on my system) the user pop:68:68
   This will also be used laster in the users/assign file.
   Do a    chown 68:68 /var/qmail/moved  /var/qmail/moved/.qmail-user1
   Nothing happens to the running system yet.

c) create the control/virtualdomains file and add the line
#------------------------------------------------------------------------
user2@valor.com:moved
#------------------------------------------------------------------------
   This "moved" at the right side of the colon is an identificator (or
   an user) that will control delivery of messages to  user2@ftp2.valor.com
   This user should NOT exist on your system. If you have a user with
   such a name, choose another identificator.
   The email will now get delivered to
       moved-user2@valor.com
   Nothing happens to the running system yet.

d) Now we're going to create the pseudo user "moved".
   edit  /var/qmail/users/assign
   and put the following two lines in there (the second one is a single
   dot alone on a line and must be there).
#------------------------------------------------------------------------
+moved-:pop:68:68:/var/qmail/moved:-::
.
#------------------------------------------------------------------------
   This is a "wildcard match"  and matches every user that starts with
       moved-
   The controlling directory will be  /var/qmail/moved  (i.e. where the
   .qmail files live). The "moved-" part will be removed when matching
   .qmail files. This means
	user2@valor.com
	  ->  moved-user2@valor.com
	    -> /var/qmail/moved/.qmail-user2
	      ->  user2@ftp2.valor.com
   Nothing happens to the running system yet.

e) Now activate the new setup:
   1) Run   /var/qmail/bin/qmail-newu
      this compiles users/assign to users/cdb
   2) kill -HUP <pid_of_qmail-send>
      to make qmail-send notice the new/changes to control/virtualdomains.
   3) Test the new delivery.

> I want to be able to move users incrementally from mail server 
> vsun14 to ftp2.

f) To move user3, user4, ...
   You only have to create
       /var/qmail/moved/.qmail-user3
	containing	&user3@ftp2.valor.com
       /var/qmail/moved/.qmail-user4
	containing	&user4@ftp2.valor.com
       ...
   and add entries
	user3@valor.com:moved
	user4@valor.com:moved
   to control/virtualdomains and the send a kill -HUP to qmail-send.
   Just watch out for ownership and modes of the .qmail files.

g) Once you have completed the move for all users change smtproutes for
   valor.com to point to ftp2.valor.com.
   After that you can remove virtualdomains and users/assign and users/cdb
   and again kill -HUP qmail-send

Hope that helps!

	\Maex

-- 
SpaceNet AG               |   http://www.Space.Net/   | Stress is when you wake
Research & Development    | mailto:maex-sig@Space.Net | up screaming and you
Joseph-Dollinger-Bogen 14 |  Tel: +49 (89) 32356-0    | realize you haven't
D-80807 Muenchen          |  Fax: +49 (89) 32356-299  | fallen asleep yet.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic