Questions tagged [email-headers]

E-mail headers are the headers at the beginning of an e-mail that define various properties (e.g. `From` or `Reply-To`) of the e-mail.

In an e-mail, the body (content text) is always preceded by header lines that identify particular routing information of the message, including the sender, recipient, date and subject. Some headers are mandatory, such as the FROM, TO and DATE headers. Others are optional, but very commonly used, such as SUBJECT and CC. Other headers include the sending time stamps and the receiving time stamps of all mail transfer agents that have received and sent the message. In other words, any time a message is transferred from one user to another (i.e. when it is sent or forwarded), the message is date/time stamped by a mail transfer agent (MTA) - a computer program or software agent that facilitates the transfer of email message from one computer to another. This date/time stamp, like FROM, TO, and SUBJECT, becomes one of the many headers that precede the body of an email.

Characteristics

A single email header has some important characteristics, including perhaps the most important part of an email - this is the KEY:VALUE pairs contained in the header. Looking at the above, you can tell some of the KEY:VALUE pairs used. Here is a breakdown of the most commonly used and viewed headers, and their values:

  • From: sender's name and email address (IP address here also, but hidden)
  • To: recipient's name and email address
  • Date: sent date/time of the email
  • Subject: whatever text the sender entered in the Subject heading before sending

Routing

Email headers also provide information on the route an email takes as it is transferred from one computer to another. As mentioned earlier, mail transfer agents (MTA) facilitate email transfers. When an email is sent from one computer to another it travels through a MTA. Each time an email is sent or forwarded by the MTA, it is stamped with a date, time and recipient. This is why some emails, if they have had several destinations, may have several RECEIVED headers: there have been multiple recipients since the origination of the email. In a way it is much like the same way the post office would route a letter: every time the letter passes through a post office on its route, or if it is forwarded on, it will receive a stamp. In this case the stamp is an email header.

List of Email Header Fields

IANI maintains a list of email headers here.

405 questions
1
vote
2 answers

wp_mail function headers

I would to customize the sender of the email so I am trying to set properly the headers of the email. This is the cose I use to customize the headers: $current = wp_get_current_user(); global $user_email; get_currentuserinfo(); $headers_mail =…
pAkY88
  • 6,262
  • 11
  • 46
  • 58
1
vote
2 answers

Golang: Encountering issue trying to parse Outlook msg files (emails) malformed MIME header: missing colon:

I have a task to parse both eml and msg formatted email files using Go. There's a wonderful package for parsing EML files, however, with MSG, no matter what package I research and attempt to implement, I encounter the same error every single…
Randy J
  • 13
  • 3
1
vote
1 answer

email.header.decode_headers() throws an HeaderParseError

I'm trying to decode email Subject headers. I'm doing this (the regex is for adding a space between the two = 's: header = '=?iso-8859-1?B?TU9UT1IubmwgbmlldXdzYnJpZWYgPiBOaWV1d2UgdmVya29vcHRvcHBl?==?iso-8859-1?B?ciBTdXp1a2kg?=' header =…
Leon
  • 841
  • 3
  • 10
  • 21
1
vote
1 answer

Wordpress new registration email (ONLY) blocked by gmail

The Problem: All Wordpress registration emails (with the password) are getting blocked by google. Details: The site's email is currently being hosted by google apps. THOSE emails WILL send to gmail addresses. So the problem is specifically emails…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
1
vote
1 answer

VBA Lotus Notes MIME attached PDF cannot be displayed

I had some issues with code that I wrote to send 2 attachments via VBA, with some help I figured out how to use MIME to attach 2 different attachments. However now the issue seems to be that the HTML attaches as body fine but the PDF that I want as…
Drawleeh
  • 297
  • 1
  • 10
1
vote
0 answers

TRANSPORT.RULES.RejectMessage; the message was rejected by organization policy

Bounce Email Event Occurred. From Email: no-reply@somedomain Email Subject: Some subject Bounced Recipients: Emailaddress: example@somedomain Action: failed Status: 5.7.1 Diagnosticcode: smtp;550 5.7.1 TRANSPORT.RULES.RejectMessage; the message was…
1
vote
1 answer

How to find Outbound/outgoing mail server of a domain?

The received headers in the email are basically the addresses of the email servers that the email was passed to reach their destination. The last received header is originating address for the email coming from a domain. So If I am receiving a mail…
1
vote
1 answer

Python Email Header parsing get_all()

I'm parsing mailbox files with Python and stumbled upon a strange behvior when trying to get all "To:" headers with get_all(): tos = message.get_all('to', []) if tos: tos = getaddresses(tos) for to in tos: receiver =…
Gregor
  • 95
  • 2
  • 4
1
vote
1 answer

Lotus Notes is not handling my email properly

I have a php app that sends email to the users. For most users this is just fine. However users with Lotus Notes for their email client are recieving an email that appears to start with some of the headers I have added to the message. I have tried…
Ian
  • 1,941
  • 2
  • 20
  • 35
1
vote
0 answers

Send Mail Header as auth_username insteall of declared variable

Hi guys just wondering why my code display header as auth_username instead of declared variable function sanitize_my_email($field) { $field = filter_var($field, FILTER_SANITIZE_EMAIL); if (filter_var($field, FILTER_VALIDATE_EMAIL)) { …
1
vote
2 answers

MIME email Subject etc. headers vs. utf8: first split, then encode?

Let's take this Subject line, $ echo -n 台電用戶意見電子信箱-信件受 | base64 5Y+w6Zu755So5oi25oSP6KaL6Zu75a2Q5L+h566xLeS/oeS7tuWPlw== It (along with "Subject:" etc.) exceeds the limits when encoded. So, some mailers (a certain power company's) first encode it,…
Dan Jacobson
  • 490
  • 3
  • 14
1
vote
0 answers

Please suggest improvements for fuzzy matching email header string values with Python

I'm currently trying to match 2 values that are found in the From header of an email. Specifically, the Sender Name and the Email_ID. To illustrate here is an example of this headers content: "Surname Lastname"…
1
vote
0 answers

php mail sending from a default email address instead of one I specify

I have a form that sends data to the script below. It's supposed to send a message from the person specified in the form's emailaddress. Instead, I get it coming from a strange email address from my hosting company. I've checked the php over and…
1
vote
4 answers

correct email FROM header usage

I want to let users share information on my site by sending an email to a friend. Before I go to far I want to make sure I won't get blacklisted for doing something incorrectly. If my domain is example.com can I set the mail FROM header to the…
hungerstar
  • 21,206
  • 6
  • 50
  • 59
1
vote
0 answers

How to hide email headers info like X-me and Received?

in my inbox i see that some emails have a pretty header that won't let us get much info about the sender as exemple : From: Boutique Fr Date: Thu, 20 Aug 2020 06:32:11 +0600 Subject: Important Deals Message-Id:…
JoeVenner
  • 30
  • 4