Temporary dir for mailpost

Julien ÉLIE julien at trigofacile.com
Mon Apr 20 18:15:11 UTC 2015

Hi Russ,

>> Hmm...  Couldn't we also just create and use the ~/.mailpost directory by
>> default instead of INN's pathtmp? (or ~/.inn-mailpost or ~/.inn/mailpost
>> that could be useful if we ever wish to store files for other programs ?)
> The problem there is that the user mailpost is running at may not (and
> probably shouldn't) have a home directory that it can write to.  With a
> lot of mail systems, it's going to be running as some user like daemon,
> which normally won't have write access anywhere in the file system other
> than to world-writable directories.

Oh, you're right, it would not work in that case.

> These days, it's a lot easier to arrange to run programs from the mail
> system as another user (like the news user), so your approach does make
> sense if we can encourage people to run mailpost as news.  In that case,
> it might even make sense to just use pathdb for the persistent database.

Then for INN 2.6.0, we could:
- warn in the Upgrade Section that people using mailpost without an 
explicitly configured database directory with the -b parameter should 
manually move the database from $pathtmp to $pathdb (I do not see how to 
do it automatically as we do not know how mailpost is launched; one may 
even use "-b pathtmp" explicitly);

- change the default value for the -b option from pathtmp to pathdb;

- add a new configurable -t option to configure the location of the 
directory to use to temporarily store error messages that are sent to 
the newsmaster.  Two paths are tried by default:  pathtmp as set in 
inn.conf, and then /var/tmp if pathtmp is not writable;

- die with an explicit error message if either the directory for the 
database or the one for the temporary files refer to a path that does 
not exist or the mailpost process does not have write access to.

And for INN 2.5.5, for backwards compatibility, just add the new -t 
option and the checks for writable directories.

Would that sound good?

Julien ÉLIE

« – On nage dans le lac, on escalade les montagnes…
   – Ben quoi ? Nous ne sommes pas en vacances ! » (Astérix)

More information about the inn-workers mailing list