An Improved Version of the Program Youtube (maybe) Deleted

 

In my orginal post I included a script that Hillary Clinton could've used to (it was in response to a post by HA Goodman on Youtube, about why Hillary Clinton's e-mail server didn't come up under government scrutiny while she was Secretary of State) to make it look like e-mail from her private server was coming from the State Department e-mail server. I tried out the script and the e-mail got thrown in my spam folder, so I improved the script and it went right into my inbox.

I used whitehouse.com as my new script's domain name, and added a whitehouse.com domain to my personal e-mail server. I setup this script to use html (so you could fake some type of official wallpaper for the e-mail) but it can be changed to plain text by changing the content-type from text/html to text/plain. This program (script) uses the JavaMail package (you can see it is imported in the script) and of course it must be compiled using Java. The program needs to be run as java ObamaMailer listofrecipients.txt message.html, where listofrecipients is a list of the e-mail addresses you want to send to, and message.htl is an html file that contains the body of your e-mail message (like I said, you can change this to plain text, but you'll have to change the cotent-type in the script to text/plain and re-compile).

 
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;   
    
import java.security.Security;   
import java.util.Properties;   
    
class ObamaMailer 
{  
   public static void main(String[] args) throws Exception 
   {
      //define a string for assigning to addresses to.      
      String to_addr = "dave@community-info.org"; //this will be updated by values in a file
      //open up file that stores to addresses
      FileInputStream fstream = new FileInputStream(args[0]);
      DataInputStream in = new DataInputStream(fstream);
      BufferedReader br = new BufferedReader(new InputStreamReader(in));
      //open up file that stores the message text
      FileInputStream msgStream = new FileInputStream(args[1]);
      DataInputStream msgIn = new DataInputStream(msgStream);
      BufferedReader msgBR = new BufferedReader(new InputStreamReader(msgIn));
    
      //create text string to send
      String text = "";
      String msgTxt = "";
      while ((msgTxt = msgBR.readLine()) != null)
      {
         text += msgTxt;  
      }  

      Properties props = new Properties();   
      props.setProperty("mail.transport.protocol", "smtp");   
    
      props.setProperty("mail.host", "ip address (dotted decimal) of the personal e-mail server");      
      props.put("mail.smtp.auth", "true");   
      props.put("mail.smtp.port", "25");   
      props.put("mail.debug", "false");   
      props.put("mail.smtp.socketFactory.port", "25");   
      props.put("mail.smtp.socketFactory.fallback", "false");   
  
      Session session = Session.getDefaultInstance(props,   
      new javax.mail.Authenticator() 
      {       
         protected PasswordAuthentication getPasswordAuthentication() 
         {   
            return new PasswordAuthentication("president@whitehouse.gov", "passwordOnMyPersonalServerForThisAddress");     
         }                                                                                    
      }                                           );                                          
                                                                                              
      while ((to_addr = br.readLine()) != null)
      {
         Transport transport = session.getTransport();                     
         InternetAddress addressFrom = new InternetAddress("president@whitehouse.gov");   
         MimeMessage message = new MimeMessage(session); 
         message.setFrom(new InternetAddress("president@whitehouse.gov", "Barack Obama"));   // 	This is what e-mail recipients see in the From: field of the e-mail  
         message.setSender(addressFrom);   
         message.setSubject("From the Office of Barack Obama");
         message.setHeader("content-type", "text/html");
         message.setContent(text, "text/html");                                         // for sending html e-mail; i.e.,  different backgrounds can be used(like an official whitehouse.gov background)
         message.addRecipient(Message.RecipientType.TO, new InternetAddress(to_addr));
         message.setReplyTo(new javax.mail.Address[]
         {
            new javax.mail.internet.InternetAddress("dave@community-info.org")   //don't set the ReplyTo address if you don't need a reply
         });
         transport.connect();   
         System.out.println("Just added e-mail address " + to_addr);
         transport.send(message);
         transport.close();   
      }
   }   
}  

 

So, don't trust any e-mail you receive anymore. Maybe you've received e-mail from the SPCA, asking you to donate $10 by clicking on a PayPal button; maybe the sender isn't the SPCA, and the button doesn't contact PayPal (it's not tough to fake something up that looks like you really donated through PayPal). Just in case you're wondering, I'm not claiming e-mail from the SPCA is a scam (just be on the lookout for scammers).

 

Return To My Blog Page       Return To My Programming Page