Koozali.org formerly Contribs.org

Other Languages => Español => Topic started by: JyJ Servicio on November 27, 2019, 03:19:47 PM

Title: Problema con seudonimos
Post by: JyJ Servicio on November 27, 2019, 03:19:47 PM
Buenos dias amigos, estoy nstalando un SME 9.2 y me surge una duda, se puede evitar de alguna manera que se generen los seudonimos automaticos de nombre.apellido y nombre_apellido?. El tema es que al crear los usuarios es nuy engorroso eliminar 2 seudonimos por cada usuario creado. Desde ya muchas gracias.
Title: Re: Problema con seudonimos
Post by: ReetP on November 27, 2019, 09:19:25 PM
Buenas

Creo que hay un método pero no lo recuerdo.

Se paciente. Alguien te contestará :-)
Title: Re: Problema con seudonimos
Post by: mmccarn on November 28, 2019, 02:50:44 PM
English:
https://wiki.contribs.org/SME_Server:Documentation:FAQ:Section01#Deletion_of_Users_Ibays_Groups

Google traduce al español
https://translate.google.com/translate?sl=auto&tl=es&u=http%3A%2F%2Fwiki.contribs.org%2FSME_Server%3ADocumentation%3AFAQ%3ASection01%23Deletion_of_Users_Ibays_Groups
Title: Re: Problema con seudonimos
Post by: ReetP on November 28, 2019, 07:58:50 PM
I'm not sure that is the answer.

This was the actual question:

Quote
Can you somehow avoid generating the automatic pseudonym names.name and surname_name ?

The issue is that when creating users it is very cumbersome to delete 2 pseudonyms for each user created.
Ie how do I create a user without pseudonyms?

One option for easy deletion, but not really the answer:

https://wiki.contribs.org/Lat-pseudonyms
Title: Re: Problema con seudonimos
Post by: mmccarn on November 29, 2019, 04:23:33 PM
I'm not sure that is the answer.

This was the actual question:
Ie how do I create a user without pseudonyms?

Doh.  You're right, of course.  I mis-understood the second bit as deleting the 2 pseudonyms when deleting a user, instead of deleting them immediately for every user that gets created...

This code does not delete the pseudonyms, but it will cause SME to ignore them in qpsmtpd and qmail:
Code: [Select]
# qpsmtpd goodrcptto
# create custom template to use 'mypseudonym' instead of 'pseudonym' when building qpsmtpd recipients
mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/goodrcptto/
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/goodrcptto/
sed 's/pseudonym/mypseudonym/g' /etc/e-smith/templates/var/service/qpsmtpd/config/goodrcptto/40ValidLocalRecipients > 40ValidLocalRecipients

# qmail assign
# custom template to use 'MyAccount' instead of 'Account' when building qmail assign
mkdir -p /etc/e-smith/templates-custom/var/qmail/users/assign/
cd /etc/e-smith/templates-custom/var/qmail/users/assign/
sed "s/'Account'/'MyAccount'/g" /etc/e-smith/templates/var/qmail/users/assign/70pseudonyms > 70pseudonyms

# regenerate qpsmtpd and qmail files and restart email services
# ( signal-event email-update generates warnings; this is OK)
expand-template /var/service/qpsmtpd/config/goodrcptto
expand-template /var/qmail/users/assign
signal-event email-update

To remove:
Code: [Select]
rm -f /etc/e-smith/templates-custom/var/qmail/users/assign/70pseudonyms
rm -f /etc/e-smith/templates-custom/var/service/qpsmtpd/config/goodrcptto/40ValidLocalRecipients
expand-template /var/service/qpsmtpd/config/goodrcptto
expand-template /var/qmail/users/assign
signal-event email-update

To create a pseudonym manually after making these mods you need to create custom templates for:
/var/service/qpsmtpd/config/goodrcptto (to get the email accepted by the server)
and
/var/qmail/users/assign (to get the email delivered to a user)
Title: Re: Problema con seudonimos
Post by: mmccarn on November 29, 2019, 06:21:07 PM
...and here is a command to delete all pseudonyms from the server except for a specific list of users (I recommend leaving the pseudonyms for 'admin' and 'everyone', at least):
Code: [Select]
#list accounts, partial accounts, pseudonyms, or partial pseudonyms to be ignored, separated by vertical bar
IGNORE='admin|everyone|rita'
db accounts print |grep \=pseudonym |egrep -vi "$IGNORE" |awk -F[=\|] '{print $4 " | " $1}' |while read l; do lat-pseudonyms -d -f -c "$l" ; done

This version deletes all of the pseudonyms with format "x.y" or "x_y":
Code: [Select]
# delete all pseudonyms with format "x.y" or "x_y"
db accounts print |grep '^.\+[\._].\+=pseudonym' |awk -F[=\|] '{print $4 " | " $1}' |while read l; do lat-pseudonyms -d -f -c "$l" ; done

I have tried several times in the past to find and disable the code that generates the pseudonyms in the web interface with no success...
Title: Re: Problema con seudonimos
Post by: ReetP on November 30, 2019, 10:27:16 AM
Quote
Doh.  You're right, of course.  I mis-understood the second bit as deleting the 2 pseudonyms when deleting a user, instead of deleting them immediately for every user that gets created...

I had to read it twice, and I speak passable Spanish. Just didn't know the answer!

Nice one.

There must be something in the create-user code that does this. I need to try and have a dig.
Title: Re: Problema con seudonimos
Post by: Jean-Philippe Pialasse on February 06, 2020, 12:40:28 PM
https://bugs.contribs.org/show_bug.cgi?id=9457