Score:0

Postfix: add/modify the e-mail body

us flag

I've set up a postfix mail server for my local network, that uses Postmark as smarthost. This actually works fine. But my Canon printer/copier sends mails without a mail body, but with attachment only.

This gives an error on the Postmark side: ErrorCode: '300', Message: 'Provide either email TextBody or HtmlBody or both.'.

Therefore I'd like to add a rule to my postfix to add a TextBody to the mail if it is missing, before forwarding to the smarthost. Any ideas?

Nikita Kipriyanov avatar
za flag
I'd consider this as a bug in the Postmark, because MIME email which consists only of one "attachment" (non-text) file is perfectly fine email according to the standard. Tried to ask their support?
anx avatar
fr flag
anx
Postfix supports *milter* and *filter* interfaces, you might find a good starting point for your script by searching for filters/milters written in the language of your choice. However, please [edit] your question to include a sample mail (abbreviate the attachment), for a few special cases where the headers are already almost-suitable there may be a simpler method using postfix built-ins.
Caleb avatar
us flag
@NikitaKipriyanov I did not even try to reach their support, because I've found this article beforehand: https://postmarkapp.com/support/article/1180-what-does-errorcode-300-mean Probably it's not a bug, it's a feature ;-)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.