I started with 30_exim4-config_remote_smtp 30_exim4-config_remote_smtp_smarthost And wanted to add a bit after the remote_smtp transport. So I created 30_exim4-config_remote_smtp_rb but this ended up *after* the smarthost stuff. 30_exim4-config_remote_smtp_a_rb had the same problem. 30_exim4-config_remote_smtp_1_rb worked. Is this to be expected? Why? README.Debian says files are taken in lexical sort order, and this doesn''t seem to work that way. -- Ross Boylan wk: (415) 514-8146 185 Berry St #5700 ross@biostat.ucsf.edu Dept of Epidemiology and Biostatistics fax: (415) 514-8150 University of California, San Francisco San Francisco, CA 94107-1739 hm: (415) 550-1062
On 2005-10-07 Ross Boylan <ross@biostat.ucsf.edu> wrote:> I started with > 30_exim4-config_remote_smtp > 30_exim4-config_remote_smtp_smarthost> And wanted to add a bit after the remote_smtp transport. So I created > 30_exim4-config_remote_smtp_rb > but this ended up *after* the smarthost stuff. > 30_exim4-config_remote_smtp_a_rb > had the same problem.Works for me. [...]> Is this to be expected? Why? README.Debian says files are taken in > lexical sort order, and this doesn''t seem to work that way.The sorting is done by: ---------- unset LANG LC_COLLATE LC_ALL ... for F in $(ls $1); do ---------- i.e. we are relying in on ls to do correct sorting. Afaict all variants of ls I can come up with (/bin/ls and the builtin version from bash) handle 30_exim4-config_remote_smtp 30_exim4-config_remote_smtp_rb 30_exim4-config_remote_smtp_smarthost correctly. And as we are also taking care of locales I really have no idea why it breaks for you. cu andreas -- "See, I told you they''d listen to Reason," [SPOILER] Svfurlr fnlf, fuhggvat qbja gur juveyvat tha. Neal Stephenson in "Snow Crash"
On Fri, 2005-10-07 at 20:00 +0200, Andreas Metzler wrote:> On 2005-10-07 Ross Boylan <ross@biostat.ucsf.edu> wrote: > > I started with > > 30_exim4-config_remote_smtp > > 30_exim4-config_remote_smtp_smarthost > > > And wanted to add a bit after the remote_smtp transport. So I created > > 30_exim4-config_remote_smtp_rb > > but this ended up *after* the smarthost stuff. > > 30_exim4-config_remote_smtp_a_rb > > had the same problem. > > Works for me. > [...]I just tried renaming the file, and it now works for me too. Aha: Pilot error. The nonworking file was 30_exim4_config_remote_smtp_rb ^ The indicated _ should have been a -. Sorry to bother everyone.
On Fri, Oct 07, 2005 at 10:21:30AM -0700, Ross Boylan wrote:> I started with > 30_exim4-config_remote_smtp > 30_exim4-config_remote_smtp_smarthost > > And wanted to add a bit after the remote_smtp transport. So I created > 30_exim4-config_remote_smtp_rb > but this ended up *after* the smarthost stuff.Actually, the idea behind the filename is order_source_name, with source being "exim4-config" for files installed from exim4-config. That way, one can easily say where a file comes from. So, you should probably be naming your files like order_local_name. In any case, I would choose the order number in a way that this forces the sort order of files. Since transport order doesn''t matter, all our files are at order 30. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
On Sun, 2005-12-18 at 19:35 +0100, Marc Haber wrote:> On Fri, Oct 07, 2005 at 10:21:30AM -0700, Ross Boylan wrote: > > I started with > > 30_exim4-config_remote_smtp > > 30_exim4-config_remote_smtp_smarthost > > > > And wanted to add a bit after the remote_smtp transport. So I created > > 30_exim4-config_remote_smtp_rb > > but this ended up *after* the smarthost stuff. > > Actually, the idea behind the filename is order_source_name, with > source being "exim4-config" for files installed from exim4-config. > That way, one can easily say where a file comes from. > > So, you should probably be naming your files like order_local_name. In > any case, I would choose the order number in a way that this forces > the sort order of files. Since transport order doesn''t matter, all our > files are at order 30. > > Greetings > MarcSo, make no assumptions about the relative ordering between files that have the same order number? That might be worth documenting, if I didn''t just miss it. This does mean that the trick I was trying to do of modifying an existing transport can''t be done reliably, but the trick is probably too tricky anyway.
On Tue, Dec 20, 2005 at 03:00:34PM -0800, Ross Boylan wrote:> On Sun, 2005-12-18 at 19:35 +0100, Marc Haber wrote: > > On Fri, Oct 07, 2005 at 10:21:30AM -0700, Ross Boylan wrote: > > > I started with > > > 30_exim4-config_remote_smtp > > > 30_exim4-config_remote_smtp_smarthost > > > > > > And wanted to add a bit after the remote_smtp transport. So I created > > > 30_exim4-config_remote_smtp_rb > > > but this ended up *after* the smarthost stuff. > > > > Actually, the idea behind the filename is order_source_name, with > > source being "exim4-config" for files installed from exim4-config. > > That way, one can easily say where a file comes from. > > > > So, you should probably be naming your files like order_local_name. In > > any case, I would choose the order number in a way that this forces > > the sort order of files. Since transport order doesn''t matter, all our > > files are at order 30. > > So, make no assumptions about the relative ordering between files that > have the same order number?No. As Andreas said, the order is defined by ls and its configuration.> This does mean that the trick I was trying to do of modifying an > existing transport can''t be done reliably,Why? The order of transports in the config file doesn''t matter. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
On Wed, Dec 21, 2005 at 08:57:03AM +0100, Marc Haber wrote:> On Tue, Dec 20, 2005 at 03:00:34PM -0800, Ross Boylan wrote: > > On Sun, 2005-12-18 at 19:35 +0100, Marc Haber wrote: > > > On Fri, Oct 07, 2005 at 10:21:30AM -0700, Ross Boylan wrote: > > > > I started with > > > > 30_exim4-config_remote_smtp > > > > 30_exim4-config_remote_smtp_smarthost > > > > > > > > And wanted to add a bit after the remote_smtp transport. So I created > > > > 30_exim4-config_remote_smtp_rb > > > > but this ended up *after* the smarthost stuff. > > > > > > Actually, the idea behind the filename is order_source_name, with > > > source being "exim4-config" for files installed from exim4-config. > > > That way, one can easily say where a file comes from. > > > > > > So, you should probably be naming your files like order_local_name. In > > > any case, I would choose the order number in a way that this forces > > > the sort order of files. Since transport order doesn''t matter, all our > > > files are at order 30. > > > > So, make no assumptions about the relative ordering between files that > > have the same order number? > > No. As Andreas said, the order is defined by ls and its configuration. > > > This does mean that the trick I was trying to do of modifying an > > existing transport can''t be done reliably, > > Why? The order of transports in the config file doesn''t matter. >I was trying to add material after a particular transport. The order of transports doesn''t matter, but the order in which the files are concatenated affects which transport my snippet appears after. Generically (I''m not on an exim4 system now), 30_exim4-config_remote_smtp is remote_transport: optiona = vala optionb = valb I wanted to add 30_exim-config_remote_smtp_rb optionc = valc optiond = vald so that these options went after the standard ones for remote_transport. My options were for transport-time header rewriting. However, since the ordering of files within the 30_ is defined by ls, I happened to get optionc and optiond added after remote_smtp_smarthost. In general, if I want a snippet to appear after another one I should use a higher number, e.g. 31_local_remote_smtp. But this only permits modification of whichever transport is last in the list of 30_*. If I want to modify an earlier one, I''m out of luck. Furthermore, the ordering of files within 30_*, if I understand the above remark about ls, is not dependable. It is not necessarily alphabetical, and it is not necessarily fixed. Some filesystems may show the files in one order and then, after the file is modified and potentially rewritten, in another order (I think). As I said, adding options to an existing transport is probably pretty unreliable even if the sequencing issues weren''t a problem, because if the main transport changes the options may not be right anyway. So I don''t think this is a case that deserves to be catered for. But perhaps now you can see what I was trying to do. A final irony is that since my original efforts I''ve switched to using smarthost. Also, it might be possible to accomplish my original goal using the correct debconf options.
On Wed, Dec 21, 2005 at 11:28:08AM -0800, Ross Boylan wrote:> I was trying to add material after a particular transport. The order > of transports doesn''t matter, but the order in which the files are > concatenated affects which transport my snippet appears after.I understand now what you meant to do. I''d advise against doing so. If you directly modify the transport warning, you would get a warning about the changed conffile when an update wants to touch that file. With your scheme, you''d get to break the pieces of your broken exim.> However, since the ordering of files within the 30_ is defined by ls, > I happened to get optionc and optiond added after > remote_smtp_smarthost.You would have to choose a sequencing that is compatible with ls'' sort order.> Furthermore, the ordering of files within 30_*, if I understand the > above remark about ls, is not dependable. It is not necessarily > alphabetical, and it is not necessarily fixed. Some filesystems may > show the files in one order and then, after the file is modified and > potentially rewritten, in another order (I think).ls sorts alphabetically by default, so I don''t think you''d be filesystem dependent here.> As I said, adding options to an existing transport is probably pretty > unreliable even if the sequencing issues weren''t a problem, because if > the main transport changes the options may not be right anyway.Yes, that''s playing with dragons. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835