Koozali.org: home of the SME Server

Obsolete Releases => SME Server 8.x => Topic started by: CmdLn on March 28, 2014, 04:55:19 PM

Title: Rename admin account
Post by: CmdLn on March 28, 2014, 04:55:19 PM
I need to rename the admin account to something like smeadmin so that I can use admin as a standard account specifically for email. I am installing SME 8 as a replacement for RedHat and we already use the email address admin@ourdomain.com for receiving email for the admin department for a few years now.

I see I am not the first person who wants this and I looked into doing it myself but there are just too many files to change.

/etc/passwd, /etc/shadow, /etc/group, /etc/gshadow and a lot of files in /etc/e-smith/tests and /etc/services to name just a few. Has anybody done this before? It would be really useful to a lot of people I think.

I am really stuck here and at the very least need to be able redirect mail for admin to another user, but obviously don't want to receive system related stuff on that account.
Title: Re: Rename admin account
Post by: TerryF on March 28, 2014, 08:16:54 PM
See this post for what may be your solution
http://forums.contribs.org/index.php/topic,40671.msg188343.html#msg188343
Title: Re: Rename admin account
Post by: CmdLn on March 29, 2014, 07:30:20 AM
Thanks Terry, but that's a temporary solution and the new virtual domain user receives system email. I was hoping somebody had a perminent solution to this problem.
Title: Re: Rename admin account
Post by: Stefano on March 29, 2014, 01:56:13 PM
Thanks Terry, but that's a temporary solution and the new virtual domain user receives system email. I was hoping somebody had a perminent solution to this problem.

AFAIK there's NO solution to this "problem".. it's so by design.. you should/could file a bug/NFR in bugzilla
Title: Re: Rename admin account
Post by: idp_qbn on March 29, 2014, 08:15:20 PM
Why not just change the Admin department's email address? The department probably isn't called Admin, anyway - most likely Administration.

People and organisations routinely change email addresses, tell the clients/friends and after a little while things settle down and the world does not come to an end.

There does not always have to be a techno-fix for every human problem.

When you start fiddling with the internal workings of a server (any server,not just SME) then you are striking out into the wilds of No Man's Land and there's no-one there to help you.

The effort involved in changing the admin department's email address is small compared to the ongoing maintenance issues you face with changing the server OS to something uniquely yours.

Cheers
Ian :-)
Title: Re: Rename admin account
Post by: janet on March 29, 2014, 10:55:10 PM
CmdLine

The admin name is hard coded & not likely to ever change in sme server for the forseeable future, it has been that way since inception of sme server back in 1999 or so. If you lodge a new feature request (NFR), which is a good idea to do, then even if someone starts work on it now, the feature will not get into sme server until at least v9.1, which is probably a year or more away (minimally & if the NFR is adopted).

You could use procmail or mailsorting (contrib) etc to filter the admin mail, so that system messages get forwarded to another user, say sysadmin@mydomain.

If external incoming admin@ mail is the main concern, you could configure external DNS/zone records to forward admin@mydomain to another email address.

Quote
....but that's a temporary solution and the new virtual domain user receives system email. I was hoping somebody had a perminent solution to this problem.

Why do you feel that is a temporary solution ? The situation described was a temporary one until they stopped using the admin mail account, but it does not make the fix a temporary one.

You can permanently give your sme server a new main domain name of abc.dyndns.org or mydomain2.com (or whatever valid domain name you prefer), then create a virtual domain in the Domains panel, for your current main domain name, say mydomain.com
Then create the pseudonym admin@mydomain.com which forwards to whichever normal user currently receives the businesses administrative type admin mail.

System/root mail etc will automatically go to admin@abc.dyndns.org (or whichever domain you select as the main server domain), & can then be forwarded "as usual" to the sysadmin user via the User panel in server manager.

All other email messages will go to the normal users, as they are valid users for the main domain & the virtual domain.

Ultimately the best option will be to discontinue the use of admin for business adminstrative mail, as sme server is not likely to change in the immediate & forseeable future.

You could offer to pay someone to rewrite the code to make the system mail account configurable, & hopefully someone would be willing to do the coding. That's how many new features have made their way into sme code, by corporate sponsorship.
Title: Re: Rename admin account
Post by: janet on March 29, 2014, 11:28:55 PM
CmdLine

Quote
....the new virtual domain user receives system email.

That is an incorrect statement.

"Users" associated with any virtual domain email address, can be managed with pseudonyms.

The pseudonym admin@newvirtualdomain will only receive mail specifically sent to that address (which in your case would be the currently used admin@ourdomain), & then delivered to the nominated end user account as per the pseudonym setting.

System admin (root) mail will NOT be delivered there.
Only the main sme server domain (as configured in admin console) admin user, will receive system mail (eg mail for root & system messages etc).
Title: Re: Rename admin account
Post by: CmdLn on April 02, 2014, 09:48:04 AM
Thanks Janet, I am going to try the mailsorting contrib. I did have a go at using procmail before posting here but my .procmail entries were ignored so I assumed procmail is not in use?

idp_qbn: I would love to just change the admin email address to administration but my employer does not agree.

Title: Re: Rename admin account
Post by: Stefano on April 02, 2014, 10:01:08 AM
Thanks Janet, I am going to try the mailsorting contrib.

just a question: why?

the solution you've been given doesn't need it
Title: Re: Rename admin account
Post by: CmdLn on April 02, 2014, 01:22:17 PM
1. I dont want to run the server as temporary / free second domain name. I believe this domain name will filter through to all other SME modules and show externally or even distribute internally the "fake" domain name.

2. The server is now live since 29 March and has processed 60,000 messages since. Installing a new server, as the post suggests seems more risky to me than installing a new contribution to filter admin mail.
Title: Re: Rename admin account
Post by: Stefano on April 02, 2014, 01:50:25 PM
doh.. I think you missed the point..

let's say your domain is yourdomain.net and your SME uses it as primary domain

- reconfigure your server to have yourdomain.local as primary domain: nothing, not a single bit will be lost
- add a new domain: yourdomain.net
- add a new user, let's say mydomainuseradmin
- ad a new pseudonymn for mydomainuseradmin with email admin@yourdomain.net

you're done.. everything is still in place, you have what you are asking for..
Title: Re: Rename admin account
Post by: CmdLn on April 03, 2014, 07:50:55 AM
Ok you guys were right. I didnt think of having a .local or .private as the primary domain. "doh"

I tested this on a VM and the messages are routed as expected. I will make this change to our live server tonight when the traffic flow is lower.
Title: Re: Rename admin account
Post by: idp_qbn on April 03, 2014, 10:39:59 AM
Stefano - that solution was just so-o-o simple.

Now that I see what you suggested and how it works, it seems obvious. But like many things in life, what should seem obvious often is not.

Well done.

Cheers
Ian :smile:
Title: Re: Rename admin account
Post by: Stefano on April 03, 2014, 10:44:38 AM
Ian.. that solution was suggested by raem here: http://forums.contribs.org/index.php/topic,40671.msg188360.html#msg188360

;-)

Stefano and "date a Cesare quel che รจ di Cesare" (http://en.wikipedia.org/wiki/Render_unto_Caesar)

Title: Re: Rename admin account
Post by: stephdl on April 03, 2014, 04:35:27 PM
Ian, stefano, please could you add this in the faq or in the relevant email wiki page...this has to be written.

Many thanks
Title: Re: Rename admin account
Post by: CmdLn on April 04, 2014, 08:36:54 AM
A word of warning for those who want to make this change - Changing the primary domain name changes the mail server name in the mail server modules.

If you are using SSL and Outlook like we do you will get a message something like "The server you are connected to is using a security certificate that cannot be verified: The target principle name is incorrect".

I wasnt popular this morning when everybody got to work!

Title: Re: Rename admin account
Post by: stephdl on April 04, 2014, 10:33:00 AM
I believe that you can adapt your certificate to your new domain : http://wiki.contribs.org/Certificates_Concepts#How_to_change_your_certificate
Title: Re: Rename admin account
Post by: CmdLn on April 04, 2014, 12:26:25 PM
Another side effect - Mail from webmail goes out as user@yourdomain.local so recipients cannot reply.
Title: Re: Rename admin account
Post by: CmdLn on April 04, 2014, 12:35:42 PM
This is all a massive hack and inconvenience just to get 1 users email sorted out. It really would be much better if you could just rename the admin user or even choose one you want at install time. At the very least I think they should consider renaming the admin user to something less common like sme-admin in the next distro.
Title: Re: Rename admin account
Post by: janet on April 04, 2014, 03:34:54 PM
CmdLine
Quote
Another side effect - Mail from webmail goes out as user@yourdomain.local so recipients cannot reply.

This is mentioned in the Pseudonyms section of the manual, near the end IIRC.
You need to login to webmail as each user & change the profile to reflect the domain they are using, so their return address is name@yourdomain.com etc.

You do need to think through the ramifications of changing the main server domain.
Title: Re: Rename admin account
Post by: janet on April 04, 2014, 03:49:40 PM
CmdLine

Quote
This is all a massive hack and inconvenience just to get 1 users email sorted out.

It has been hardcoded in sme server for 15 years, so will take some effort to change.

It is really far simpler for you to stop using the admin name for business administration purposes.
You have been given workarounds, if you don't like the work involved to utilise those, then stop using the admin address.
You should be able to temporarily redirect that in external DNS records.

Otherwise feel free to offer to pay a developer to implement the necessary code changes to get the functionality you want. That would not happen until at least sme 9.1 as developers are now in a "no changes" phase trying to get sme 9.0 out.
Title: Re: Rename admin account
Post by: CmdLn on April 04, 2014, 06:22:41 PM
You do need to think through the ramifications of changing the main server domain.

The reason I didn't like this solution initially was because of possible unforeseen ramifications, but I foolishly believed I that changing the primary domain was a simple fix.

Changing my employers mind about using an address that he has been using for years is going to be impossible.

Surely I am not the only person who needs this functionality? Seems to me like people are reading this thread?

I realise I wont get this changed and mainly still comment on this topic to help anybody else who needs the same thing. Maybe if there is enough interest the developers will take notice.
Title: Re: Rename admin account
Post by: CmdLn on April 04, 2014, 06:29:59 PM
The problem I have with changing every webmail profile is I dont know most of the user passwords because I used lat-shadow to transfer the user passwords from the previous RedHat box. Is there a way to change a Webmail user profile for another user without actually logging in as that user?
Title: Re: Rename admin account
Post by: stephdl on April 04, 2014, 07:02:42 PM
Maybe if there is enough interest the developers will take notice.
Developers need rather more help to test their development and more people in bugzilla than ideas to waste the few free time they have...IMHO :)

Moreover i worry it is a huge NFR you are asking.
Title: Re: Rename admin account
Post by: Stefano on April 04, 2014, 07:13:35 PM
just a question (I  sincerely don't know all the internals): whea a user is created, does happen something at HOrde level? I mean, user profile in horde is created on demand at the first login in webmail or on user creation?

the idea is to add a script that creates a new identity on user creation and on new domain creation

or, at least, it would be helpful to have a script to manually invoke..

in any case, CmdLine, time to go to bugzilla and open NFR.. but don't hold your breath..
Title: Re: Rename admin account
Post by: janet on April 04, 2014, 07:17:10 PM
CmdLine

You chose to use sme server, so live with it's limitations, and tell your boss that too !

The admin user issue is something that thousands of sme server users have learnt to live with for 15 years. It's not going to be changed because you suddenly want it. As stephdl says, the developers are far too busy with limited time they have, to be chasing & fixing relatively unimportant issues for an individual, or few, for which there are suitable workarounds.

Quote
Is there a way to change a Webmail user profile for another user without actually logging in as that user?

IIRC user settings for webmail (horde/imp) are stored in mysql database tables. You may be able to manually tweak those tables.
Title: Re: Rename admin account
Post by: idp_qbn on April 04, 2014, 10:59:57 PM
CmdLine
Quote
Changing my employers mind about using an address that he has been using for years is going to be impossible.

Are you sure? Have you tried?
People and organisations (even very large ones) change email addresses all the time and their clients/friends cope.

Give it a go - it may be a lot easier than you think. And a lot easier than trying to change the server code.
I mean, would you call Mr Microsoft and asking to stop using "Administrator" on Windows systems?

Cheers
Ian
Title: Re: Rename admin account
Post by: CmdLn on April 05, 2014, 07:49:11 AM
Although I see all your points here this is Linux right? It's open software and we can do what we want without permission from "Mr Microsoft". I am not asking to change the name of root, just the name of a standard Linux user that could be anything. I think it makes sense for SME because in my 20 years or so of tech (mainly for small and medium businesses) I have seen the email addresses like accts, admin, sales, billing, info, contact, support, reception, etc used over and over again. Why would you use a common email address as the name for the administrator of a mail server? For example Wordpress uses wp-admin which can be renamed to anything. Even "administrator" would be a less likely hit than admin IMHO.

I also find it hard to believe that this is "hard coded". This is open software isn't it? I would be willing to make this change myself if I could get some help with it, but for now I just need keep my boss and my users happy. You are right I chose SME server and I chose it because its nice and clean and stable in my experience.

So back to the point, I am thinking of going back to using my real domain as primary to get out of this dirty mess that affects everybody on the domain. I want to go with Janets first suggestion which was to use the mailsorting contrib to send the system mails to another user. Does anybody know of any reason not to do this? I see it uses procmail or maildrop, is there any overhead using these programs or does SME already do this?
Title: Re: Rename admin account
Post by: Stefano on April 05, 2014, 08:11:35 AM
users must be educated..

back to the point, you already have the solution.. work to make it works at 100%, don't go back
Title: Re: Rename admin account
Post by: johnp on April 05, 2014, 08:54:48 AM
From a security standpoint, I would agree with Stefano.
Quote
work to make it works at 100%, don't go back

With no disrespect, it seems to me that you didn't do enough investigation before moving to SME. I've found that if you learn to live within the rules, SME is both highly stable and secure.

Whether you feel that a locked admin name is a short coming, the power of the templated system out weights that premise IMHO
Title: Re: Rename admin account
Post by: CmdLn on April 05, 2014, 09:12:53 AM
From a security standpoint, I would agree with Stefano.
Hi John,

Is there a potential security issue using the mailsorting contrib?
Title: Re: Rename admin account
Post by: janet on April 05, 2014, 02:47:03 PM
CmdLn

Quote
Is there a potential security issue using the mailsorting contrib?

None that I know of.
Just use procmail, install the user manager contrib, which I think is called smeserver-userpanel.
I used it recently & it worked fine.
You may have to fine tune the rules over time in order to catch all root type system emails.
Title: Re: Rename admin account
Post by: CmdLn on April 07, 2014, 07:52:35 AM
Thanks for this Janet. Looks like filtering messages from root@mydomain will catch all system messages we have received to date.
Title: Re: Rename admin account
Post by: CmdLn on May 05, 2014, 09:13:21 AM
Added filter today to also catch mail to root@mydomain.
Title: Re: Rename admin account
Post by: CmdLn on May 25, 2014, 12:26:03 PM
Added from anonymous@mydomain to catch freshclam message.
Title: Re: Rename admin account
Post by: alefattorini on May 27, 2014, 04:15:04 PM
CmdLn,
your request is absolutely legitimate, it should be possible to redirect admin@ to any other user or address, but on SME server there is no way out.
You should try some alternative :-)
Title: Re: Rename admin account
Post by: CmdLn on May 27, 2014, 04:56:53 PM
alefattorini, I agree it should be possible and I am sure it could be done if the developers really wanted to.

The mailsorting contrib work around works for me with minimal administration, so I am happy to use SME which I love more and more as I use it more. I am sure most end up installing the mailsorting contrib anyhow. There cant be too many people who want to hack around with procmail recipes!
Title: Re: Rename admin account
Post by: janet on May 27, 2014, 04:59:38 PM
alefattorini

Quote
....it should be possible to redirect admin@ to any other user or address, but on SME server there is no way out.

You can redirect or forward all admin mail to any user you specify in server manager user panel.

Perhaps what you meant to say, was that all root type system mail should be able to be redirected to any user address specified, other than admin, and that the admin email address can be used for any other purpose.

I am sure that could be done if someone was willing to fund the development work.
The developers do not think this is a significant issue that requires their freely given time to fix, but paying them to do so would certainly speed up the process. Same rules apply in most distros.
 
Quote
You should try some alternative :-)

There are usable workarounds given here, so trying an alternative (I assume you mean distro) is not really necessary.
Title: Re: Rename admin account
Post by: alefattorini on May 27, 2014, 05:05:57 PM
so I am happy to use SME which I love more and more as I use it more.

I'm happy for you :-)