Y
Y
Yuri Kovlenko2016-06-25 23:05:24
Debian
Yuri Kovlenko, 2016-06-25 23:05:24

How to get the body of an email when it is forwarded?

Good day. It is necessary to make an additional redirection of sent letters from the server to the group chat in the telegram. With the telegram itself, everything is clear, and sending messages is working properly. Email forwarding is done via /etc/aliases:

telegram: "|/usr/scripts/forwarding"

The problem is how to get the body of the letter in a bash script?
System: Debian 8, Postfix

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Mikhalev, 2016-06-27
@BaronAleks

did this a long time ago...
first we redirect the letter, it was automatically set to the HOLD status

cat /etc/postfix/hold
[email protected] HOLD

then look at the letter ID:
and look at the message itself:
remove the letter from the queue:
postsuper -d ID

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question