[imp] Writing to user's .forward file from IMP

Matt Prigge mprigge@pobox.com
Thu, 19 Jul 2001 13:30:33 -0700


> It seems that you are considering all cases in general, whereas I am
looking
> at this specific installation. Users have home directories which are
> writable by IMAP.

UW IMAP (which I assume youre using) generally uses just the ~/mail
directory. I think that what people are trying to say is that youre most
likely barking up the wrong tree for the solution you want. I cant say for
sure, but Id be nearly willing to bet that you will not be able to write out
arbitrary files with arbitrary contents into the ~/mail directory using UW
IMAP and that, if you could, it would be consided a fairly huge security
problem and would be promptly fixed.

If you are running IMP on the same machine that your IMAP server is on, I
suppose you could probably write some kind of PHP extension to write out the
.forward file or do whatever else you needed done (beware that giving IMP
that ability will have very serious associated security risks because the
Apache user would have to have the ability to write files in everyone's
homedir). If IMP is not on the same machine as the IMAP server, youre sort
of out of luck. (see my attached suggestion for one other idea you might
consider)

Since, if what Ive assumed above is basically correct, the solution you want
probably cant be provided through IMP (at least without heavy specialized
local modifications) you probably wont get too many good answers from this
list regarding your problem. Sorry!

-matt


This is just a quick idea that came to mind:
Assuming:
    You run MySQL to save your Horde preferences.
    The MySQL server is also accessible by the IMAP server.
    The changes you make to .forward dont need to take hold synchronously.
    You have or can get a decent understanding of perl/php.
You Could:
    Add a few extra pref fields to IMP. Like 'forwarding_address' etc. When
users save this information in their IMP preferences, it will get saved to
the MySQL database. On your IMAP server, have a perl script that runs
through that IMP prefs DB looking for the settings youve had your users save
using IMP. Based on what it finds there, it can update peoples .forward
files with the information contained in the IMP/Horde prefs DB. This script
could be set up to do this every X minutes or however you want it.
Disclaimer:
    There could be all kinds of problems with this suggestion, but I thought
Id suggest it anyway. Depending upon how many users you have, this could be
a horrible idea or it might suit your needs perfectly.