[Exim] domainlist localdomains perl expansion

Pàgina inicial
Delete this message
Reply to this message
Autor: Jez Hancock
Data:  
A: Exim Users List
Assumpte: [Exim] domainlist localdomains perl expansion
Hi,

I'm having trouble getting a perl script to expand a list of domains from a sendmail style
local-host-names file (ie one domain per line).

I've added:

perl_startup = do '/usr/local/etc/exim/exim.pl'

to my configure file and the script looks like:

-------------------------------------------------------------------------------
#!/usr/bin/perl
use strict;

my $lhd_file="/etc/mail/local-host-names";

sub get_lhd() {
    my $hosts = "";
    open(FD, "$lhd_file");
    foreach(<FD>){
        chomp($_);
        $hosts.=" : $_ ";
    }
    close FD;
    return $hosts;
}
-------------------------------------------------------------------------------


The script has been tested in a shell and returns a string of the form:
: example1.com : example2.com : example2.com

as expected.

The problem is with the expansion line I'm using in the Exim configure file:

domainlist local_domains = @ ${perl{get_lhd}}

Which yields:

[8:52:31] root@darkstar /usr/local/etc/exim# exim -bP +local_domains
domainlist local_domains = @ : example.com : ${perl{get_lhd}}

on HUP.

How would/should I use perl expansion in this context?

Thanks in advance,
Jez