PyFreshPass ----------- What does it do? This program gets information from various email programs on your computer, and changes the password of any nhs.net accounts. It then stores the updated password in your email programs, and sends you an email to tell you its done it. Requirements Python 2.4 Windows 2000+ (if running on Microsoft) A computer connected to NHS.net (otherwise bad things will happen) - you can't change passwords from outside nhs.net Email clients known Thunderbird Fetchmail NetRc Outlook [Express] ------------------------ LINUX/UNIX instructions (Windows instructions come later) INSTALLATION Get the tarball and unzip it somewhere. You've probably already done this already, because you're reading this file... Run python setup.py install This installs smtpssl.py into you site-packages, and PyFreshPass.py into /usr/bin/ CONFIGURATION Single user Run PyFreshPass.py -g This will generate a file called .pyfreshpassrc in your home directory This will pull in data from thunderbird, your fetchmailrc files, and also your netrc files. Edit .pyfreshpassrc with your favourite editor. Most likely you will have a single entry under [people] - this should be you nhs.net identity. If you want notification of new passwords sent to other email addresses, put these on the line after your id. Separate them with spaces You are now ready to test the program - make a note of your current password. Shut down Thunderbird, if it is running Run PyFreshPass.py -n This will print out all the usernames in your configuration file, followed by the new passwords. Make a note of these as well Restart Thunderbird. It should be able to access your email as before, and there should be a notification message in your nhs.net inbox. Check you can login to nhs.net again, using the new password. If this all works well, you can add PyFreshPass.py to your crontab - see your system specific documentation about how to do this. I recommend something like 14 03 3 * * PyFreshPass.py -n This runs it on the 3rd of every month at 03:14 am, and sends a list of passwords changed to the owner of that crontab. After this, you should be able to leave it alone. Multiple users You can either set this up as for a single user for each person. If you are using fetchmail for all the accounts, PyFreshPass.py -f /etc/pyfreshpassrc -g -s /etc/fetchmailrc Will generate a config file in /etc/pyfreshpassrc, and get a list of nhs.net ids from /etc/fetchmail. If you don't want a particular user to have the password managed by the program, remove that line from the config file. Then follow the steps as above, but use -f /etc/pyfreshpassrc in your crontab ------------------------------- WINDOWS INSTALLATION You've probably already installed the program, if you're reading this... Simple single user instructions From the Start menu, under the PyFreshPass entry, run Generate Config Edit the configuration file - this should be in C:\Documents and Settings\USERNAME\.pyfreshpassrc There is most likely only a single entry in the [people] section If you want your new passwords emailed to any addresses in addition to your nhs.net address, add those addresses to that line, separated by spaces Next, test your installation. Close Outlook and/or Thunderbird, and make a note of your current password Run Start Menu/PyFreshPass/PyFreshPass This should bring up a window that has a list of nhs.net ids and the new password for each. Most likely, there will be only one anyway Make a note of the new password, before you close the window Startup Outlook/Thunderbird, and see if you can access nhs.net - you should have received an email informing you of the change in password. This may take a couple of minutes to become available, so be patient Finally check you can log into the web-based version with the new password Setting it to run regularly. Start Menu/Control Panel/Scheduled Tasks (May be under "Performance and Maintenance") Run the "Add scheduled task" wizard, and follow the instructions. PyFreshPass should be one of the available programs to you. Select a monthly update, and choose a time when you know the computer will be on. If the computer is not on at the relevant time, that month's update will be skipped. Multiple Users Due to windows slightly bizarre security setup, this isn't possible. Sorry. ------------------------------ Options: -f,--configfile FILE specify a configuration file (see later). If this option is not given, $HOME/.pyfreshpassrc is used (where $HOME is the home directory of the current user) -g,--generate-users Use the locations in the configfile, and find all the nhs.net accounts available from those places, and write it back into the configfile. If the configfile does not exist, or is empty, the home directory is used -s,--source FILE/DIR Add the FILE or DIR to the list of locations looked for. Typically a users home directory or an /etc/fetchmailrc file If used with -g, this is added to the configfile -v,--verbose Give a running description of what the program is doing. This also stops the program from actually changing the password on nhs.net The new passwords are not stored in the email program (or rather, the old passwords are stored) -n,--notify Print out a list of usernames and new passwords when the program is done. Displays a messagebox on windows. On unix, printed to command line -l,--local-host If this option is not selected, confirmation emails are sent out using the nhs.net smtp service. If it is selected, the current machines local mailserver is used