Mail

From SackWiki

Jump to: navigation, search

Contents

Setting up new sackmail users

Create the new user

If you haven't, create a new account running "adduser" and following the prompts. The userid for this example is "labrat". Make sure to note the UID for the new account or if you're working with an existing account get the UID from /etc/passwd.

Username   : labrat
Password   : *****
Full Name  : Lab Rat
Uid        : 6677
Class      : 
Groups     : labrat 
Home       : /home/labrat
Shell      : /bin/sh
Locked     : no

Create an IMAP password

The IMAP password is different from the account login password (if login is even allowed). Dovecot is configured to use standard UNIX crypt passwords. Use the dovecotpw utility to create the new password.

[scottrus@haybaler ~]$ dovecotpw -s crypt
Enter new password: 
Retype new password: 
{CRYPT}VdtFfEWCdWPe6

Create the IMAP user

Be smart and make a backup copy of /usr/local/etc/dovecot-passwd first!

You need to add a new line to /usr/local/etc/dovecot-passwd for IMAP login to work. The format of the line is similar to that of /etc/passwd. Remember to match the correct UID and use the crypt password previously created. Here's the entry for our labrat userid.

labrat@sackheads.org:VdtFfEWCdWPe6:6677:6677::/home/labrat:/bin/false::

Make the IMAP user maildir

Run the following commands to create the new maildir and set the proper permissions.

sudo mkdir -p '/var/spool/maildirs/labrat@sackheads.org'
sudo chown labrat:mail '/var/spool/maildirs/labrat@sackheads.org'

ls -ld '/var/spool/maildirs/labrat@sackheads.org'
drwxr-xr-x  3 labrat  mail  512 Aug 11 23:42 /var/spool/maildirs/labrat@sackheads.org

Login to IMAP

IMPORTANT: Login to IMAP with the new account before it receives mail otherwise procmail will deliver to the root maildir instead of the labrat@sackheads.org/Maildir folder.

Userid: labrat@sackheads.org
Passwd: (whatever you set with dovecotpw)
Host: mail.sackheads.org (requires SSL be enabled)

After login you'll see a new Maildir in the /var/spool/maildirs/labrat@sackheads.org/ directory. If not, check /var/log/maillog for any dovecot errors and make corrections as needed.

Assuming the IMAP login went well send a test mail to the new account and make sure you can see it from your IMAP client.

Admin for sackmail users

IMAP password reset

  1. Create the new password with the command dovecotpw -s cyrpt.
  2. Backup the /usr/local/etc/dovecot-passwd file
  3. Edit dovecot-passwd and replace the password. The file format is similar to /etc/passwd.
Personal tools