Skip to content

Farzy/cyrus-user-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cyrus user map for Postfix

This program creates a Postfix map table listing all valid email Cyrus Imap user accounts available in the Cyrus Imap database.

This script works both with or without Cyrus Imap's Virtual Domain feature.

The map uses the Postfix hash format by default.

USAGE

Execute this script periodically with cron, under the root user. It will create a user map of all the valid Cyrus Imap accounts. There is not need to restart Postfix.

PREREQUISITES

Both Postfix and Cyrus Imap must be running locally.

CONFIGURATION

  1. Edit the configuration section of the script:
  • Set USERS_MAPFILE to the map's full path, usually in /etc/postfix.
  • Set CYRUS_CMD to Cyrus' ctl_mboxlist command's full path (/usr/sbin/ctl_mboxlist on Debian Linux).
  • Set POSTMAP_CMD to Postfix's postmap command's full path (/usr/sbin/postmap on Debian Linux).
  1. Copy the script into the server's PATH.

  2. Add or modify the following line in Postfix's /etc/postfix/main.cf:

    local_recipient_maps = hash:/etc/postfix/cyrus_usermap $alias_maps

and reload the postfix configuration :

postfix reload
  1. Periodically execute the script via cron.
  • If you're running a modern cron, like Linux's cron, copy the file cron/create_cyrus_user_map to /etc/cron.d.
  • Otherwise adapt the cron file to you system in order to run the script periodically.
  • Don't forget to change the script's path if you're not installing it in /usr/local/sbin.
  1. Enjoy.

BUGS

None known.

And yes, this is really a Ruby script for a sysadmin task, it's not a bug, it's a feature.

AUTHOR

Contact me if you have questions to ask or bug reports to make.

REFERENCES

LICENSE

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Please check the LICENSE file for a full copy of the GPL 3 license.

About

Create a Postfix map table listing all valid email user accounts available in the Cyrus Imap database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages