[ic] Email tag: different behaviour sendmail and Net::SMTP

Kevin Walsh kevin at cursor.biz
Wed Jan 31 11:14:04 EST 2007


Ton Verhagen <tverhagen at alamerce.nl> wrote:
> I am experiencing problems with the email tag in IC5.5.0 (cvs)
> 
> It does all the tricks when I use sendmail as the mail agent,
> however, using Net::SMTP the following code does not send
> email. Running the code including the test=1 option shows
> a properly formatted email message imho.
> 
> Please note:
> Sending email without an attachment works fine using Net::SMTP
> 
> [email
>          to="info at alamerce.nl"
>          from="info at alamerce.nl"
>          subject="File: bg.gif"
>          attach='images/bg.gif'
> ]Here is your file.[/email]
> 
> What could be wrong?
> 
It appears that if you use "attach" then [email] calls [email-raw] for
some reason.  [email-raw] doesn't appear to have been coded to make use
of Net::SMTP.

A quick and dirty fix might look a little bit like this:

--- code/UserTag/email.tag      8 Nov 2005 18:14:42 -0000       1.12
+++ code/UserTag/email.tag      31 Jan 2007 16:11:25 -0000
@@ -159,7 +159,14 @@
                        return $body;
                }
                else {
-                       return $Tag->email_raw({}, $body);
+                       $body =~ s/^(.*)\n\n//s;
+
+                       foreach (split("\n",$1)) {
+                               next unless $_;
+                               next if $_ =~ /(?:Date|To|From|Subject)/i;
+
+                               push(@extra,$_);
+                       }
                }
        }

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/


More information about the interchange-users mailing list