src/strip.vala
[app.mailtrimmer] / src / strip.vala
index e05a408..c9c997b 100644 (file)
@@ -480,12 +480,14 @@ public class Strip : GLib.Object {
 
                                ) VALUES (
                                        %d,  -- id
+                                       
                                    '%s' , -- msgid
                                    0,
                                    '%s'  , -- filename
-                                   '', 
-                                   '',
-                                   '',
+                                   '%s',  -- mimetype
+                                   
+                                   '%s', -- stored file anme
+                                   '', -- charset
                                    'attachment',
                                    0,
                                    0,
@@ -497,29 +499,21 @@ public class Strip : GLib.Object {
                                )"
                       
                       
-                        INSERT INTO Attachment (
-                               id, msgid, checksum, mime_type,
-                               mime_filename,  filesize,mime_size,  mime_cdisp
-                               ) values (
-                               ( 
-                            %d,   '%s', '%s',  '%s',
-                            '%s'  %d, %d, 'attachment', 
-                            
-                            ) 
-                            
                      """.printf(
                                id,
                                      this.mysql_escape(this.active_message_exim_id),
-                                     this.mysql_escape(chksum),
-                                 this.mysql_escape(mime_type),                                                       
-                                     this.mysql_escape(filename),                        
+                                     this.mysql_escape(filename),
+                                 this.mysql_escape(mime_type),
+                                 this.mysql_escape(file_path),
+                                       file_size
                                      file_size
+                                     this.mysql_escape(chksum)
                         ));
-                        
+             // this is done to fix the queue_id or maillog_id ??
                 this.query("""
                  SELECT attachment_update(
                       %d, -- in_id INT(11),
-                      '%s', -- in_mime_type varchar(255),
+
                       '%s', -- in_created DATETIME,
                       '%s' -- in_mailfort_sig varchar(64)
                  )