I am trying to send email back to the sender using sendmail -oi -t
, but somehow it extracted MTA, how to write the receipt to get the real sender since the email return-path and first From in the email header is MTA, not the real sender? So sendmail can deliver email back to: Sender: [email protected]
or From: [email protected]
Here is the procmail.log and email received:
...
procmail: Matched "[email protected]"
procmail: Match on "^Sender: \/.+"
procmail: Assigning "LASTFOLDER= (/usr/bin/formail -rA"Precedence: junk" \
-A"X-Loop:[email protected]" \
-I"To: $MATCH"; \
echo "$result"; \
) | /usr/sbin/sendmail -oi -t"
procmail: Assigning "PATH=/home/r/bin:/usr/local/bin:/usr/bin:/bin"
procmail: Unable to treat as directory "/var/mail/new"
procmail: Skipped "/var/mail"
procmail: Assigning "LASTFOLDER=/var/mail/r"
procmail: Executing " (/usr/bin/formail -rA"Precedence: junk" \
-A"X-Loop:addr2mydomain.com" \
-I"To: $MATCH"; \
echo "$result"; \
) | /usr/sbin/sendmail -oi -t"
procmail: Opening "/var/mail/r"
procmail: Acquiring kernel-lock
procmail: Notified comsat: "r@884017:/var/mail/r"
From btv1==909280b6006==+1xxxxxxxxxx/[email protected] Mon Apr 11 17:09:24 2016
Folder: /var/mail/r
Here is the email header:
From btv1==9062f44d095==+xxxxxxxxxx/[email protected] Fri Apr 8 00:19:01 2016
Return-Path: <btv1==9062f44d095==+xxxxxxxxxx/[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from ch3p-tmo-mm3-sfw004.syniverse.com (chi-tmo-mm3.syniverse.com [x.x.x.x])
by mail.mydomain.com (Postfix) with ESMTP id 7D444222D0
for <[email protected]>; Fri, 8 Apr 2016 00:19:01 +0000 (UTC)
Received: from tmobile.net ([10.166.3.161]) by ch3p-tmo-mm3- sfw004.syniverse.com with ESMTP id RuIW8dEKbs9H2Iyg for <[email protected]>; Fri, 08 Apr 2016 00:18:58 +0000 (GMT)
To: [email protected]
From: [email protected]
Content-Type: multipart/related;Type="text/html";boundary="-boundaryRMS123"
Date: Fri, 8 Apr 2016 00:18:58 GMT
Message-ID: [email protected]
Sender: [email protected]
User-Agent: iPhoneOS/9.2.1 (13D15)
X-Virus-Scanned: by bsmtpd at syniverse.com
Here is the last part of recipe:
:0hc
* !^X-Loop:[email protected]
* ^Sender: \/.+
| (/usr/bin/formail -rA"Precedence: junk" \
-A"X-Loop:[email protected]" ; \
echo "$result"; \
) | /usr/sbin/sendmail -oi -t