Re: [EXIM] Exim for dialup use [was Why should I use Exim ov…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Nigel Metheringham
Ημερομηνία:  
Προς: Ben Smithurst
Υ/ο: exim-users
Αντικείμενο: Re: [EXIM] Exim for dialup use [was Why should I use Exim over Qmai l?]

ben@??? said:
> I think I mentioned this before, what I do is have a script
> automatically edit the configuration file when I go on/off-line. (It
> basically just (un)comments the hold_domains line. (I use hold_domains
> rather than queue_remote so that mail for local machines is delivered
> immediately.)) There could be a problem when the configuration file is
> zero length, between ed(1) doing the open() with O_TRUNC and the
> write() (it only does one big write), but it hasn't given me any
> problems yet. I'll have to look for a way to fix that. Hmm...


Ugh.

> Anyway, I don't think I'll have any problems at all with the config
> file being zero length now. I've modified Exim to get a shared lock on
> the config file before reading it (which is probably quite expensive
> but I can live with it), and the program which updates it gets an
> exclusive lock, so there shouldn't be any conflicts, if I've
> understood everything right.


Double ugh.

Why not:-

2 config files - /etc/exim/config.online, /etc/exim/config.offline,
and a hardlink /etc/exim/config which points to one of them. You can
then atomically channge over your config by linking the requried config
file to (say) config.new and rename()/mv config.new to config.

[BTW trying this with symlinks might work or might show up interesting
effects about when your kernel dereferences the things]


pir@??? said:
> Speaking of the whole dialup thing, one of the things Philip added to
> make diong dialup interface up/down changes easier was
> queue_only_file, which makes (for queue_only or remote or smtp)
> changes easy without having to alter the config file (which was the
> problem I hit the last time I was messign with dialup mail).


Actually wouldn't it be nice if the mode was an expanded string which
was tested on the fly - then you could do your own magic and set the
mode depending on the time of day, weather etc. It also reduces the
number of config options... This applies for a lot of other options
too.


ben@??? said:
> I use hold_domains rather than queue_remote so that mail for local
> machines is delivered immediately.


Set hold_domains to point to a file lookup and switch that file
appropriately.
That has the advantage that even if you are writing it when the thing
is read it doesn't really matter too much - you are more likely to push
out some extra messages at the end of a PPP session.

    Nigel.
-- 
[ Nigel Metheringham                  Nigel.Metheringham@??? ]
[ Phone: +44 1423 850000                         Fax +44 1423 858866 ]




--
*** Exim information can be found at http://www.exim.org/ ***