Barry Finkel wrote:

>I have a question about the format of  acceptable_aliases .
>
>I want to know how to specify addresses in a template config file
>that I then use to create new lists.  I have a test list, and in the
>administrator web interface under
>
>     o Privacy options...
>          o [Recipient filters]
>
>in the "Alias names (regexps) ..." box I entered
>
>     [EMAIL PROTECTED]
>     [EMAIL PROTECTED]
>
>(two full addresses on two separate lines).  Note that I am using full
>e-mail addresses and not regular expressions here.  When I used 
>
>     config_list -o ttbsf.config test-transmit
>
>to produce a config file, I saw in ttbsf.config:
>
>     acceptable_aliases = """[EMAIL PROTECTED]
>     [EMAIL PROTECTED]"""
>
>The details page says, "This option takes a list of regular expressions,
>one per line,...".


Correct. so you add addresses and/or regexps in the box, one per line,
and the data are posted to the CGI script which converts them to the
value of the list attribute acceptable_aliases which happens to be a
string which is the list of addresses separated by newlines.


>If I want to add e-mail addresses to an existing
>template file, do I use the format I saw in the config file, with
>three initial quotation marks, each address on a separate line, and
>three closing quotation marks?  This format does not seem user-friendly,
>but I assume that it is the product of the translation of regular
>expressions to config file format.


It is more the translation of the entry in a web page text box into the
actual value of the list attribute.

What is in the input to config_list must be syntactically valid Python
that assigns values to list attributes. In this case, the value is a
single string consisting of the addresses/regexps separated by
newlines.

There are two ways to do this in Python

- as a single-quoted string, all on one line, with newlines represented
as \n as in

acceptable_aliases = "[EMAIL PROTECTED]@example.com"

- as a triple-quoted string with literal newlines as in

acceptable_aliases = """[EMAIL PROTECTED]
[EMAIL PROTECTED]"""

(note the actual quote character in either single or triple quoted
strings may be either ' or ".)

I don't know what you might think a "user friendly" format for this
might be, but it probably isn't syntactically correct Python that says
what it needs to.

Note also, that not all list attributes are represented in this way. As
another example, the owner attribute is an actual Python list of
addresses as in

owner = ['[EMAIL PROTECTED],com', '[EMAIL PROTECTED]']

so you have to look at an actual config_list output and emulate what
you see there for the form of each attribute you want to change.

-- 
Mark Sapiro <[EMAIL PROTECTED]>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

------------------------------------------------------
Mailman-Users mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&amp;file=faq01.027.htp

Reply via email to