[ic] email-raw usertag broken for Net::SMTP FIX

Peter peter at pajamian.dhs.org
Sun May 1 22:59:00 EDT 2005


On 05/01/05 19:21, Mike Heins wrote:
> Quoting Peter (peter at pajamian.dhs.org):
> 
>>That should work, but it doesn't make sense to me to do it that way. 
>>Let me explain...
>>
>>$head is supposed to be an array ref of individual headers.
> 
> 
> It is? 8-) I am not sure that is true. I believe I wrote the code,
> and I don't know that I defined that to be what it was. In fact, I deplore
> the way it is and consider it some of the worst code I have ever produced
> that has lived a long time (I guess it is tied with order profiles and
> the log_transaction setup). Even just now found a bug where the valid
> "Reply-To" header would not be recognized.

Sorry, I'll rephrase that.  From what I can tell by looking at the 
source $head currently accepts an array ref of individual headers and 
won't work if you pass parts of headers in seperate elements.  Changing 
that behavior seems to me to be redefining what is supposed to be in 
that array.

>>It would 
>>seem to me that passing parts of headers in individual elements would be 
>>a broken usage of the array.  It doesn't make sense to fix this in 
>>send_mail as send_mail should not be respoonsible for fixing the broken 
>>array that is passed to it from other functions.  send_mail should be 
>>able to expect that the array passed to it is good.  So it makes more 
>>sense to me to fix it in the email-raw usertag (and other usertags and 
>>functions that do something similar) so they don't pass a broken array 
>>to send_mail.
> 
> 
> Hmm. I guess I just disagree. Again, we get into the possibility of
> a number of different versions of header-canonicalization code.
> 
> I try to be of the "be strict in what you send, but tolerant in what
> you accept" school, and it seems to me that send_mail should be pretty
> tolerant if it is to be the main facility for sending mail -- particularly
> if we do what I think should be done and add a "raw" option to that and
> make the email tag just a wrapper around send_mail.

I agree when dealing with two different programs interacting with each 
other, but when dealing with functions inside a program you're talking 
about a lot of code-bloat in the functions if you try to account for bad 
data being sent to the function.

We may have to agree to disagree here, but I think there may be a better 
approach.  Why not have send_mail take on the task of splitting the 
entire header block instead of making the calling function or tag do it? 
  This could save us a lot of code duplication and makes this entire 
argument moot.

Peter


More information about the interchange-users mailing list