Skip to content

Commit

Permalink
also log message_id in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
ibotty committed Oct 17, 2023
1 parent 9293e34 commit b7a1bb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b7a1bb0

Please sign in to comment.