X-Envelope-To: vs. To:


2013/06/13

If you've ever poked around in the "Advanced Options" section of your Kerio Connect mail server configuration, you might have wondered about the check-box for "Insert X-Envelope-To header to locally delivered messages".

Kerio Connect X-Envelope-To header

The newest manuals don't even mention that, but the older versions do have at least this much to say:


Defines if the X-Envelope-To entry will be inserted into the header of messages delivered locally. X-Envelope-To is the original recipient address based on the SMTP envelope. This option is useful especially if there is adomain mailbox in Kerio Connect.

Perhaps a little more explanation is in order.

If you've ever done a "View source", you are certainly familiar with the "To:" header. Normally that contains your email address, but you might sometimes see something very odd like this example:

Mime-Version: 1.0
To:[email protected]
From: Vendor Support <VendorSupport@notyourdomain.com>
Return-Path:VendorSupport@notyourdomain.com
 

You are not "[email protected]", yet the email arrived in your mailbox. How?

The answer is simple enough: "To:" doesn't really matter. If we use the analogy of a physical letter, that "To:" is what's written on the letter itself and is not necessarily what's written on the envelope that told the Post Office how to get that letter to you. Just like a physical letter, email has an outer envelope too.

Most email clients don't let you play any games with what's inside and outside. When you send an email, the envelope address and the "To:" address are usually going to be the same. But they don't have to be.

A little Perl script shows that more plainly:

#!/usr/bin/perl

sendit($ARGV[0], $ARGV[1] );

sub sendit {
my $xenvelope_who=shift;
my $apparently_to=shift;

open(SENT,"|/opt/kerio/mailserver/sendmail $xenvelope_who");
print SENT <<EOF;
Content-Type: text/html
Content-Transfer-Encoding: 8BIT
From: tony\@aplawrence.com
To: $apparently_to
Subject: X-env test

This was just a test

EOF
close SENT;
} 
 

We can use that to munge up "To:"

tmail.pl [email protected] [email protected]
 

To nobody@all

Kerio Connect "sendmail" helpfully added the true send-to address anyway, but as you saw in the first "VendorSupport" example I showed, that isn't always going to be the case. That's when we'd want to have "Insert X-Envelope-To header to locally delivered messages" turned on:

 With Show X-Envelope-To on

By the way, although we used something that at least vaguely looks like an email address, we don't have to:

tmail.pl [email protected] not_even_an_email_address_at_all
 

Tonot_even_an_email_address_at_all

If you are wondering what "This option is useful especially if there is a domain mailbox in Kerio Connect" is referring to in the old manuals, I suspect it has to do with POP3 downloads, but I have no way to test that right now.



Got something to add? Send me email.





(OLDER) <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> X-Envelope-To: vs. To:


2 comments



Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence







Fri Jun 14 13:03:45 2013: 12123   j0rg3

gravatar


Seems that I recall there being an optional field for this in Mutt (possibly Alpine) and that the MTA I was wrasslin' with at the time refused my messages until I found the option and formatted it precisely to its liking.

While researching that issue, I believe that I read getting creative with this field also increases the likelihood of your messages being snarfed up by a spam filter.



Fri Jun 14 13:20:25 2013: 12124   TonyLawrence

gravatar


I think you are right about Mutt and I would not be surprised if "creativity" attracts some spam points..

------------------------
Kerio Connect Mailserver

Kerio Samepage

Kerio Control Firewall

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





Premature optimization is the root of all evil. (Donald Knuth)

C is quirky, flawed, and an enormous success. (Dennis Ritchie)








This post tagged: