Re: how do I resync two machines after MX confusion ?

2000-06-29 Thread Scott Gifford

Interestingly, I'm in a similar situation, only my messages are still
in the queue.  Normally, I would just put ":new.server.name" in my
smtproutes, and have it dump its queue, but it's already put all of
the local messages in the "local" section of the queue, which doesn't
look at smtproutes.  Is there a clever way to make this work?

Can I just move them into the remote directory, then run the queue?
Or tar up the queue directory, move it onto the new machine in a temp
directory, run qmail-qfix, and then rename the files over into their
new locations?

Any suggestions would be much appreciated.

-ScottG.

[EMAIL PROTECTED] writes:

 It depends on where the mail is on this clone server. Is it in the
 mail queue or has it been locally delivered to users there?

 The former is much easier to deal with than the latter.


 Regards.

 On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:
 
  First of all, this is a really stupid situation we should never have run
  into in the first place ; however :
 
  Due to some not so interesting reasons, for a couple of days our DNS has
  pointed to another machine with our cloned qmail-configuration on
  another IP in another town. I have complete root access to that machine.
 
  Now everything is back as before, but while this machine was MX for quite
  a bunch of virtual domains we host, the mail arrived there.
 
  What I need to do now, and I am discovering qmail, is a way to get all the
  mail from the distant server to be sent to our machine with a minimum of
  fuss and if possible transparent to the users (just being late, extra
  headers don't hurt as long as they are of the kind lusers see by default
  in their mailer).
 
  I have started plunging into the really dense documentation of qmail and
  read some interesting contributions in the archive of this list, compiled
  maildircmd and taken a look at its doc as well.
 
  While I feel that there must be a simple solution short of writing a
  brute-force-and-ignorance-script with a complete list of maildirs to be
  processed, I lack the experience to figure this out on my own.
 
  Thanks in advance to the list for some pointers to intelligent solutions
  for my stupid problem.
 
  --
  Best Regards
  André Morin
 



Re: how do I resync two machines after MX confusion ?

2000-06-29 Thread markd

On Thu, Jun 29, 2000 at 11:23:36AM -0400, Scott Gifford wrote:
 Interestingly, I'm in a similar situation, only my messages are still
 in the queue.  Normally, I would just put ":new.server.name" in my
 smtproutes, and have it dump its queue, but it's already put all of
 the local messages in the "local" section of the queue, which doesn't
 look at smtproutes.  Is there a clever way to make this work?
 
 Can I just move them into the remote directory, then run the queue?
 Or tar up the queue directory, move it onto the new machine in a temp
 directory, run qmail-qfix, and then rename the files over into their
 new locations?

Assuming the local deliveries are currently failing temporarily (perhaps
due to a home dir not existing or somesuch), then probably the easiest
thing is to create a default alias that catches all those mails and
delivers them to a Maildir, then use maildirtosmtp out of the serialmail
package.

I don't know of an easy way to change a local delivery to a remote
delivery by twiddling the queue. That decision is made as part of the
queue entry creation, not part of the rescan of qmail-send.


Regards.

 
 Any suggestions would be much appreciated.
 
 -ScottG.
 
 [EMAIL PROTECTED] writes:
 
  It depends on where the mail is on this clone server. Is it in the
  mail queue or has it been locally delivered to users there?
  
  The former is much easier to deal with than the latter.
  
  
  Regards.
  
  On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:
   
   First of all, this is a really stupid situation we should never have run
   into in the first place ; however :
   
   Due to some not so interesting reasons, for a couple of days our DNS has
   pointed to another machine with our cloned qmail-configuration on
   another IP in another town. I have complete root access to that machine. 
   
   Now everything is back as before, but while this machine was MX for quite
   a bunch of virtual domains we host, the mail arrived there.
   
   What I need to do now, and I am discovering qmail, is a way to get all the
   mail from the distant server to be sent to our machine with a minimum of
   fuss and if possible transparent to the users (just being late, extra
   headers don't hurt as long as they are of the kind lusers see by default
   in their mailer).
   
   I have started plunging into the really dense documentation of qmail and
   read some interesting contributions in the archive of this list, compiled
   maildircmd and taken a look at its doc as well. 
   
   While I feel that there must be a simple solution short of writing a
   brute-force-and-ignorance-script with a complete list of maildirs to be
   processed, I lack the experience to figure this out on my own.
   
   Thanks in advance to the list for some pointers to intelligent solutions
   for my stupid problem.
   
   -- 
   Best Regards
   André Morin
   



Re: how do I resync two machines after MX confusion ?

2000-06-29 Thread Scott Gifford

Wouldn't I have to delete most of the passwd file and the
/var/qmail/alias directory in order for a .qmail-default to get looked
at?

And do you know of any reason why these queue-mucking techniques:

  Can I just move them into the remote directory, then run the queue?
  Or tar up the queue directory, move it onto the new machine in a temp
  directory, run qmail-qfix, and then rename the files over into their
  new locations?

would or wouldn't work?

Thanks much,

-ScottG.


[EMAIL PROTECTED] writes:

 On Thu, Jun 29, 2000 at 11:23:36AM -0400, Scott Gifford wrote:
  Interestingly, I'm in a similar situation, only my messages are still
  in the queue.  Normally, I would just put ":new.server.name" in my
  smtproutes, and have it dump its queue, but it's already put all of
  the local messages in the "local" section of the queue, which doesn't
  look at smtproutes.  Is there a clever way to make this work?
 
  Can I just move them into the remote directory, then run the queue?
  Or tar up the queue directory, move it onto the new machine in a temp
  directory, run qmail-qfix, and then rename the files over into their
  new locations?

 Assuming the local deliveries are currently failing temporarily (perhaps
 due to a home dir not existing or somesuch), then probably the easiest
 thing is to create a default alias that catches all those mails and
 delivers them to a Maildir, then use maildirtosmtp out of the serialmail
 package.

 I don't know of an easy way to change a local delivery to a remote
 delivery by twiddling the queue. That decision is made as part of the
 queue entry creation, not part of the rescan of qmail-send.


 Regards.

 
  Any suggestions would be much appreciated.
 
  -ScottG.
 
  [EMAIL PROTECTED] writes:
 
   It depends on where the mail is on this clone server. Is it in the
   mail queue or has it been locally delivered to users there?
  
   The former is much easier to deal with than the latter.
  
  
   Regards.
  
   On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:
   
First of all, this is a really stupid situation we should never have run
into in the first place ; however :
   
Due to some not so interesting reasons, for a couple of days our DNS has
pointed to another machine with our cloned qmail-configuration on
another IP in another town. I have complete root access to that machine.
   
Now everything is back as before, but while this machine was MX for quite
a bunch of virtual domains we host, the mail arrived there.
   
What I need to do now, and I am discovering qmail, is a way to get all the
mail from the distant server to be sent to our machine with a minimum of
fuss and if possible transparent to the users (just being late, extra
headers don't hurt as long as they are of the kind lusers see by default
in their mailer).
   
I have started plunging into the really dense documentation of qmail and
read some interesting contributions in the archive of this list, compiled
maildircmd and taken a look at its doc as well.
   
While I feel that there must be a simple solution short of writing a
brute-force-and-ignorance-script with a complete list of maildirs to be
processed, I lack the experience to figure this out on my own.
   
Thanks in advance to the list for some pointers to intelligent solutions
for my stupid problem.
   
--
Best Regards
André Morin
   



Re: how do I resync two machines after MX confusion ?

2000-06-29 Thread asantos


From: Scott Gifford [EMAIL PROTECTED]
And do you know of any reason why these queue-mucking techniques:

  Can I just move them into the remote directory, then run the queue?
  Or tar up the queue directory, move it onto the new machine in a temp
  directory, run qmail-qfix, and then rename the files over into their
  new locations?

would or wouldn't work?


Theres strong juju magic in the queue, related to inodes and stuff. I think
that if you try to interfere with that magic, possibly you'll get turned
into a toad :)

What you *can* try is to extract the files from the queue and mail-inject'em
in the other machine, *then* flushing the queue.

Armando

 smime.p7s


Re: how do I resync two machines after MX confusion ?

2000-06-29 Thread markd

On Thu, Jun 29, 2000 at 11:36:33AM -0400, Scott Gifford wrote:
 Wouldn't I have to delete most of the passwd file and the
 /var/qmail/alias directory in order for a .qmail-default to get looked
 at?

Ah yes, good point. Not so much delete them, but use qmail-users to override
getpwnam() (ie /etc/passwd) lookups.

 And do you know of any reason why these queue-mucking techniques:
 
   Can I just move them into the remote directory, then run the queue?
   Or tar up the queue directory, move it onto the new machine in a temp
   directory, run qmail-qfix, and then rename the files over into their
   new locations?
 
 would or wouldn't work?

No, but you can always build another instance of qmail and experiment with a
transfer and qmail-qfix there. You needn't actually start qmail to see if
the queue looks ok as qmail-qread will tell you that.


Regards.



how do I resync two machines after MX confusion ?

2000-06-28 Thread Andre Morin


First of all, this is a really stupid situation we should never have run
into in the first place ; however :

Due to some not so interesting reasons, for a couple of days our DNS has
pointed to another machine with our cloned qmail-configuration on
another IP in another town. I have complete root access to that machine. 

Now everything is back as before, but while this machine was MX for quite
a bunch of virtual domains we host, the mail arrived there.

What I need to do now, and I am discovering qmail, is a way to get all the
mail from the distant server to be sent to our machine with a minimum of
fuss and if possible transparent to the users (just being late, extra
headers don't hurt as long as they are of the kind lusers see by default
in their mailer).

I have started plunging into the really dense documentation of qmail and
read some interesting contributions in the archive of this list, compiled
maildircmd and taken a look at its doc as well. 

While I feel that there must be a simple solution short of writing a
brute-force-and-ignorance-script with a complete list of maildirs to be
processed, I lack the experience to figure this out on my own.

Thanks in advance to the list for some pointers to intelligent solutions
for my stupid problem.

-- 
Best Regards
André Morin




Re: how do I resync two machines after MX confusion ?

2000-06-28 Thread markd

On Thu, Jun 29, 2000 at 02:03:46AM +0200, Andre Morin wrote:

 Unfortunately, the second option is what I have to face.


Then unless you have a way of definitively identifying which emails
to extract from whathever local delivery method each user employs,
then you have no perfect solution.

If the user has control of the delivery/forwarding in any way,
they may not be retreivable at all. If there was some user mail on the
clone prior to the MX mixup, then you'll need a way to separate them.

If you are lucky and the only delivey method is Maildir and the only
emails on that system are ones that can be redirected, then you
can probably qmail-inject them back into your clone system with
an smtproutes entry. You may need to grep out certain Delivered-to:
headers to avoid hitting the anti-loop code of qmail.

If you are not so lucky, then it'll be painful and thankless and
probably imperfect and there is no one solution.


Regards.


  It depends on where the mail is on this clone server. Is it in the
  mail queue or has it been locally delivered to users there?
  
  The former is much easier to deal with than the latter.
  
  
  Regards.
  
  On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:
   
   First of all, this is a really stupid situation we should never have run
   into in the first place ; however :
   
   Due to some not so interesting reasons, for a couple of days our DNS has
   pointed to another machine with our cloned qmail-configuration on
   another IP in another town. I have complete root access to that machine. 
   
   Now everything is back as before, but while this machine was MX for quite
   a bunch of virtual domains we host, the mail arrived there.
 



Re: how do I resync two machines after MX confusion ?

2000-06-28 Thread Andre Morin


Unfortunately, the second option is what I have to face.

On Wed, 28 Jun 2000 [EMAIL PROTECTED] wrote:

 Date: Wed, 28 Jun 2000 17:00:11 -0700
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: how do I resync two machines after MX confusion ?
 
 It depends on where the mail is on this clone server. Is it in the
 mail queue or has it been locally delivered to users there?
 
 The former is much easier to deal with than the latter.
 
 
 Regards.
 
 On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:
  
  First of all, this is a really stupid situation we should never have run
  into in the first place ; however :
  
  Due to some not so interesting reasons, for a couple of days our DNS has
  pointed to another machine with our cloned qmail-configuration on
  another IP in another town. I have complete root access to that machine. 
  
  Now everything is back as before, but while this machine was MX for quite
  a bunch of virtual domains we host, the mail arrived there.




Re: how do I resync two machines after MX confusion ?

2000-06-28 Thread Andre Morin



On Wed, 28 Jun 2000 [EMAIL PROTECTED] wrote:

 Date: Wed, 28 Jun 2000 17:11:02 -0700
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: how do I resync two machines after MX confusion ?
 
 On Thu, Jun 29, 2000 at 02:03:46AM +0200, Andre Morin wrote:
 
  Unfortunately, the second option is what I have to face.
 
 
 Then unless you have a way of definitively identifying which emails
 to extract from whathever local delivery method each user employs,
 then you have no perfect solution.
 
 If the user has control of the delivery/forwarding in any way,
 they may not be retreivable at all. If there was some user mail on the
 clone prior to the MX mixup, 

Yes there was.

 then you'll need a way to separate them.
 
 If you are lucky and the only delivey method is Maildir and the only
 emails on that system are ones that can be redirected, then you
 can probably qmail-inject them back into your clone system with
 an smtproutes entry. You may need to grep out certain Delivered-to:
 headers to avoid hitting the anti-loop code of qmail.

Nearly all use simple maildir delivery.

How would I do this ?
Write a script to grep out the last Delivered-to: header ?
Use some qmail-program to do that ?

What would be the right way to do the qmail-inject then ?

Will I need to create a smtproute-file in spite of the fact that the
correct MX is now known to the DNS-servers used by the clone to resolve
names ?

 If you are not so lucky, then it'll be painful and thankless and
 probably imperfect and there is no one solution.
 
I am really a comple newbie to qmail, while I am discovering the doc, I am
quite amazed about its nifty design.

The other option for me would be some ugly script doing some rsync-alike
things to the maildirectories of the users. 

Thank You for your responsiveness, even if you confirm what I felt :
I'm in trouble...

 Regards.
 
 
   It depends on where the mail is on this clone server. Is it in the
   mail queue or has it been locally delivered to users there?
   
   The former is much easier to deal with than the latter.
   
   
   Regards.
   
   On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:

Due to some not so interesting reasons, for a couple of days our DNS has
pointed to another machine with our cloned qmail-configuration on
another IP in another town. I have complete root access to that machine. 

Now everything is back as before, but while this machine was MX for quite
a bunch of virtual domains we host, the mail arrived there.
  
 




Re: how do I resync two machines after MX confusion ?

2000-06-28 Thread Darcy Buskermolen

If it was delivered to maildirs, would a simple tar / FTP /untar solution
work ?? assuming ofcourse that both machines have the same maildir setup ?

At 02:38 AM 6/29/00 +0200, you wrote:


On Wed, 28 Jun 2000 [EMAIL PROTECTED] wrote:

 Date: Wed, 28 Jun 2000 17:11:02 -0700
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: how do I resync two machines after MX confusion ?
 
 On Thu, Jun 29, 2000 at 02:03:46AM +0200, Andre Morin wrote:
 
  Unfortunately, the second option is what I have to face.
 
 
 Then unless you have a way of definitively identifying which emails
 to extract from whathever local delivery method each user employs,
 then you have no perfect solution.
 
 If the user has control of the delivery/forwarding in any way,
 they may not be retreivable at all. If there was some user mail on the
 clone prior to the MX mixup, 

Yes there was.

 then you'll need a way to separate them.
 
 If you are lucky and the only delivey method is Maildir and the only
 emails on that system are ones that can be redirected, then you
 can probably qmail-inject them back into your clone system with
 an smtproutes entry. You may need to grep out certain Delivered-to:
 headers to avoid hitting the anti-loop code of qmail.

Nearly all use simple maildir delivery.

How would I do this ?
Write a script to grep out the last Delivered-to: header ?
Use some qmail-program to do that ?

What would be the right way to do the qmail-inject then ?

Will I need to create a smtproute-file in spite of the fact that the
correct MX is now known to the DNS-servers used by the clone to resolve
names ?

 If you are not so lucky, then it'll be painful and thankless and
 probably imperfect and there is no one solution.
 
I am really a comple newbie to qmail, while I am discovering the doc, I am
quite amazed about its nifty design.

The other option for me would be some ugly script doing some rsync-alike
things to the maildirectories of the users. 

Thank You for your responsiveness, even if you confirm what I felt :
I'm in trouble...

 Regards.
 
 
   It depends on where the mail is on this clone server. Is it in the
   mail queue or has it been locally delivered to users there?
   
   The former is much easier to deal with than the latter.
   
   
   Regards.
   
   On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:

Due to some not so interesting reasons, for a couple of days our
DNS has
pointed to another machine with our cloned qmail-configuration on
another IP in another town. I have complete root access to that
machine. 

Now everything is back as before, but while this machine was MX
for quite
a bunch of virtual domains we host, the mail arrived there.
  
 






Re: how do I resync two machines after MX confusion ?

2000-06-28 Thread asantos

File and directory ownership could give some headaches...

If you have good bandwidth between the machines, I again recomend
maildirsmtp.

Armando

From: Andre Morin [EMAIL PROTECTED]
I do not see any specific qmail-precautions to take while I untar the
stuff, am I right ?


 smime.p7s


Re: how do I resync two machines after MX confusion ?

2000-06-28 Thread asantos

I'd copy all the messages from all the users to the ~alias Maildir, and then
use djb's serialmail (the maildirsmtp util, to be exact) to blast'em to the
original machine.

After checking, delete the messages.

This shouldn't work with mailboxes, tough.

Armando

-Original Message-
From: Andre Morin [EMAIL PROTECTED]
How would I do this ?
Write a script to grep out the last Delivered-to: header ?
Use some qmail-program to do that ?


 smime.p7s


Re: how do I resync two machines after MX confusion ?

2000-06-28 Thread Andre Morin

On Wed, 28 Jun 2000, Darcy Buskermolen wrote:

 Date: Wed, 28 Jun 2000 17:50:43 -0700
 From: Darcy Buskermolen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: how do I resync two machines after MX confusion ?
 
 If it was delivered to maildirs, would a simple tar / FTP /untar solution
 work ?? assuming ofcourse that both machines have the same maildir setup ?

They do indeed have the same setup.

I was looking into such a brute force approach as well.
It will certainly do the trick, but I hoped to end up with a more elegant
(qmail) solution.

But it looks like I will have to do just what you suggest.

I do not see any specific qmail-precautions to take while I untar the
stuff, am I right ?

Thank you anyway to both of you, who answered my questions so quickly,
for confirming me that I did not overlook some really cheap trick.
 
 At 02:38 AM 6/29/00 +0200, you wrote:
 
 
 On Wed, 28 Jun 2000 [EMAIL PROTECTED] wrote:
 
  Date: Wed, 28 Jun 2000 17:11:02 -0700
  From: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: Re: how do I resync two machines after MX confusion ?
  
  On Thu, Jun 29, 2000 at 02:03:46AM +0200, Andre Morin wrote:
  
   Unfortunately, the second option is what I have to face.
  
  
  Then unless you have a way of definitively identifying which emails
  to extract from whathever local delivery method each user employs,
  then you have no perfect solution.
  
  If the user has control of the delivery/forwarding in any way,
  they may not be retreivable at all. If there was some user mail on the
  clone prior to the MX mixup, 
 
 Yes there was.
 
  then you'll need a way to separate them.
  
  If you are lucky and the only delivey method is Maildir and the only
  emails on that system are ones that can be redirected, then you
  can probably qmail-inject them back into your clone system with
  an smtproutes entry. You may need to grep out certain Delivered-to:
  headers to avoid hitting the anti-loop code of qmail.
 
 Nearly all use simple maildir delivery.
 
 How would I do this ?
 Write a script to grep out the last Delivered-to: header ?
 Use some qmail-program to do that ?
 
 What would be the right way to do the qmail-inject then ?
 
 Will I need to create a smtproute-file in spite of the fact that the
 correct MX is now known to the DNS-servers used by the clone to resolve
 names ?
 
  If you are not so lucky, then it'll be painful and thankless and
  probably imperfect and there is no one solution.
  
 I am really a comple newbie to qmail, while I am discovering the doc, I am
 quite amazed about its nifty design.
 
 The other option for me would be some ugly script doing some rsync-alike
 things to the maildirectories of the users. 
 
 Thank You for your responsiveness, even if you confirm what I felt :
 I'm in trouble...
 
  Regards.
  
  
It depends on where the mail is on this clone server. Is it in the
mail queue or has it been locally delivered to users there?

The former is much easier to deal with than the latter.


Regards.

On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:
 
 Due to some not so interesting reasons, for a couple of days our
 DNS has
 pointed to another machine with our cloned qmail-configuration on
 another IP in another town. I have complete root access to that
 machine. 
 
 Now everything is back as before, but while this machine was MX
 for quite
 a bunch of virtual domains we host, the mail arrived there.
   
  
 
 
 
 




Re: how do I resync two machines after MX confusion ?

2000-06-28 Thread markd

It depends on where the mail is on this clone server. Is it in the
mail queue or has it been locally delivered to users there?

The former is much easier to deal with than the latter.


Regards.

On Thu, Jun 29, 2000 at 01:56:31AM +0200, Andre Morin wrote:
 
 First of all, this is a really stupid situation we should never have run
 into in the first place ; however :
 
 Due to some not so interesting reasons, for a couple of days our DNS has
 pointed to another machine with our cloned qmail-configuration on
 another IP in another town. I have complete root access to that machine. 
 
 Now everything is back as before, but while this machine was MX for quite
 a bunch of virtual domains we host, the mail arrived there.
 
 What I need to do now, and I am discovering qmail, is a way to get all the
 mail from the distant server to be sent to our machine with a minimum of
 fuss and if possible transparent to the users (just being late, extra
 headers don't hurt as long as they are of the kind lusers see by default
 in their mailer).
 
 I have started plunging into the really dense documentation of qmail and
 read some interesting contributions in the archive of this list, compiled
 maildircmd and taken a look at its doc as well. 
 
 While I feel that there must be a simple solution short of writing a
 brute-force-and-ignorance-script with a complete list of maildirs to be
 processed, I lack the experience to figure this out on my own.
 
 Thanks in advance to the list for some pointers to intelligent solutions
 for my stupid problem.
 
 -- 
 Best Regards
 André Morin