Eu consertei o problema com o procmail.
Fonte: link
Abaixo está um exemplo:
#Get the sender's bare email address from the first "From" line
FROM_='formail -c -x"From " \
| expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g' \
| awk '{ print $1 }''
#Get the original subject of the email
#Discard superfluous tabs and spaces
#On some systems -xSubject: has to be -x"Subject: "
SUBJ_='formail -c -xSubject: \
| expand \
| sed -e 's/ */ /g' \
| sed -e 's/^[ ]*//g' -e 's/[ ]*$//g''
#Whatever other recipes you'll use
:0
* ^From:.*infolist@([-a-z0-9_]+\.)*infohost\.infodom
# Avoid email loops
* ! ^X-Loop: myid@myhost\.mydom
{
:0c: #Preserve a copy of the email
Infolist.mail
:0fwh #Adjust some headers before forwarding
| formail -A"X-Loop: [email protected]" \
-A"X-From-Origin: ${FROM_}" \
-i"Subject: $SUBJ_ (fwd)"
# Forward the email
:0
[email protected]
}