Re: [Exim] SQL and aliases.

Top Page
Delete this message
Reply to this message
Author: Eric Renfro
Date:  
To: exim-users
Subject: Re: [Exim] SQL and aliases.
Okay. Now that I have a SQL-based static mailing-list setup. I want to be
able to add a header to the email, so that it has:

Reply-To: <${local_part}@${domain}>
List-Post: <${local_part}@${domain}>
List-Id: <${loca_part}.${domain}>

For filtering purposes.

The following is the structure of the SQL table for reference:

CREATE TABLE "staticlists" (
"list_idnr" int8 DEFAULT nextval('"staticlists_idnr_seq"'::text) NOT NULL,
"domain" varchar(200) NOT NULL,
"list" varchar(50) NOT NULL,
"email" varchar(200) NOT NULL
);
CREATE INDEX "staticlists_domain_idx" ON "staticlists" ("domain");
CREATE INDEX "staticlists_email_idx" ON "staticlists" ("email");
CREATE INDEX "staticlists_list_idx" ON "staticlists" ("list");

And the exim4 configuration is as follows:

---GLOBAL---
domainlist staticlists_domains = \
        ${lookup pgsql {SELECT DISTINCT domain FROM staticlists WHERE domain
 = '${quote_pgsql:$domain}'}}


---ROUTERS---
sql_aliases:
  driver = redirect
  domains = +staticlists_domains
  allow_fail
  allow_defer
  data = ${lookup pgsql { \
    SELECT email \
      FROM staticlists \
      WHERE domain = '${quote_pgsql:$domain}' \
      AND list = '${quote_pgsql:$local_part}' \
    } \
  }
  file_transport = address_file
  pipe_transport = address_pipe
---END---


Can these headers be added (or changed to, for the Reply-To) inside this
director, and how so?

--
Eric Renfro
Myrddin Computers & Designs - CEO/President
Sales: sales@???
Fax: (775) 243-4535