[interchange] Prevent [email] tag from crashing on missing attachments.

Stefan Hornburg <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit 4f1c94c518934ad9dbc82dab691425fa460ec5f5
Author: Stefan Hornburg (Racke) <[email protected]>
Date:   Wed Nov 17 10:20:54 2010 +0100

    Prevent [email] tag from crashing on missing attachments.

 code/UserTag/email.tag |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/code/UserTag/email.tag b/code/UserTag/email.tag
index c4c9c73..202d809 100644
--- a/code/UserTag/email.tag
+++ b/code/UserTag/email.tag
@@ -196,6 +196,7 @@ sub {
 				$msg->attach(
 					Type => $ref->{type},
 					Path => $ref->{path},
+					ReadNow => 1,
 					Data => $ref->{data},
 					Filename => $ref->{filename},
 					Encoding => $ref->{encoding},
@@ -204,7 +205,9 @@ sub {
 			};
 			if($@) {
 				::logError("email tag: failed to attach %s: %s", $ref->{path}, $@);
-				next;
+				$Tag->error({name => 'email', 
+					set => errmsg('Failed to attach %s', $ref->{path})});
+				return;
 			}
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.