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
2
votes
1 answer

Sensitive information in email headers?

If the to: email is removed, is there any senstive information in an email header? The reason I ask is because I am starting a project (like many others) to document received spam. I plan to publish the headers (with my email and name removed). So I…
kburns
  • 782
  • 2
  • 8
  • 22
2
votes
1 answer

Change reply-to header of 'new order' email in Woocommerce

We were able to modify the reply-to email for the 'new order' email that WooCommerce generates to the admin email of the site using the filter from this answer: Custom "reply to" email header in Woocommerce New Order email notification What we're…
2
votes
1 answer

Problem with Gmail messages missing headers

I'm trying to programmatically parse my Gmail for various indexing functions, and am having trouble finding certain headers that I thought were standard email headers. I'm using the Zend IMAP library, and have no problems with authentication and…
tchaymore
  • 3,728
  • 13
  • 55
  • 86
2
votes
2 answers

send message through SMTP with guarantee ID

good day! sorry for so "clear" question, let me explain. In my "program", i'm sending some emails, through (for example) gmail SMTP server. Let's pretend that every email, which i've sent, contains some unique ID (generated by me) in header. Is…
Anton Koval'
  • 4,863
  • 5
  • 31
  • 44
2
votes
2 answers

Python 3.x email.message library: trying to remove specific header content such as bcc

The library functions for reading headers from an RFC822 compliant file are working just fine for me, for example: allRecips = [] for hdrName in ['to', 'cc', 'bcc']: for i in email.utils.getaddresses(msg.get_all(hdrName, [])): …
tuck1s
  • 1,002
  • 9
  • 28
2
votes
1 answer

Mailchimp: get rid of mcsv.net from header

In my Mailchimp account I successfully verified my domain and I also authenticated it with valid DKIM and SPF records (the domain is only an example): When sending campaings I set the From address to be info@mywebsite.com. But headers of received…
webpaul
  • 156
  • 4
  • 18
2
votes
1 answer

PHP Email Header multiple Attachments

i'm trying to send an E-Mail with PHP's inbuild mail() function but i didnt get how i send two attachments in this mail. I already can send Plaintext, Html Text and one attachment in my mail but it failes to send another. I'm sure anything in my…
J. Doe
  • 837
  • 1
  • 7
  • 18
2
votes
0 answers

Store custom header (or fixed message-id) on Gmail API draft

I'm working on a chrome extension to add functionality to the Gmail message composer, and it requires either: having a fixed Message-Id that won't change with draft updates (the API docs make it clear the Message-Id changes with every draft save,…
2
votes
1 answer

Postfix header_checks leading whitespace in regex

I am trying to PREPEND some dynamic data with postfix header_checks. Namely, my mailing software doesnt support List-unsubscribe feature, so I am trying to overcome that with prepending it with postfix header_checks My regex is currently like…
Kosta
  • 189
  • 1
  • 1
  • 9
2
votes
1 answer

PHP Mail Headers does not work?

Whenever I have the headers added to mail(), the recipient does not receive any email. This works ok: // The message $message = "Line 1\r\nLine 2\r\nLine 3"; // In case any of our lines are larger than 70 characters, we should use…
Run
  • 54,938
  • 169
  • 450
  • 748
2
votes
1 answer

How get header data from nsIMsgDBHdr in Thunderbird?

I'm trying to get a custom message from the nsIMsgDBHdr interface. let result = msgHdr.getProperty('x-custom'); But result is empty. I tried to register headers in the preferences but this has no effect. Please help.
Vitaliy Demchuk
  • 180
  • 1
  • 1
  • 9
2
votes
0 answers

Angular 2 webpack dev server response headers

I am currently studying angular 2 using cli with webpack dev server. I am trying to implement authentication using JWT but the problem is, in development mode using webpack dev server, i cannot get the response headers that i need. When i build it…
xian
  • 87
  • 1
  • 7
2
votes
0 answers

Strange behaviour of PHP mail()

I am using php mail() to send email from my website. But I am facing strange behaviour. $headers = "From: Saurabh Sharma \r\n"; $headers .= 'Reply-To: ' . $email . "\r\n"; $headers .= "Return-Path: me@example.com\r\n"; …
Saurabh Sharma
  • 2,422
  • 4
  • 20
  • 41
2
votes
1 answer

Multiple headers issue with JavaMail addRecipient method

A mail server returns this error when I send mail with several recipients : Remote Server returned 'mx.spamexperts.com #5.0.0 smtp; 550 Messages should have one or no To headers, not 5.' It happens when I use addRecipient method of JavaMail…
mfalaize
  • 310
  • 2
  • 9
2
votes
1 answer

Postfix, isolate multiple sites mail headers so if one get's blocked/blacklisted, the others sharing the server don't also get blacklisted

I have a few separate sites on a server with a single IP. The sites shouldn't ever send spam, but the customers are free to send emails from their sites so I have no way to prevent them from doing so. What I'd like to do is when sending the emails…
stilliard
  • 762
  • 8
  • 27