This commit is contained in:
vanten-s 2024-08-28 15:10:16 +02:00
parent 2a28b63c08
commit 7b35a3c08d
Signed by: vanten-s
GPG key ID: DE3060396884D3F2

View file

@ -53,6 +53,7 @@ async fn message_handler(message: String) -> Result<()> {
let message = MessageParser::default().parse(&message).unwrap();
let message_body = message.body_text(0).unwrap();
let message_subject = message.subject().unwrap();
let message_sender = message.from().unwrap().as_list().unwrap()[0]
.address()
.unwrap();
@ -61,7 +62,7 @@ async fn message_handler(message: String) -> Result<()> {
return Ok(());
}
let message = format!("New mail from {message_sender}:\n{message_body}");
let message = format!("New mail from {message_sender} with subject {}:\n{}", message_subject.trim(), message_body.trim());
send_message(&message).await?;
Ok(())