Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I often see email headers like these when I get email these days:

Received: by FQDN (Postfix, from userid $USERID)

So does that mean that people SSH into their VPS and send email from there or is there a way of relaying email from my local computer through the VPS?

Basically, I want to do the same to hide my IP address when I send an email through SMTP and want to use the VPS address instead.

share|improve this question
What MTA are you using? Why would it be relevant that you are talking about a VPS? Are you sure this isn't simply what Spamcop calls an "internal handoff"? Normally the MTA will include the IP address of the connecting host, and this is recommended by the standard; see RFC 5321 section 4.4 (Trace Information). – Michael Kjörling May 20 '13 at 7:42

Assuming you have relaying via your VPS working, if you'd like to remove some headers from emails relayed via Postfix it's fairly straightforward.

  1. Create a new file called /etc/postfix/header_checks with the following contents:

    /^Received:.*with ESMTPSA/              IGNORE
  2. Rebuild the lookup table:

    # postmap /etc/postfix/header_checks
  3. Edit /etc/postfix/main.cf and add the following line:

    smtp_header_checks = regexp:/etc/postfix/header_checks
  4. Restart postfix (assuming Debian/Ubuntu here):

    # /etc/init.d/postfix restart

When you send an email now, you should see all but the last Received header removed.

share|improve this answer

The best way to understand this is to try to send mail yourself using different methods.

I have found that the UID changes based on two factors (but there may be more).

  1. If the script uses the sendmail binary then it will reflect the UID of the user that invoked the script.
  2. If the script directly connects using SMTP it'll use the UID of the MTA.
share|improve this answer
I am not concerned about the UID at all, what I want to know is what is the "usual" way of sending email that have the headers matched above. – Kasey May 20 '13 at 3:34

Two ideas:

Setup a proxy on the VPS (use SSH port forwarding, nc, or some type of SMTP forwarder that doesn't add received headers).

Write a program that runs on the VPS, have it take the emails from your and then inject the email locally (using sendmail/postfix from the command line or have it connect to localhost port 25).

share|improve this answer

These headers are put in automatically by the servers the mail touches while making it's way tot he destination. If you want your VPS's server name to appear, you should use your VPS as the "smart relay" in your local mail configuration. With sendmail, this is done via the SMART_HOST definition in the /etc/mail/sendmail.cf file. You'll then need to ensure that your VPS is relaying mail properly, only from you, and isn't on any sort of blacklist (which is quite common for VPSes in my experience). Alternately, you can use your VPS as your mail host and simply connect to it via IMAP, instead of having a local MTA.

share|improve this answer
You can always modify headers of ip packet, en.wikipedia.org/wiki/Packet_generator – innocent-world Aug 23 '13 at 15:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.