Obsolete Releases > SME 8.x Contribs

ezmlm - How can I change the domain name of a list?

(1/1)

holck:
My SME server hosts several domains, and now I want to change an ezmlm mailing list from one of these domains to another. That is, I have a list like mylist@myfirstdomain.org, and now I want to change the list to be mylist@myseconddomain.org, both domains hosted on the same server, same IP address. Ideally, I would like the list to respond to both addresses.

I have searched a lot, but cannot find any explanations on how to do this... Any suggestions?

Jesper, Denmark

Jean-Philippe Pialasse:
Hello Jesper,


--- Code: ---db accounts show MyMailingList
MyMailingList=mailinglist
    Description=My description
    Domain=MyDomain.com
    Owner=admin
--- End code ---


i guess that a


--- Code: ---db accounts setprop MyMailingList Domain MyDomain2.com
--- End code ---
would be a first step.

and maybe a
siganl-event mailinglist-modify MyMailingList



i have checked both qpsmtpd and qmail configuration, and they all appears to accept all domains configured (qpsmtpd) or at least not to filter them(qmail).


If it is not enough, then i guess you will have to do a sed s/MyDomain.com/MyDomain2.com/g to do in all files directory /home/e-smith/files/ezmlm/lists/MyMailingList and also in /home/e-smith/files/ezmlm/@.qmail-MyMailingList

and also in /home/e-smith/files/ezmlm/lists/MyMailingList/text folder

as usual backup before, and try it on a test mailing list first.

holck:
Thanks, unilennium, it seems to work :-)

Just a few improvements... you should do this:


--- Code: ---for f in /home/e-smith/files/ezmlm/lists/MyMailingList/* ; do sed -i s/MyDomain.com/MyDomain2.com/g $f; done
--- End code ---
and

--- Code: ---for f in /home/e-smith/files/ezmlm/lists/MyMailingList/text/* ; do sed -i s/MyDomain.com/MyDomain2.com/g $f; done
--- End code ---

The -i switch to sed edites the files "in place", and keeps ownership and access rights.

Thanks,
Jesper

Jean-Philippe Pialasse:
I will add this to the wiki !

thanks Jesper for sharing with us your work, after i helped you a little to point in the right direction.

can you confirm your mailing list is up to date and running with the new domain ?

holck:
I have not done a thorough test, but I believe it is mostly ok. One problem with my suggestions in my last post, is that it also tries to edit logfiles etc. So I have come up with a small, and, I think, better script:

--- Code: ---#! /bin/sh
read -p "Please enter name of existing mailing list: " list
olddomain=`/sbin/e-smith/db accounts getprop $list Domain`
echo ".. and the new domain name as one of the following:"
/sbin/e-smith/db domains keys
read -p ".. new domain name: " newdomain
echo "Changing mailing address for list $list"
echo "from $list@$olddomain"
echo "to   $list@$newdomain"
read -p "OK? (y/n) " yn
if [ "$yn" != "y" ]
 then
 echo "Exiting ..."
 exit
fi
/sbin/e-smith/db accounts setprop $list Domain $newdomain
/sbin/e-smith/signal-event mailinglist-modify $list
for f in config editor owner bouncer mailer moderator headeradd prefix listid inhost outhost
do
  file = "/home/e-smith/files/ezmlm/lists/$list/$f"
  [ -a $file ] && sed -i.bak s/$olddomain/$newdomain/g $file
done
for file in /home/e-smith/files/ezmlm/lists/$list/text/*
do
  sed -i.bak s/$olddomain/$newdomain/g $file
done

--- End code ---

Navigation

[0] Message Index

Go to full version