Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

migrate from group alias to mailing list

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


vadud3 at gmail

Jun 18, 2009, 10:51 AM

Post #1 of 5 (1000 views)
Permalink
migrate from group alias to mailing list

I have a group alias like this

(alias)@qmail:~$ cat ~alias/.qmail-mygroup
user1[at]example.net
user2[at]example.net

I like to convert it to mailing list

(alias)@qmail:~$ mv .qmail-mygroup .qmail-mygroup.expired
(alias)@qmail:~$ ezmlm-make -gsrl -5 owner[at]example.net
/maildisk/example.net/mygroup ~/.qmail-mygroup mygroup example.net
(alias)@qmail:~$ ezmlm-sub /maildisk/example.net/mygroup
user1[at]example.net user2[at]example.net
(alias)@qmail:~$ ezmlm-sub /maildisk/example.net/mygroup/mod
moderator[at]example.net

How do I pause all emails coming to mygroup[at]example.net while doing
this migration?

--
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?


search-web-for-address at pyropus

Jun 18, 2009, 11:46 AM

Post #2 of 5 (930 views)
Permalink
Re: migrate from group alias to mailing list [In reply to]

Asif Iqbal <vadud3[at]gmail.com> wrote:
>
> How do I pause all emails coming to mygroup[at]example.net 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
foo[at]example.net 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.

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


vadud3 at gmail

Jun 18, 2009, 1:36 PM

Post #3 of 5 (929 views)
Permalink
Re: migrate from group alias to mailing list [In reply to]

On Thu, Jun 18, 2009 at 2:46 PM, Charles Cazabon <
search-web-for-address[at]pyropus.ca> wrote:

> Asif Iqbal <vadud3[at]gmail.com> wrote:
> >
> > How do I pause all emails coming to mygroup[at]example.net 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
> foo[at]example.net 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 owner[at]example.net /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 owner[at]example.net /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?


afarrell at kavi

Jun 18, 2009, 3:27 PM

Post #4 of 5 (929 views)
Permalink
Re: migrate from group alias to mailing list [In reply to]

You should be able to pause mail delivery safely and easily by setting
the "alias" directory. See "SAFEQMAIL EDITING" here:
http://www.qmail.org/man/man5/dot-qmail.html (or ideally in the
dot-qmail man page on your own system).

qmail will temporarily defer messages while the sticky bit is set on the
user's (in this case alias) home directory.

I don't remember when I ran into this, but it stuck in my mind because
it's not intuitive.

- Amy

Asif Iqbal wrote:
> I have a group alias like this
>
> (alias)@qmail:~$ cat ~alias/.qmail-mygroup
> user1[at]example.net
> user2[at]example.net
>
> I like to convert it to mailing list
>
> (alias)@qmail:~$ mv .qmail-mygroup .qmail-mygroup.expired
> (alias)@qmail:~$ ezmlm-make -gsrl -5 owner[at]example.net
> /maildisk/example.net/mygroup ~/.qmail-mygroup mygroup example.net
> (alias)@qmail:~$ ezmlm-sub /maildisk/example.net/mygroup
> user1[at]example.net user2[at]example.net
> (alias)@qmail:~$ ezmlm-sub /maildisk/example.net/mygroup/mod
> moderator[at]example.net
>
> How do I pause all emails coming to mygroup[at]example.net while doing
> this migration?
>


kyle-ezmlm at memoryhole

Jun 18, 2009, 3:31 PM

Post #5 of 5 (891 views)
Permalink
Re: migrate from group alias to mailing list [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Thursday, June 18 at 04:36 PM, quoth Asif Iqbal:
>(alias)@qmail:~$ rm -rf /maildisk/example.net/newtest
>(alias)@qmail:~$ ezmlm-make -gsrl -5 owner[at]example.net /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-*

Sounds like a good plan.

>(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

Why'd you delete that last one? I think the right thing to do is:

$ mv .qmail-newtest2 .qmail-newtest

(which IS atomic)

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

Yes, the rename process isn't atomic, but consider what you're doing:
you're converting a multiple-redirect file into a mailing list. Who
cares whether the surrounding email addresses (e.g. newtest-owner) are
established atomically? All that really matters is that if any message
is sent to newtest[at]yourserver, it goes either to the old list of
addresses or to the new mailing list and that there's no chance of
qmail getting confused and perhaps sending it to only a few of the old
addresses.

Of course, another way to do it would be to use the qmail-users
mechanism. Thus, you could create your ezmlm list elsewhere, put the
.qmail files just about anywhere, and then use a qmail-users alias to
specify where the list's .qmail files are (i.e. NOT in the ~alias
folder), and update the qmail-users database atomically (with
`qmail-newu`).

~Kyle
- --
Power always thinks it has a great soul and vast views beyond the
comprehension of the weak; and that it is doing God's service when it
is violating all his laws.
-- John Adams
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iQIcBAEBCAAGBQJKOsA1AAoJECuveozR/AWeUV4QALeG57/oLslJkR1NCJROX1VL
WTtd3SRedK70M2+X1WTPjlx2mhETLeQgbSNP3S+oDiN01U3HCayEec4B0oNZXjVL
rfI62EvqBnxQcm/mfA2cHH7XeWrFe+mLcK26zhwyuGtKFUao3MBiq/Kjvw+wsWIR
sIEbq3R26tVQtI8o+5gn7Hss1DaUZxeGBFXMM6rmpxHKxAWNPmYbt8t5Ksl+Avcc
HlM1j34RCjP2Av1Ty50sHyWvFkPtSmCrLKF32A+pWJP8pWINK8Btw6fnYqqTQS27
cjaWixQQ9TauIetwdkuPaXNqOmQLC/hRvGZdrLe44HKfO9/foJYu0IH1N6YYKoVV
tQ7UtGeYEA4UIZSTYmAeXroSfeZ7Rz2gftBqL3gLMSyu8MeicjWwF2WdxPGgRqpJ
CQsHUB9aPgUSSuUMVZa3GuJAscJ2c1IFfcE1ZB2ogfZb6kJScHImMS55gWp7Pj3P
uDNo56TpevCy+OQ8tTzbacjm17XXgQnDhyEG5yTsHtncAitNbdRU0ax5wJeR1agz
oApJ+W5y3MY0+RYIHC4SXv9OS/MFBww7dVDAYu0Lb+9PNY/EUJJut0mKNtMlVRWu
qSTyWTAXfh+5wuFgXMTXrbTdx/xbI7mX5BVxfRyS0cswy1cKaoMZh6E3L3iAgw+3
r0U0kqEIFVKFS22ZxkLt
=SsK+
-----END PGP SIGNATURE-----

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.