Re: migrate from group alias to mailing list

Asif Iqbal <[email protected]> Thu, 18 Jun 2009 16:36:09 -0400
Newsgroups gmane.mail.ezmlm,gmane.mail.qmail.general
Message-ID <[email protected]>
--0016e64ec942a61a4b046ca55b73
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On Thu, Jun 18, 2009 at 2:46 PM, Charles Cazabon <
[email protected]> wrote:

> Asif Iqbal <[email protected]> wrote:
> >
> > How do I pause all emails coming to [email protected] while doing
> > this migration?
>
> Easiest way is to stop qmail-smtmd (to prevent messages arriving) or stop
> qmail-send (to prevent messages already in the queue from being delivered)
> or
> both.  Then do your changeover and restart the service(s).
>
> While you have qmail-smtpd down, you can put '|bouncesaying "Use
> [email protected] mailing list instead"' in ~alias/.qmail-mygroup if you
> like.
> If you don't want to stop services, you can create the mailing list then
> simply replace this .qmail file atomically, which will accomplish the same
> thing.
>

Ok so instead of playing with the active .qmail-mygroup file, I did a test
with some other file

(alias)@qmail:~$ touch .qmail-newtest
(alias)@qmail:~$ ezmlm-make -gsrl -5 [email protected] /maildisk/
example.net/newtest ~/.qmail-newtest newtest example.net
ezmlm-make: fatal: unable to create /var/qmail/alias/.qmail-newtest: file
already exists

That does make sense. So lets try little different approach.

(alias)@qmail:~$ rm -rf /maildisk/example.net/newtest
(alias)@qmail:~$ ezmlm-make -gsrl -5 [email protected] /maildisk/
example.net/newtest ~/.qmail-newtest2 newtest example.net
(alias)@qmail:~$ ls -al .qmail-newtest2*
lrwxrwxrwx   1 alias    qmail         36 Jun 18 20:23 .qmail-newtest2 ->
/maildisk/example.net/newtest/editor
lrwxrwxrwx   1 alias    qmail         37 Jun 18 20:23
.qmail-newtest2-default -> /maildisk/example.net/newtest/manager
lrwxrwxrwx   1 alias    qmail         35 Jun 18 20:23 .qmail-newtest2-owner
-> /maildisk/example.net/newtest/owner
lrwxrwxrwx   1 alias    qmail         37 Jun 18 20:23
.qmail-newtest2-return-default -> /maildisk/example.net/newtest/bouncer

So now I have to rename them to .qmail-newtest-*
(alias)@qmail:~$ mv .qmail-newtest2-default .qmail-newtest-default
(alias)@qmail:~$ mv .qmail-newtest2-owner .qmail-newtest-owner
(alias)@qmail:~$ mv .qmail-newtest2-return-default
.qmail-newtest-return-default
(alias)@qmail:~$ rm .qmail-newtest2
(alias)@qmail:~$ ls -al
.qmail-newtest*

-rw-r--r--   1 alias    qmail          0 Jun 18 20:31 .qmail-newtest
lrwxrwxrwx   1 alias    qmail         37 Jun 18 20:29 .qmail-newtest-default
-> /maildisk/example.net/newtest/manager
lrwxrwxrwx   1 alias    qmail         35 Jun 18 20:29 .qmail-newtest-owner
-> /maildisk/example.net/newtest/owner
lrwxrwxrwx   1 alias    qmail         37 Jun 18 20:29
.qmail-newtest-return-default -> /maildisk/example.net/newtest/bouncer
(alias)@qmail:~$ ls -al /maildisk/example.net/newtest/editor

-rw-------   1 alias    nofiles      207 Jun 18 20:06 /maildisk/
example.net/newtest/editor
(alias)@qmail:~$ rm .qmail-newtest && ln -s /maildisk/
example.net/newtest/editor .qmail-newtest

I am guessing the last step is not atomic. Is it? Also is this how you were
referring to do as the second option?




> Charles
> --
> -----------------------------------------------------------------------
> Charles Cazabon
> GPL'ed software available at:               http://pyropus.ca/software/
> -----------------------------------------------------------------------
>



-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

--0016e64ec942a61a4b046ca55b73
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">On Thu, Jun 18, 2009 at 2:46 PM, Charles Cazabon=
 <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]"=
>[email protected]</a>&gt;</span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); marg=
in: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class=3D"im">Asif Iqbal &lt;<a href=3D"mailto:[email protected]">vadud3=
@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; How do I pause all emails coming to <a href=3D"mailto:mygroup@example.=
net">[email protected]</a> while doing<br>
&gt; this migration?<br>
<br>
</div>Easiest way is to stop qmail-smtmd (to prevent messages arriving) or =
stop<br>
qmail-send (to prevent messages already in the queue from being delivered) =
or<br>
both. =A0Then do your changeover and restart the service(s).<br>
<br>
While you have qmail-smtpd down, you can put &#39;|bouncesaying &quot;Use<b=
r>
<a href=3D"mailto:[email protected]">[email protected]</a> mailing list instead=
&quot;&#39; in ~alias/.qmail-mygroup if you like.<br>
If you don&#39;t want to stop services, you can create the mailing list the=
n<br>
simply replace this .qmail file atomically, which will accomplish the same<=
br>
thing.<br>
</blockquote><div><br>Ok so instead of playing with the active .qmail-mygro=
up file, I did a test with some other file<br><br>(alias)@qmail:~$ touch .q=
mail-newtest<br>(alias)@qmail:~$ ezmlm-make -gsrl -5 <a href=3D"mailto:owne=
[email protected]">[email protected]</a> /maildisk/<a href=3D"http://example.ne=
t/newtest">example.net/newtest</a> ~/.qmail-newtest newtest <a href=3D"http=
://example.net">example.net</a>=A0=A0=A0=A0 <br>
ezmlm-make: fatal: unable to create /var/qmail/alias/.qmail-newtest: file a=
lready exists<br><br>That does make sense. So lets try little different app=
roach.<br><br>(alias)@qmail:~$ rm -rf /maildisk/<a href=3D"http://example.n=
et/newtest">example.net/newtest</a><br>
(alias)@qmail:~$ ezmlm-make -gsrl -5 <a href=3D"mailto:[email protected]">o=
[email protected]</a> /maildisk/<a href=3D"http://example.net/newtest">examp=
le.net/newtest</a> ~/.qmail-newtest2 newtest <a href=3D"http://example.net"=
>example.net</a><br>
(alias)@qmail:~$ ls -al .qmail-newtest2*<br>lrwxrwxrwx=A0=A0 1 alias=A0=A0=
=A0 qmail=A0=A0=A0=A0=A0=A0=A0=A0 36 Jun 18 20:23 .qmail-newtest2 -&gt; /ma=
ildisk/<a href=3D"http://example.net/newtest/editor">example.net/newtest/ed=
itor</a><br>lrwxrwxrwx=A0=A0 1 alias=A0=A0=A0 qmail=A0=A0=A0=A0=A0=A0=A0=A0=
 37 Jun 18 20:23 .qmail-newtest2-default -&gt; /maildisk/<a href=3D"http://=
example.net/newtest/manager">example.net/newtest/manager</a><br>
lrwxrwxrwx=A0=A0 1 alias=A0=A0=A0 qmail=A0=A0=A0=A0=A0=A0=A0=A0 35 Jun 18 2=
0:23 .qmail-newtest2-owner -&gt; /maildisk/<a href=3D"http://example.net/ne=
wtest/owner">example.net/newtest/owner</a><br>lrwxrwxrwx=A0=A0 1 alias=A0=
=A0=A0 qmail=A0=A0=A0=A0=A0=A0=A0=A0 37 Jun 18 20:23 .qmail-newtest2-return=
-default -&gt; /maildisk/<a href=3D"http://example.net/newtest/bouncer">exa=
mple.net/newtest/bouncer</a><br>
<br>So now I have to rename them to .qmail-newtest-* <br>(alias)@qmail:~$ m=
v .qmail-newtest2-default .qmail-newtest-default<br>(alias)@qmail:~$ mv .qm=
ail-newtest2-owner .qmail-newtest-owner<br>(alias)@qmail:~$ mv .qmail-newte=
st2-return-default .qmail-newtest-return-default<br>
(alias)@qmail:~$ rm .qmail-newtest2<br>(alias)@qmail:~$ ls -al .qmail-newte=
st*=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <br>-rw-r--r--=A0=
=A0 1 alias=A0=A0=A0 qmail=A0=A0=A0=A0=A0=A0=A0=A0=A0 0 Jun 18 20:31 .qmail=
-newtest<br>
lrwxrwxrwx=A0=A0 1 alias=A0=A0=A0 qmail=A0=A0=A0=A0=A0=A0=A0=A0 37 Jun 18 2=
0:29 .qmail-newtest-default -&gt; /maildisk/<a href=3D"http://example.net/n=
ewtest/manager">example.net/newtest/manager</a><br>lrwxrwxrwx=A0=A0 1 alias=
=A0=A0=A0 qmail=A0=A0=A0=A0=A0=A0=A0=A0 35 Jun 18 20:29 .qmail-newtest-owne=
r -&gt; /maildisk/<a href=3D"http://example.net/newtest/owner">example.net/=
newtest/owner</a><br>
lrwxrwxrwx=A0=A0 1 alias=A0=A0=A0 qmail=A0=A0=A0=A0=A0=A0=A0=A0 37 Jun 18 2=
0:29 .qmail-newtest-return-default -&gt; /maildisk/<a href=3D"http://exampl=
e.net/newtest/bouncer">example.net/newtest/bouncer</a><br>(alias)@qmail:~$ =
ls -al /maildisk/<a href=3D"http://example.net/newtest/editor">example.net/=
newtest/editor</a>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0 <br>
-rw-------=A0=A0 1 alias=A0=A0=A0 nofiles=A0=A0=A0=A0=A0 207 Jun 18 20:06 /=
maildisk/<a href=3D"http://example.net/newtest/editor">example.net/newtest/=
editor</a><br>(alias)@qmail:~$ rm .qmail-newtest &amp;&amp; ln -s /maildisk=
/<a href=3D"http://example.net/newtest/editor">example.net/newtest/editor</=
a> .qmail-newtest <br>
<br>I am guessing the last step is not atomic. Is it? Also is this how you =
were referring to do as the second option?<br><br><br><br></div><blockquote=
 class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); =
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Charles<br>
<font color=3D"#888888">--<br>
-----------------------------------------------------------------------<br>
Charles Cazabon<br>
GPL&#39;ed software available at: =A0 =A0 =A0 =A0 =A0 =A0 =A0 <a href=3D"ht=
tp://pyropus.ca/software/" target=3D"_blank">http://pyropus.ca/software/</a=
><br>
-----------------------------------------------------------------------<br>
</font></blockquote></div><br><br clear=3D"all"><br>-- <br>Asif Iqbal<br>PG=
P Key: 0xE62693C5 KeyServer: <a href=3D"http://pgp.mit.edu">pgp.mit.edu</a>=
<br>A: Because it messes up the order in which people normally read text.<b=
r>
Q: Why is top-posting such a bad thing?<br><br><br>

--0016e64ec942a61a4b046ca55b73--