Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: NomadOfNorad on February 07, 2006, 04:21:11 AM

Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 07, 2006, 04:21:11 AM
I have created a set of mailboxes via the web interface.  Call them Tom, Dick, and Harry.

If I access the machine directly, wanting to log in from the server logon: prompt, and type tom, and the password for tom, I get some text that is only on screen for the blink of an eye before the screen blanks, and I get back the server logon: prompt.

Am I missing something here?  Is there a way to log on as the mailbox name?
Title: Logging on as one of the mailbox names...?
Post by: pfloor on February 07, 2006, 04:49:18 AM
The only logins allowed are for root and admin.

root will take you to a command line prompt.
admin will take you to the admin console.

Paul
Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 07, 2006, 05:09:58 AM
Is there a way to launch a script as one of the other users?

Is there a way, when logged in as root, to run something using the credentials of, say, tom?  Or a way to command to be launched, from outside the machine, a script or program, so that it is run by tom?

Or is there a way to "turn off" the feature that prevents me from logging on as Tom, Dick, or Harry?
Title: Logging on as one of the mailbox names...?
Post by: pfloor on February 07, 2006, 05:21:52 AM
Yes, there is always a way to un-secure your server.

What is it EXACTLY that you are trying to do here?

Paul
Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 07, 2006, 05:34:33 AM
Well, I'd like to run the script(s) provided at this site:

http://batleth.sapienti-sat.org/projects/mb2md/ -- Converting Mbox mailboxes to Maildir format

...which specifically states that the script must be run as the user whos email it is, and specifically not to run it as root.

Course, if someone could point me to a similar script, or package, that does not have to be run as the user who's mailbox it is, and that would routinely be run as root, it would simplify things...
Title: Logging on as one of the mailbox names...?
Post by: pfloor on February 07, 2006, 06:04:44 AM
Ah, I thought you wanted something perminant.  You can use sudo and it will execute the script as a different user.

Log in as root and then:

First Read the manual:
man sudo

To run the script under tom you would do something like this:
sudo -u tom script_name -a -b -c

Hope this helps,

Paul
Title: Logging on as one of the mailbox names...?
Post by: pfloor on February 07, 2006, 06:07:23 AM
By the way, why do you want to run this script?  SME 6 and 7 already use the Maildir format.
Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 07, 2006, 06:12:59 AM
I am moving from an old mail server, which stores everything in MBox format, and I want to bring more than a decades worth of mails from there over to the new machine.
Title: Logging on as one of the mailbox names...?
Post by: pfloor on February 07, 2006, 06:17:54 AM
So you mean copy over old email, run script to change format then put SME server in service?

That would only require the script to be run once per user.  That should be fairly cut and dry.  It should also be fairly easy if there are not too many users.

Good luck and let us know how it goes.

Paul
Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 07, 2006, 07:11:47 PM
Okay, one last question...  :-D

Where exactly should I stick scripts such as this one?  Does it go in /bin?  /sys?

And if it's not already installed, where do I stick the TimeDate perl library?
Title: Logging on as one of the mailbox names...?
Post by: pfloor on February 07, 2006, 07:46:26 PM
It looks like a perl script and I don't know much about perl and how to run those type of scripts.  Someone else will have to chime in on this or try searching these fora for more advise.

About the TimeDate perl library.  perl-TimeDate-1.16-1 is installed on my system.  I think is is there from the stock install but you should check your machine to make sure, type this at the command prompt:

rpm -q perl-TimeDate

This will tell you if it is installed and what version.



P.S. SME is stripped of development tools for security reasons.  You can't build RPMs on your SME machine without installing the tools.  If you need to install something, you need to find it in an RPM format that has been built for your version of SME or redhat 7.3 (for SME 6.0.1) or CentOS 4.2 (for SME 7).  Read around a bit here about how and which RPMs to install and what NOT to install.

Good luck

Paul
Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 07, 2006, 09:19:05 PM
invoking
Code: [Select]
rpm -q perl-TimeDateyields
Code: [Select]
perl-TimeDate-1.16-1.2.el4.rfso I guess that's a good sign...  :-D
Title: Logging on as one of the mailbox names...?
Post by: pfloor on February 07, 2006, 09:31:42 PM
Quote from: "NomadOfNorad"
invoking
Code: [Select]
rpm -q perl-TimeDateyields
Code: [Select]
perl-TimeDate-1.16-1.2.el4.rfso I guess that's a good sign...  :-D

Than would be a good thing.  Also, It looks like you are on SME 7?

Remember, SME7 is not to a final release so be aware that all your work may or may not update to a final release.  The developers are trying VERY HARD to make updates from Pre1 to the final version work properly but they will not promise anything.  If it is a lot of work, you may want to experiment with one user, perfect the process and then do the whole server on a fresh, SME7 FINAL install just to make sure.

Just something for you to think about.

Paul
Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 07, 2006, 09:55:57 PM
Well, provided I get all the mbox files converted over to maildir boxes on the SME machine in the near term, it doesn't really matter much if the mb2md.pl script breaks with the move to the final-release version of SME.  At that point, all I'd really need to do is perform a backup of all the mailboxes to be on the safe side, then upgrade to the new version of SME.  All else fails, I just restore all the mailboxes from the backup after a fresh install of SME...
Title: Logging on as one of the mailbox names...?
Post by: CharlieBrady on February 08, 2006, 03:13:30 AM
Quote from: "NomadOfNorad"
I am moving from an old mail server, which stores everything in MBox format, and I want to bring more than a decades worth of mails from there over to the new machine.


Netscape and Thunderbird can both open mbox files, and you can drag&drop to copy the contents into Maildir format via IMAP.
Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 08, 2006, 06:42:28 AM
Sure it can, but it doesn't retain the Read/Unread status of the individual messages.

And in one case, I had a mail that had a bunch of stuff quoted from websites, with each one of the cited bits beginning with From at the start of the line... and that message got split up into a whole bunch of short messages. Probably because my particular mail system did not create a seperate file identifying the start and stop points of all the messages... This is particularly odd because Elm, the mailreader I use to read that mailbox on the original machine, reads that mail in as one long mail rather than several short ones...

And a third problem...

Well...

Would you want to drag 500 individual messages over onto the IMAP server?  Followed by 500 more messages from another MBox file?

Didn't think so...!   :-D
Title: Logging on as one of the mailbox names...?
Post by: NomadOfNorad on February 14, 2006, 08:35:57 AM
Quote from: "pfloor"
Ah, I thought you wanted something perminant.  You can use sudo and it will execute the script as a different user.

Log in as root and then:

First Read the manual:
man sudo

To run the script under tom you would do something like this:
sudo -u tom script_name -a -b -c

Hope this helps,

Paul


Okay, I copied the script to /bin and then entered the command as follows:

Code: [Select]
sudo -u username mb2md.pl -s boxname.sent -d /home/e-smith/files/users/username/Maildir/.Sentall on one line, and it didn't prompt me for username's password, instead I just got
Code: [Select]
sudo: unable to exec /bin/mb2md.pl: Permission denied
Aaaaargh!

Is there a way I can set mb2md.pl so that is it usable by all users?  And should/can I rename it to not have the .pl on the end and still have it be runnable?
Title: Logging on as one of the mailbox names...?
Post by: Moto on August 19, 2006, 05:06:11 PM
Quote from: "pfloor"

Code: [Select]
sudo -u username mb2md.pl -s boxname.sent -d /home/e-smith/files/users/username/Maildir/.Sentall on one line, and it didn't prompt me for username's password, instead I just got
Code: [Select]
sudo: unable to exec /bin/mb2md.pl: Permission denied
Aaaaargh!

Is there a way I can set mb2md.pl so that is it usable by all users?  And should/can I rename it to not have the .pl on the end and still have it be runnable?


Just for the record i needed the same so copied the script to /tmp , made the script executable and ran it using the syntax 'sudo -u user ./mb2md.pl -s /pathtomailboxfile'  and the job was done.