src/strip.vala
authorAlan Knowles <alan@roojs.com>
Fri, 4 May 2018 05:25:38 +0000 (13:25 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 4 May 2018 05:25:38 +0000 (13:25 +0800)
src/strip.vala

index d941b8a..ea40d1e 100644 (file)
@@ -439,7 +439,12 @@ public class Strip : GLib.Object {
                //var create_dir = this.created_dir;
                
                
-               if (rs != null  && rs.num_rows() > 0) {
+               if (rs == null  || rs.num_rows() < 1) {
+                       GLib.debug("ERROR - file size of write to stream returned 0?");
+               Posix.unlink(fn);               
+               return;
+               
+               }
                        file_id =  row[0];
                        //create_dir = row[1];
                        //GLib.debug("msgid %s", row[2]);
@@ -463,61 +468,8 @@ public class Strip : GLib.Object {
                                '%s', -- in_mailfort_sig varchar(64)
                                
                                ) as result
-                        
-                       
-                       INSERT INTO
-                                       Attachment 
-                               (
-                                        queue_id,
-                                        mime_charset,
-                                        mime_cdisp,
-                                        mime_size,
-                                        
-                                        mime_is_cover,
-                                        mime_is_multi,
-                                        mime_is_mail,
-                                        
-                                        msgid,
-                                        maillog_id,
-                                        delivered,
-                                        
-                                        
-                                        checksum,
-                                        filesize,
-                                        stored_filename,
-                                        
-                                        created,
-                                        mime_filename,
-                                        mime_type,
-                                        
-                               )
-                                       VALUES
-                               (
-                                        COALESCE((SELECT id from MailQueue where msgid = '%s' AND message_sig = '%s' AND  msgid != '' AND message_sig != '' LIMIT 1),0),
-                                        '%s',
-                                        '%s',
-                                        %d,
-                                        
-                                        0,
-                                        0,
-                                        0,
-                                        
-                                        '%s',
-                                        COALESCE((SELECT id from email_log where msgid = '%s' AND message_sig = '%s' AND  msgid != '' AND message_sig != '' LIMIT 1),0),
-                                       '%s',
-                                        
-                                        '%s',
-                                        %d,
-                                        '%s',
-                                        
-                                        '%s',
-                                        '%s',
-                                        '%s' 
-                                         
-                               )
-                                        
                      """.printf(
+                     
                                this.mysql_escape(this.active_message_exim_id), this.mysql_escape(this.active_message_x_mailfort_sig),
                                "",
                                "attachment",