3

Есть почтовый сервер postfix+dovecot

Цель: Когда на ящик user@example.com приходит письмо мне нужно запустить bash скрипт передав в него данные из письма

Пытаюсь написать dovecot sieve filter

require "envelope";
require "variables";
require "vnd.dovecot.pipe";

if envelope :matches "From" "*" { set "sender" "${0}"; }
if header :matches "Date" "*" { set "date" "${0}"; }
if header :matches "Content-Type" "*" { set "content_type" "${0}"; }
if header :matches "subject" "*" { set "subject" "${0}"; }
if header :matches "message-id" "*" { set "message_id" "${0}"; }

if envelope :matches "To" "user@example.com" {
   set "recipient" "${0}";

   pipe "forwarding_cimp.sh" ["message_id:${message_id} date:${date} content_type:${content_type} sender:${sender} recipient:${recipient} subject:${subject}"];
}

но я не могу найти информацию о том как мне передать тело письма, с учетом того, что в письме может быть вложения и т.д.

Подскажите как в переменную записать body, attachments и т.д. Самым идеальным вариантом было бы получение исходного raw_text письма

1

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Посмотрите другие вопросы с метками или задайте свой вопрос.