diff --git a/src/db.rs b/src/db.rs index e6cfffa..5a792cc 100644 --- a/src/db.rs +++ b/src/db.rs @@ -4,6 +4,7 @@ use sqlx::postgres::PgPool; pub async fn insert_mail( pool: &PgPool, + message_id: &str, rcpt: &str, from: &str, body_text: &str, @@ -13,8 +14,9 @@ pub async fn insert_mail( ) -> Result<()> { let query = sqlx::query!( r#"INSERT INTO data_gateways.smtp_gateway - ("to", "from", body_text, body_html, headers, attachments) - VALUES ($1, $2, $3, $4, $5, $6);"#, + (message_id, "to", "from", body_text, body_html, headers, attachments) + VALUES ($1, $2, $3, $4, $5, $6, $7);"#, + message_id, rcpt, from, body_text, diff --git a/src/s3.rs b/src/s3.rs index 46fdd28..ebb657c 100644 --- a/src/s3.rs +++ b/src/s3.rs @@ -88,6 +88,7 @@ pub async fn upload_message( // afterwards, when complete, insert into DB db::insert_mail( pg_pool, + message_id, rcpt, from, body_text