Hide my IP address from gmail headers when sending mails via python SMTP library?

gmail, python

Solution

Those headers are added by the gmail SMTP server. There is no way to hide them.

Problem

I am currently using python SMTP library to send e-mails to certain clients. I am using the smtp.gmail.com:587 server. I noticed that in the original headers of any received e-mails sent by this code, the IP address of my own server which sent the e-mail appears. How can I hide this information ? Thanks in advance. ``` server = smtplib.SMTP('smtp.gmail.com', 587) #server.set_debuglevel(1) server.ehlo() server.starttls() server.login("my gmail account", "gmail account passwd") server.sendmail(source, [destination], message) server.quit() ``` Headers received by such an email. ``` Delivered-To: XXXXXXXXXXX@XXXXXXXXX.com Received: by 10.52.117.49 with SMTP id kb17csp32285vdb; Thu, 5 Dec 2013 09:23:19 -0800 (PST) X-Received: by 10.66.235.106 with SMTP id ul10mr89187198pac.19.1386264198756; Thu, 05 Dec 2013 09:23:18 -0800 (PST) Return-Path: <noreply@XXXXXXX.com> Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx.google.com with ESMTPS id v7si58653928pbi.128.2013.12.05.09.23.18 for <XXXXXXXXXXXX@XXXXXXX.com> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 09:23:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.172 is neither permitted nor denied by best guess record for domain of noreply@XXXXXXXXX.com) client-ip=209.85.192.172; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.192.172 is neither permitted nor denied by best guess record for domain of noreply@XXXXXXX.com) smtp.mail=noreply@XXXXXXXXXXXX.com Received: by mail-pd0-f172.google.com with SMTP id g10so25045148pdj.31 for <XXXXXXXXXXX@XXXXXXXXX.com>; Thu, 05 Dec 2013 09:23:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:to:cc:subject; bh=q/9aftTaFh6ryLKbZzIDy6Hfz1R4BSYhG2tvHwxCBLU=; b=C7Ke+Q6gVau5OxK9BZTuFx2ny0lO35WRjgsWoGyjlbQ0hlTRyQbD18ALNnlbdowUzR JHO8Smvr2EpgTFQ6h9gsLx6V8fmrfpFNWyQWOFgs6h46d9b1TTW7LWQZfVOIfWD6CfgG 7hUTl7/YFcLbuUQpcOMUDJ/LK7AN4Yp6J6n2nzA6m46QOKKSP7t62OCUTlCd9JoLg4D3 zPkF7oFptlyHWwpZCN5FozbqjuLx6rQfaZpKKMd2q4OXsPd0/CwtOOpBaf1BNVF7HOnD VJR8YrpFI/gpUOfJJz9R5l8DXE8KAkMCW+10OAupdTzwP9gtSk2coHBA+N05Q2ezzDuK Np3w== X-Gm-Message-State: ALoCoQn41Nai7QBm96wqd4aNJPrBfx2AlYr+PlZzQ wAxujazDPTnRQG80l4v/Oy35W/3ZIz6jCIa X-Received: by 10.68.66.103 with SMTP id e7mr53292154pbt.120.1386264197850; Thu, 05 Dec 2013 09:23:17 -0800 (PST) Return-Path: <noreply@XXXXXXXXX.com> Received: from [127.0.0.1] ([xx.xxx.xxx.xx]) by mx.google.com with ESMTPSA id er3sm145968195pbb.40.2013.12.05.09.23.15 for <XXXXXXXXXXX@XXXXXXXXXx.com> (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 05 Dec 2013 09:23:16 -0800 (PST) Message-ID: <52a0b684.a363440a.5bbc.ffff8e2e@mx.google.com> Date: Thu, 05 Dec 2013 09:23:16 -0800 (PST) From: noreply@XXXXXXXXXX.com To: XXXXXXXX@XXXXXXXXX.com Cc: Subject: FTP Credentials Your FTP account credentials are: User Name = xxxxxxxxxxx Password = xxxxxx ```

Original source