Koozali.org: home of the SME Server

Problema con seudonimos

Offline JyJ Servicio

  • 1
  • +0/-0
  • Servicios tecnologicos y marketing digital
Problema con seudonimos
« 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.

Offline ReetP

  • *
  • 3,881
  • +5/-0
Re: Problema con seudonimos
« Reply #1 on: November 27, 2019, 09:19:25 PM »
Buenas

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

Se paciente. Alguien te contestará :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation


Offline ReetP

  • *
  • 3,881
  • +5/-0
Re: Problema con seudonimos
« Reply #3 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
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mmccarn

  • *
  • 2,649
  • +10/-0
Re: Problema con seudonimos
« Reply #4 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)

Offline mmccarn

  • *
  • 2,649
  • +10/-0
Re: Problema con seudonimos
« Reply #5 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...

Offline ReetP

  • *
  • 3,881
  • +5/-0
Re: Problema con seudonimos
« Reply #6 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.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,852
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Problema con seudonimos
« Reply #7 on: February 06, 2020, 12:40:28 PM »