LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-17-2013, 03:57 AM   #1
NikosGr
Member
 
Registered: Jun 2013
Posts: 63

Rep: Reputation: 0
Question Tryign to alter the mail headers when using the local MTA


Code:
# =================================================================================================================
# if html form is submitted then send user mail
# =================================================================================================================
def random_char( y, chars=string.ascii_uppercase + string.digits ):
	return ''.join( random.choice(chars) for x in range(y) )


for times in range(0, 5):
	try:
		# prepare mail data
		FROM = random_char(8) + '@' + 'mail' + '.org'
		TO = "nkouras@ath.fothnet.gr"
			
		SUBJECT = random_char( 50 )
		MESSAGE = random_char( 500 )
		
		os.system( "echo %s | mailx -v -r %s -s %s %s" % (MESSAGE, FROM, SUBJECT, TO) )

		print( "<h2><font color=blue>%sη αποστολή προς %s επετεύχθη!</font></h2>" % (times, TO) )
	except Exception as e:
		print( "sendmail => ", date, repr( sys.exc_info() ) )
else:
	print( '''<h2><font color=red>Δεν επιτρέπεται η χρήση του script από μη εξουσιοδοτημένα πρόσωπα!''' )
Even if now i have stopped using Google's SMTP Server as a means for
sending out mails and i have decided to use my local MTA instead, at the
very moment Google's POP servers receive the mail they still add a
RECEIVE header revealing the hostname of the server that initiated the
contact. Correct?

But even so, if we alter for example the hostname of our server to a
different name then wouldn't Google use that to identify the server thus
protecting the real identity(hostname that is) of the server that
initiated the connection?

In any case is ee this in my mail headers when i try to send mailQ

Code:
Received: from nikos by my.superhost.gr with local (Exim 4.80.1)
    (envelope-from <I6ZKG6D5@mail.org>)
    id 1VLam4-0004nG-TJ
I wish this not to be displayed.
 
Old 09-18-2013, 12:02 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Mail receive headers are added by the MTA to allow tracing back to the source of the mail. Receive headers may include the id that your mailer supplies (which is not necessarily your hostname), the IP address, and the reverse lookup on the IP. So if you are behind a NAT/firewall it may show the name of that public IP. There's not much you can do to prevent what the server downstream from you does. Some spammers add extra fake headers so that they don't look like the originator, just a relay, but they are easy to spot.
 
Old 09-18-2013, 12:05 PM   #3
NikosGr
Member
 
Registered: Jun 2013
Posts: 63

Original Poster
Rep: Reputation: 0
Hello and thnaks for answering me,

If i proxify my internet connection and force the local proxy to initiate a conenction to my local MTA which in turn opens up a connection to the remote MTA wont this procedure cover my real server's name and ip address using the proxies data instead?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
email without local mta daemon running jag7720 Linux - Server 4 07-18-2012 06:38 PM
mta error into mail.err into logs Xeratul Linux - General 4 05-19-2012 04:44 AM
Setup an MTA to pass mail onto an external ISP/mail provider MrShrek Linux - Server 2 07-06-2009 05:17 AM
Default non-local MTA ? philforrest Linux - Software 2 08-25-2008 10:13 PM
Mail server questions, MTA ?? explorer1979 Linux - General 4 11-27-2002 10:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration