Bash Email Admin Script

A script designed to administer an Email server using Workaround.org tutorial.

I wrote this little script as a replacement for a python script who's purpose is/was to administer an email server (add/remove/modify domains/accounts/aliases).. it's GNU Kosher : ]

oh, careful, there is now a new version of the Workaround ISP mail tutorial, the Lenny edition (in case this page gets old), so get the lenny script if you used the latest tutorial, and the plain one for use on the etch edition

comments:
avatar

stjohn

Works like a charm, just what I was looking for!

many thanks,
Stjohn
avatar

CharlieB

Nice script
thanks.

CharlieB
avatar

spfef

I userd the beas_lenny.sh, but it does not support mailadresses with an dot or a dash in it, like firstname.lastname@example.com or firstname-secondname.lastname@example.com
avatar

manu

you are correct.

I changed the regex on line 104 to:
if [ "${2}" = "user" ]; then REGEX="^([0-9a-z\\.-]{${MINMAIL},${MAXMAIL}})$"; fi

This now allows dots and dashes.
avatar

mtkoan

Great! A pearl! Works perfectly on slackware-13.
avatar

anonyMouse

nice - works also on NetBSD (invoke with "bash ").
Thanks!
avatar

Jon

This worked once, and now it just silently fails to create the required directories. Any ideas?
avatar

manu

Jon, didn't notice your comment, sorry. I am not sure what you mean as this script shouldn't create directories (been a while since I worked on this).
avatar

r3c4ll

It's ready for the last (squeeze) tutorial?
avatar

manu - http://manurevah.com

Hi r3c4ll,

I haven't tested with the Squeeze tutorial, however as the DB scheme hasn't changed (from what I've seen) this should work just the same.

This means you should try the "lenny" version (beas_lenny.sh). Please try this on a non production platform first.

If you can confirm this works that would be nice.. : ]

avatar

Marc - https://gist.github.com/sanmarcos/46cfff92f02dfdaf100d

I updated it for Debian Jessie here

https://gist.github.com/sanmarcos/46cfff92f02dfdaf100d

I also included a MySQL function which can be used with the Roundcube change password plugin.

I fixed some typos in the code as well.

Feel free to merge.

https://gist.github.com/sanmarcos/46cfff92f02dfdaf100d

See: https://workaround.org/ispmail/jessie/migrate-from-wheezy
Leave a comment
You may use the following HTML tags: <p> <a> <strong> <b> <em> <i> <cite> <blockquote> <code> <pre>

Your comments WILL NOT be submitted to any third party (not even for anti spam verification).