Giter Site home page Giter Site logo

dovepasswd's Introduction

dovepasswd

Allow shell users to change their Dovecot (imap and pop3) passwords

This a Perl script to allow shell users to change their Dovecot (imap and pop3) login passwords. The script isn't run directly, but is executed by a helper C program which handles the setuid issues of allowing a user to change a file he/she cannot read.

preparation

Edit dovepasswd.c and look for these lines:

#define UID 65534
#define CMD "/usr/local/bin/dovepasswd.pl"

Change UID to the UID of the dovecot user. Check /etc/passwd for that. Change CMD to the actual location of the dovepasswd.pl script in case you put it somewhere else.

Edit dovepasswd.pl and examine the "Configuation Section". Look at the choices for $crypt. If you happen to have Blowfish available, use BLF-CRYPT. If not, the next best hash algorithm is SHA512-CRYPT, which is preselected.

Check $passwd_file and make sure contains the path to your Dovecot password file.

Check $auth_user. If Dovecot is running under a different user, change this accordingly.

installation

gcc -o dovepasswd dovepasswd.c
strip dovepasswd
sudo cp dovepasswd /usr/local/bin
sudo chown root.root /usr/local/bin/dovepasswd
sudo chmod 4750 /usr/local/bin/dovepasswd
sudo cp dovepasswd.pl /usr/local/bin
sudo chown root.root /usr/local/bin/dovepasswd.pl
sudo chmod 0755 /usr/local/bin/dovepasswd.pl

You'll need to manually create /etc/dovecot/dovecot.passwd. The format is similar to that of /etc/passwd. Past the shell field can be an undefined number of additional fields for use by Dovecot itself. The Dovepasswd program itsel limits the number of additional fields to 32.
That should be enough for anyone (heh heh).
/etc/dovecot/dovecot.passwd should by owned by root.dovecot and permissions should be 0660.

caveats

While it works, I haven't finished going over the code for security problems. Do not rely on it yet.

attributions

This program was intended to work identically to the regular passwd(1) command commonly found in Unix systems. Inspiration for the innards came chiefly from Charlie Orford's dovecotpfd, a program for doing the same thing with Roundcube. My C wrapper is essentially a copy of his.

dovepasswd's People

Contributors

davidgriffith avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.