SteveOH

Tag: mail server

Adding multiple users to Ubuntu e-mail Server using a script

by Steve Hernandez on May.16, 2009, under Technology

These two scripts are very important for the system admin who regularly works with mail servers and somehow forgets to backup his system username and password! Let’s say somehow we lost the usernames and passwords of the mail server. In this case the admin has to manually create all the users and then change the passwords for all the users. Tedious job. Let’s make our life easier.

First create a file which contains all the user name. Something like this:

nurealam
nayeem
mrahman
farid
rubi
sankar

Save the file as userlist.txt. Now create the following bash file:

#!/bin/sh
for i in `more userlist.txt `
do
echo $i
adduser $i
done

Save the file and exit.

chmod 755 userlist.txt

Now run the file:

./userlist.txt

This will add all the users to the system. Now we have to change the passwords. Let’s say we want username123 as password. So for user nayeem the password will benayeem123rubi123 for user rubi and so on.

Create another bash file as follows:

#!/bin/sh
for i in `more userlist.txt `
do
echo $i
echo $i"123" | passwd –-stdin "$i"
echo; echo "User $username’s password changed!"
done

Run the file. All the passwords are changed.

If you want to force all your users to change password, use the following code:

Force all your users to change their passwords because the temporary password is a security risk

#!/bin/sh
for i in `more userlist.txt `
do
echo $i
echo $i | change -d 0 "$i"
echo; echo "User $i will be forced to change password on next login!"
done

I then log as that user and see this

WARNING: Your password has expired.
You must change your password now and login again!
Changing password for user amcorona.
Changing password for amcorona
(current) UNIX password:

1 Comment :, , , , , , , , , more...

Ubuntu Mail Server – PostFix, DoveCot, RoundCube Authentication Error

by Steve Hernandez on May.11, 2009, under Technology

I’ve been dealing with this error for the past 2 weeks, trying to authenticate to my IMAP Mail Server (dovecot) over SSL (SASL). I continuously received errors for IMAP authentication. AtMailOpen did not work (and I cannot get it to authenticate correctly). So I tried RoundCube, which looks like a good mesh of functionality and aesthetics.

RoundCube installed great – easy and straight forward. Here is the error I received:

IMAP Error: Authentication for steveoh@thelambdas.com failed (LOGIN): “a001 NO Authentication failed.”

Warning: Cannot modify header information – headers already sent in /var/www/webmail/program/include/rcmail.php on line 951

There is very little to no solutions out there.  So I had to play with the configuration file and each argument, one by one (file: main.inc.php in the config directory).

Leave the username_domain field blank.  My server, apparently, doesn’t require the full email address, only the user name, for authentication.

From:
$rcmail_config['username_domain'] = ‘example.com’;

To:
$rcmail_config['username_domain'] = ”;

This solved the problem, and I’m able to log in using ONLY the user name (ie. username, not username@example.com).

Good luck.

1 Comment :, , , , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...