From: Joel U. <uck...@no...> - 2005-01-16 00:05:31
|
Thus spake Reini Urban: > Joel Uckelman schrieb: > > Would anyone else besides me find it useful to be able to set certain > > headers (e.g., From, Reply-to) in mail sent by a wiki in that wiki's config > > > file? > > > > Say, in the config file you could have: > > > > EMAIL_HEADER_FROM = MyWiki <my...@ex...> > > EMAIL_HEADER_REPLY_TO = MyWikiAdmin <wik...@ex...> > > EMAIL_HEADER_X_ARBITRARY_JUNK = foo, bar! > > > > and those would be used in all outgoing mail from the wiki. > > Sure. > And we really need a Mailer class, which should produce > all outgoing mails. > But I wanted to defer that to the next release. How soon were you expecting to do another release? Maybe I could write a basic Mailer class before then? -- J. |
From: Joel U. <uck...@no...> - 2005-01-30 21:24:31
|
Thus spake Reini Urban: > Joel Uckelman schrieb: > > Would anyone else besides me find it useful to be able to set certain > > headers (e.g., From, Reply-to) in mail sent by a wiki in that wiki's config > > > file? > > > > Say, in the config file you could have: > > > > EMAIL_HEADER_FROM = MyWiki <my...@ex...> > > EMAIL_HEADER_REPLY_TO = MyWikiAdmin <wik...@ex...> > > EMAIL_HEADER_X_ARBITRARY_JUNK = foo, bar! > > > > and those would be used in all outgoing mail from the wiki. > > Sure. > And we really need a Mailer class, which should produce > all outgoing mails. > But I wanted to defer that to the next release. I have a basic Mailer class hammered out now, and I have a few questions about how we're handling constants. 1. I see that I would need to register nonboolean EMAIL_* constants in IniConfig.php, yes? 2. Which would be preferable: a) EMAIL_HEADER_FROM and EMAIL_HEADER_REPLY_TO contain just the header value, while EMAIL_HEADER_n contains the whole header b) Every header constant contains the whole header, while EMAIL_HEADER_FROM and EMAIL_HEADER_REPLY_TO are named for convenience (rather than numbered) because they'll be the ones people most often want to set. c) Every header constant contains only the header value, and the header name is deduced from the constant name: e.g., when we process the constant EMAIL_HEADER_FROM, we look at the part after EMAIL_HEADER_, lower case it and capitalize the first letter to get the header name. d) Something else, like reading all of the user defined headers from a file. I like c) myself, but I think it would involve a call to get_defined_constants() and then a loop over the whole mess of them just to find the ones which start with EMAIL_HEADER_. That might be unacceptably slow; I'm not sure. (Unless we have a global dictionary which contains all of the variables defined in config.ini? Do we?) |
From: Reini U. <ru...@x-...> - 2005-01-30 22:59:26
|
Joel Uckelman schrieb: > Thus spake Reini Urban: >>Joel Uckelman schrieb: >> >>>Would anyone else besides me find it useful to be able to set certain >>>headers (e.g., From, Reply-to) in mail sent by a wiki in that wiki's config >>>file? >>> >>>Say, in the config file you could have: >>> >>>EMAIL_HEADER_FROM = MyWiki <my...@ex...> >>>EMAIL_HEADER_REPLY_TO = MyWikiAdmin <wik...@ex...> >>>EMAIL_HEADER_X_ARBITRARY_JUNK = foo, bar! >>> >>>and those would be used in all outgoing mail from the wiki. >> >>Sure. >>And we really need a Mailer class, which should produce >>all outgoing mails. >>But I wanted to defer that to the next release. > > > I have a basic Mailer class hammered out now, and I have a few questions about > how we're handling constants. > > 1. I see that I would need to register nonboolean EMAIL_* constants in > IniConfig.php, yes? > > 2. Which would be preferable: > > a) EMAIL_HEADER_FROM and EMAIL_HEADER_REPLY_TO contain just the header > value, while EMAIL_HEADER_n contains the whole header > > b) Every header constant contains the whole header, while EMAIL_HEADER_FROM > and EMAIL_HEADER_REPLY_TO are named for convenience (rather than numbered) > because they'll be the ones people most often want to set. > > c) Every header constant contains only the header value, and the header > name is deduced from the constant name: e.g., when we process the constant > EMAIL_HEADER_FROM, we look at the part after EMAIL_HEADER_, lower case it > and capitalize the first letter to get the header name. > > d) Something else, like reading all of the user defined headers from a > file. I would say three constants: EMAIL_HEADER_FROM = "my name" EMAIL_HEADER_REPLY_TO = "my...@em...rver" EMAIL_HEADER_REST = "x-noarchive: yes\nx-sender: phpwiki" > I like c) myself, but I think it would involve a call to > get_defined_constants() and then a loop over the whole mess of them just to > find the ones which start with EMAIL_HEADER_. That might be unacceptably slow; > I'm not sure. (Unless we have a global dictionary which contains all of the > variables defined in config.ini? Do we?) Nope. Not yet. I added in some code and logic to dump/restore all config.ini setting from a writable config/config.php file for faster loading. This does some detection but it not used per default, since there's no writable config/config.php. Any pecl extension or other lib may define their own EMAIL_HEADER_* constants. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
From: Reini U. <ru...@x-...> - 2005-01-16 02:24:14
|
Joel Uckelman schrieb: > Thus spake Reini Urban: >>Joel Uckelman schrieb: >>>Would anyone else besides me find it useful to be able to set certain >>>headers (e.g., From, Reply-to) in mail sent by a wiki in that wiki's config >>>file? >>> >>>Say, in the config file you could have: >>>EMAIL_HEADER_FROM = MyWiki <my...@ex...> >>>EMAIL_HEADER_REPLY_TO = MyWikiAdmin <wik...@ex...> >>>EMAIL_HEADER_X_ARBITRARY_JUNK = foo, bar! >>> >>>and those would be used in all outgoing mail from the wiki. >> >>Sure. >>And we really need a Mailer class, which should produce >>all outgoing mails. >>But I wanted to defer that to the next release. > > How soon were you expecting to do another release? Maybe I could write a > basic Mailer class before then? As soon as the annoying bugs are fixed. I still got repeatable crashes (session related?) on certain cfg's. Looks like I'm the only one so far, but I have to find it. php-4.3.10 behaves strangely with full zend optimizations. Almost all older problems have been fixed. I don't care that much for finalizing the new features. I'll just disable the not-yet-working ones. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
From: Reini U. <ru...@x-...> - 2005-01-17 07:31:23
|
Reini Urban schrieb: > As soon as the annoying bugs are fixed. > I still got repeatable crashes (session related?) on certain cfg's. > Looks like I'm the only one so far, but I have to find it. > php-4.3.10 behaves strangely with full zend optimizations. Ok, the php-4.3.10 issue is resolved. I had to update to ZendOptimizer 2.5.7 Desc: my 4.3.10 creates numerical arrays as hash [0] => 'entry', ... so that foreach (array('entry0','entry1','entry2','entry3') as $n) ... will print "Illegal offset type". Only without zend debugger. with while (list(,$n) = each($array)) ... it works okay. Pear not working after update to 4.3.10 http://bugs.php.net/bug.php?id=31116 foreach returns the wrong value http://bugs.php.net/bug.php?id=30914 -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |