3

I am writing a program that polls an incoming mailbox (to which anyone who knows about it can post), reformats the info, then forwards the mail on to the correct address according to a predefined convention. For example, the incoming mail has:

From = "anybody@somedomain.com"
To = "myincomingmailbox@mydomain.com"
Subject = "Subject"
Body = "recipient@anotherdomain.com+newline+Body"

Then I take that email, preserve the "From" and "Subject" fields, but I change the "To" address to recipient@anotherdomain.com, and format the rest of the body according to my template.

Thus far all OK - but I anticipate a problem with spam filters on the recipient domains, since they may react as if I'm spoofing the "From" address.

What is the correct way to preserve the headers from the original mail intact, such that all the SPF/DKIM headers remain on the outgoing email, and the recipient domains don't treat the incoming mail as possible spam/phishing mails?

Druid
  • 6,423
  • 4
  • 41
  • 56
Shaul Behr
  • 36,951
  • 69
  • 249
  • 387
  • Sometimes, e.g. on gmail, the "to" field is part of dkim signature too "DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:to:subject:references:content-type:from:date :message-id:in-reply-to:user-agent;" – osgx May 26 '11 at 06:44
  • You would have to attach the original message to your new message. Automatically "forwarding" will cause new headers to be stamped on the message. – AutomationNation Jan 25 '12 at 16:55

0 Answers0