Java mail proxy question

Hi people, I am trying to build a spam filter program which I found the best way to connect this program and the e-mail programs is to build a proxy mail server between the mail server and the e-mail program.
I know that there is a program called James which does exactly that but since it is for my school project, I would like to build a very simple one myself. I just want to receive all mails from the the mail server using JavaMail. but I am not quite sure about how to do the connection between the spam filter and the e-mail program.
Can someone gives me some ideas on how to approach this and which package do I need to implement this task please.
Thx
Kevin

The most typical way to do this is to set your email program up with the mail server as localhost.
Then write your program to listen on the standard POP3 port (110). When you get a request, turn around and open a connection to the real mail server's port 110, and pass it on. Anything you get back from that connection, send back to the inbound connection that you received on localhost:110.
If you want a pretty slick implementation of this (just to see how it is done in the real world), I recommend that you download and try out K9 (http://keir.net/k9.html).
Depending on how sophisticated your app is going to be, you will probably have to look at each request and determine if the response is going to be something that you'll need to modify. Do a google search on the POP3 specification. Also, connecting to port 110 of your mai server with a telnet client will tell you gobs about how the protocol works.
Also - I'm not sure if the POP3 protocol requires message sizes to be produced separately from the get message command - if it does, and you modify the inbound stream, then the size specified in an earlier call will be wrong.
Good luck - this sounds like a very challenging (and fun) project.
- K

Similar Messages

  • Java via proxy question (bug?)

    Hi folks,
    I'm testing running Java apps through a web proxy (Squid) that's using NTLM authentication. However, I seem to be having problems getting any apps to run over https. For some reason, the JRE just keeps prompting for authentication -- even after a correct username and pw is entered. At no point does the app download and run. Testing shows that this only occurs on the Win32 versions of the JRE (tested 1.4.2_12, 1.5.0_08, and 1.6 beta2), and occurs regardless of browser (IE6 and Firefox 1.5+). The Linux version of the JRE seems to work fine. Searching through the bug db has turned up somewhat similar items, but notthing quite the same. Same with google. Has anyone else run into this problem?

    Hello everybody,
    I am experiencing the same problem with JRE 1.5.0._10 and JRE 1.6.0. My proxy is a squid/2.6.STABLE9, browser is IE 6 and client is winXP.
    What I found looking at the HTTP traffic is that Java tries to authenticate using HTTP/1.1, while squid replies using HTTP/1.0.
    Furthermore, if I compare IE connections and java connections, I found that IE requires "Proxy-connection: keep-alive" while this is not done by java. This could explain the behaviour of squid that closes the TCP connection after the reply to java, so preventing NTLM authentication.
    Maybe a bug should be open?

  • Java mail with proxy server

    Hi I am a novice, working on a mail sender though proxy. I read Java mail FAQ in http://java.sun.com/products/javamail/FAQ.html#proxy.
    And also I found a snippet in below therad.
    http://forums.sun.com/thread.jspa?threadID=615715&start=0&tstart=0
    <QUOTE>here is the solution that you can send mail through a proxy server
    Properties p = System.getProperties();
             p.setProperty("proxySet","true");
             p.setProperty("socksProxyHost","192.168.155.1");
             p.setProperty("socksProxyPort","1080");</QUOTE>
    I installed CCProxy in my machine and gave my own IP address ( 1. LAN IP and 2. IP from whatismyip.com; both works ) and port number. It works. But I gave IP addrss of my friend ( 1. LAN IP and 2. IP from whatismyip.com; both NONE work ) who got CCProxy and in his machine. But doesnt work ( throws Below exception).
    Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
      nested exception is:
            java.net.SocketException: Can't connect to SOCKS proxy:Connection timedout: connect
            at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)
            at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
            at javax.mail.Service.connect(Service.java:310)
    His IP address is found with whatismyip.com. I guess its a problem with IP address. What am I doing wrong here ?? Could some one help me out please ?
    Edited by: baskark on Mar 8, 2009 6:26 PM
    Edited by: baskark on Mar 8, 2009 6:44 PM

    I believe we can give some other socks proxy ip address too, other than CCproxy machine ip address If I am correct. Is there any specific way to use the socks server ip address ( such as provided in many websites, used for open relay) ? I tried some of them, which I am able to ping. But still I get the same exception like connection request timed out.

  • Basic questions on Java Mail

    Hi,
    I am new to Java Mail and I have following questions. When I send any e-mail with Java Mail through my program it is underlivered if subject length is more. I am yet to discover the limit (in terms of characters) which can be set, but before that I just thaught to take opinion of some of the experts through this forum.
    a) Is there a limitation in subject length in terms of characters?
    b) Can length be increased or is it a problem in the email API or on SMTP server?
    c) How can we pass special characters?
    If anyone can answer it would be great!
    Regards,
    ParagJ

    Hi bshannon,
    Thanks for the reply.
    What's an example "long" subject length that doesn't work? -- If subject length is more than 256 characters the mail is undelivered and I don't get any exception as well. This is the problem with SMTP configuration. I just checked RFC 821 and it says about these size limitations.
    Can we increase this size by somehow changing the SMTP configuration? I have no idea about how to achieve that. I have searched on Google also but didn't get any useful information. If you can focus some light on this I will be thankful to you :).
    Regards,
    ParagJ

  • Can java mail be used for distributed exchange server?

    H,
    I am trying to connect to MS Exchange Server to read my mails using Java Mail API.
    I have a questions about using it with Exchange server.
    We have 6-7 exchange servers in our company and different users have mailboxes on different servers. My internet mail application will be used by everybody in the company.
    But while connecting to exchange server using java mail I can only cnnnect to one server and port. What happens when user mailbox is not on that server. How can I use javamail in this scenario where user mailboxes are on separate servers??
    Thanks
    [email protected]

    You said that you can connect to Exchange server my you help me with this because i cant connect to Exchange server, mayby you can post me a code example? Thanks

  • Error Service Component Container for Java Mailer is not running

    Hi,
    I installed Oracle Workflow 2.6.3 (Standalone) in Oracle Database 10g Release 1.
    Actually there was no problem during the installation.
    I have done the Setting Up from step 1 to 8.
    I'm going to do the step 9 (Implementing Notification Mailer).
    The problem is the Workflow Agent Listener WFALSNRSVC is not running
    and I cannot run it using the Oracle Workflow Manager.
    In the Oracle Workflow Manager there was 4 rows which related to the Container : WFALSNRSVC
    1. Workflow Deferred Agent Listener
    2. Workflow Deferred Notification Agent Listener
    3. Workflow Error Agent Listener
    4. Workflow Inbound Notification Agent Listener
    The status is : Stopped.
    I cannot run any of them.
    Although the Startup Mode is Automatic, but none of them is running.
    When I tried to push the Go button to Actions: Start, it showed this message
    An error has occured
    The Service Component Container is not running.
    And after I tried to configure the Workflow Notification Mailer using the wizard
    I didn't receive any e-mail after I push the Test Send Mail button.
    I read in another post in this forum.
    It states that when going to the Workflow Configuration Assistant (WFCA)
    we must give the right entry in the LDAP paramaters and Java Mailer parameters,
    otherwise those WFALSNRSVC and WFMLRSVC would never run eventhough we enter them in a later time.
    Actually I didn't provide the paramaters (both of them) since they are optional.
    My questions are:
    1. Is there another way to run those service (servlet)?
    I really need the Java Notification Mailer to send email.
    2. Should I uninstall and reinstall my Oracle Workflow and provide those paramaters?
    Do I have to uninstall and reinstall the Oracle Workflow Middle Tier too?
    3. Is it okay if I drop and cascade the OWF_MGR user (my Workflow Manager schema)
    and then I use the Workflow Configuration Assistant again and choose Install option
    to create the OWF_MGR schema?
    3. Are the LDAP and OID required before we use the Java Notification Mailer?
    Actually I didn't understand the use of LDAP and OID which required in the LDAP paramaters?
    Any help would be grateful.
    Thanks,
    Buntoro

    In the service components page click on any container, select stop all from the LOV and Go. Once all the containers Workflow Agent Listener Service,
    Workflow Document Web Services Service and Workflow Mailer Service are Deactivated then StartAll. After all the containers are started then check the components status.
    Still if they are running bounce the apache.

  • Content type headers and spam checks within Java MAil

    Hello there
    I have successfully created a java mail api to send any one of the following
    plain/text message, with or without attachments, with or without the body of the email to be HTML
    I have a question on how to ensure that the email is not marked spam? Sometimes the Spam score goes high if there is olly html for an email that is text/html type.;
    What are the possible values for content/type of Mime Message header for following scenarios
    An Email message that may have its bodypart as html and may have attachments
    An Email message that will have plain text messages along with attahcments and HTML concattenated with text messages ( LIke google maps along with text message]
    IF I do messaget.set ("This is my message") andthen I add attachments to the message body part, is it advisable to have two seperate content-type mime headers for these messages? wrt not having higher spam score.
    Or Is it advisable to have seperate mime type content headers for text part and sperate for message part.
    IS the attachment part also has a seperate mime header content type value?
    does the header's content type value is plain/text for messages that are text messages with attachments>?
    IS there a way to chek spam scores for messages generated by java mail? The ides is to create java mail API customsied sot hat the sent emails are not marked spams ?
    In order for the mail to be having zero spam scrore, it is helpful to have seprate mime content type headers?
    Edited by: user9328023 on May 23, 2011 1:45 PM

    If you want to create a message that has both plain text and html versions of the main
    message content, you want to create a multipart/alternative message, as described in
    this FAQ entry.
    If that message also needs to have attachments, you should embed the multipart/alternative
    part in a multipart/mixed message, along with the attachment parts.
    If the html part needs to reference images included with the message, you would replace
    the text/html part with a multipart/related part, as described in this FAQ entry.
    Combining all these techniques together can seem a bit complicated unless you understand
    recursion! :-) Remember that in addition to creating a body part with a text content type,
    you can create a body part with a multipart content type, and use that body part in the same
    places you would use a text body part.
    As for making sure your message isn't marked as spam, well, you're probably asking in the
    wrong place, but the simple answer is to make sure that it's actually not spam! Usually the
    structure of the message isn't as important as the content of the message.

  • Free SMTP server for Java mail testing

    Hi all,
    Are there any free SMTP servers that can be downloaded from the Net for Java mail. Thanks.
    Regards
    Ram

    I am sorry ..may be my question was not very clear. I do not have am SMTP host. I need an SMTP host to route emails...is that possible.
    If I have an SMTP host on my machine, then it will act as a router to route messages to other email severs like yahoo or hotmail.
    So the "from" will be a user from the SMTP host.i.e my machine user and the "to" will be some email "[email protected]" or "[email protected]".
    Is it posssible to route emails directly to any Yahoo or hotmail server using just java mail client?
    Thanks
    Regards
    RP

  • Implementing File Upload component + Java Mail

    Guys,
    Brief Intro : I have a form with some input fields. Upon submission of the form all the necessary information is submitted ro R/3 system and a mail is send to lets say administrators. I have Java Mail program for sending emails.
    My requirement : I want the users to give the FileUpload option in the form so that they can select the file and that file should be attached to email whcih I am sending upon form submission.
    Questions:
    1) How to check the path of the file where it gets uploaded.
    2) Does it get uploaded on the Server where I deploy my application.
    3) Any Solution/suggestion on how to implement the requirement stated above.
    Regards,
    <b>Chintan Virani.</b>

    Hi Chintan...
    File Uplaod UI Element is just to get the file path of the file from the client or presentation server i.e. our pc. Rest code to store the data is done in action of the upload button (not the browse button). So no file is formed automatically.
    Unless you write the code to read the file from the path selected, you cannot get the data bytes and unless you mention the path no file is made in the server.
    Better would be that you keep a file template in the mimes folder and at runtime you write to this file.
    The path of the file in the mimes folder is
    temp
    webdynpro
    web
    local
    <ProjectName>
    Components
    <Component Package>
    <File Name>
    This file can be attached to your mail as an attachement.
    Further reference...
    Re: how to create a file i mimes/ components folder
    Regards,
    Mahesh K.

  • Complete working code for Gmail POP3 & SMTP with SSL - Java mail API

    Finally, your code-hunt has come to an end!!!!
    I am presenting you the complete solution (with code) to send and retrieve you mails to & from GMAIL using SMTP and POP3 with SSL & Authenticaion enabled. [Even starters & newbies like me, can easy try, test & understand - But first download & add JAR's of Java Mail API & Java Activation Framework to Netbeans Library Manager]
    Download Java Mail API here
    http://java.sun.com/products/javamail/
    Read Java Mail FAQ's here
    http://java.sun.com/products/javamail/FAQ.html
    Download Java Activation Framework [JAF]
    http://java.sun.com/products/javabeans/jaf/downloads/index.html
    Also, The POP program retrieves the mail sent with SMTP program :) [MOST IMPORTANT & LARGELY IN DEMAND]okey.. first things first... all of your thanks goes to the following and not a s@!te to me :)
    hail Java !!
    hail Java mail API !!
    hail Java forums !!
    hail Java-tips.org !!
    hail Netbeans !!
    Thanks to all coders who helped me by getting the code to work in one piece.
    special thanks to "bshannon" - The dude who runs this forum from 97!!I am just as happy as you will be when you execute the below code!! [my 13 hours of tweaking & code hunting has paid off!!]
    Now here it is...I only present you the complete solution!!
    START OF PROGRAM 1
    SENDING A MAIL FROM GMAIL ACCOUNT USING SMTP [STARTTLS (SSL)] PROTOCOL OF JAVA MAIL APINote on Program 1:
    1. In the code below replace USERNAME & PASSWORD with your respective GMAIL account username and its corresponding password!
    2. Use the code to make your Gmail client [jsp/servlets whatever]
    //Mail.java - smtp sending starttls (ssl) authentication enabled
    //1.Open a new Java class in netbeans (default package of the project) and name it as "Mail.java"
    //2.Copy paste the entire code below and save it.
    //3.Right click on the file name in the left side panel and click "compile" then click "Run"
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class Main
        String  d_email = "[email protected]",
                d_password = "PASSWORD",
                d_host = "smtp.gmail.com",
                d_port  = "465",
                m_to = "[email protected]",
                m_subject = "Testing",
                m_text = "Hey, this is the testing email.";
        public Main()
            Properties props = new Properties();
            props.put("mail.smtp.user", d_email);
            props.put("mail.smtp.host", d_host);
            props.put("mail.smtp.port", d_port);
            props.put("mail.smtp.starttls.enable","true");
            props.put("mail.smtp.auth", "true");
            //props.put("mail.smtp.debug", "true");
            props.put("mail.smtp.socketFactory.port", d_port);
            props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
            props.put("mail.smtp.socketFactory.fallback", "false");
            SecurityManager security = System.getSecurityManager();
            try
                Authenticator auth = new SMTPAuthenticator();
                Session session = Session.getInstance(props, auth);
                //session.setDebug(true);
                MimeMessage msg = new MimeMessage(session);
                msg.setText(m_text);
                msg.setSubject(m_subject);
                msg.setFrom(new InternetAddress(d_email));
                msg.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));
                Transport.send(msg);
            catch (Exception mex)
                mex.printStackTrace();
        public static void main(String[] args)
            Main blah = new Main();
        private class SMTPAuthenticator extends javax.mail.Authenticator
            public PasswordAuthentication getPasswordAuthentication()
                return new PasswordAuthentication(d_email, d_password);
    END OF PROGRAM 1-----
    START OF PROGRAM 2
    RETRIVE ALL THE MAILS FROM GMAIL INBOX USING Post Office Protocol POP3 [SSL] PROTOCOL OF JAVA MAIL APINote:
    1.Log into your gmail account via webmail [http://mail.google.com/]
    2.Click on "settings" and select "Mail Forwarding & POP3/IMAP"
    3.Select "enable POP for all mail" and "save changes"
    4.In the code below replace USERNAME & PASSWORD with your respective GMAIL account username and its corresponding password!
    PROGRAM 2 - PART 1 - Main.java
    //1.Open a new Java class file in the default package
    //2.Copy paste the below code and rename it to Mail.java
    //3.Compile and execute this code.
    public class Main {
        /** Creates a new instance of Main */
        public Main() {
         * @param args the command line arguments
        public static void main(String[] args) {
            try {
                GmailUtilities gmail = new GmailUtilities();
                gmail.setUserPass("[email protected]", "PASSWORD");
                gmail.connect();
                gmail.openFolder("INBOX");
                int totalMessages = gmail.getMessageCount();
                int newMessages = gmail.getNewMessageCount();
                System.out.println("Total messages = " + totalMessages);
                System.out.println("New messages = " + newMessages);
                System.out.println("-------------------------------");
    //Uncomment the below line to print the body of the message. Remember it will eat-up your bandwidth if you have 100's of messages.            //gmail.printAllMessageEnvelopes();
                gmail.printAllMessages();
            } catch(Exception e) {
                e.printStackTrace();
                System.exit(-1);
    END OF PART 1
    PROGRAM 2 - PART 2 - GmailUtilities.java
    //1.Open a new Java class in the project (default package)
    //2.Copy paste the below code
    //3.Compile - Don't execute this[Run]
    import com.sun.mail.pop3.POP3SSLStore;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.Address;
    import javax.mail.FetchProfile;
    import javax.mail.Flags;
    import javax.mail.Folder;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Part;
    import javax.mail.Session;
    import javax.mail.Store;
    import javax.mail.URLName;
    import javax.mail.internet.ContentType;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.ParseException;
    public class GmailUtilities {
        private Session session = null;
        private Store store = null;
        private String username, password;
        private Folder folder;
        public GmailUtilities() {
        public void setUserPass(String username, String password) {
            this.username = username;
            this.password = password;
        public void connect() throws Exception {
            String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
            Properties pop3Props = new Properties();
            pop3Props.setProperty("mail.pop3.socketFactory.class", SSL_FACTORY);
            pop3Props.setProperty("mail.pop3.socketFactory.fallback", "false");
            pop3Props.setProperty("mail.pop3.port",  "995");
            pop3Props.setProperty("mail.pop3.socketFactory.port", "995");
            URLName url = new URLName("pop3", "pop.gmail.com", 995, "",
                    username, password);
            session = Session.getInstance(pop3Props, null);
            store = new POP3SSLStore(session, url);
            store.connect();
        public void openFolder(String folderName) throws Exception {
            // Open the Folder
            folder = store.getDefaultFolder();
            folder = folder.getFolder(folderName);
            if (folder == null) {
                throw new Exception("Invalid folder");
            // try to open read/write and if that fails try read-only
            try {
                folder.open(Folder.READ_WRITE);
            } catch (MessagingException ex) {
                folder.open(Folder.READ_ONLY);
        public void closeFolder() throws Exception {
            folder.close(false);
        public int getMessageCount() throws Exception {
            return folder.getMessageCount();
        public int getNewMessageCount() throws Exception {
            return folder.getNewMessageCount();
        public void disconnect() throws Exception {
            store.close();
        public void printMessage(int messageNo) throws Exception {
            System.out.println("Getting message number: " + messageNo);
            Message m = null;
            try {
                m = folder.getMessage(messageNo);
                dumpPart(m);
            } catch (IndexOutOfBoundsException iex) {
                System.out.println("Message number out of range");
        public void printAllMessageEnvelopes() throws Exception {
            // Attributes & Flags for all messages ..
            Message[] msgs = folder.getMessages();
            // Use a suitable FetchProfile
            FetchProfile fp = new FetchProfile();
            fp.add(FetchProfile.Item.ENVELOPE);       
            folder.fetch(msgs, fp);
            for (int i = 0; i < msgs.length; i++) {
                System.out.println("--------------------------");
                System.out.println("MESSAGE #" + (i + 1) + ":");
                dumpEnvelope(msgs);
    public void printAllMessages() throws Exception {
    // Attributes & Flags for all messages ..
    Message[] msgs = folder.getMessages();
    // Use a suitable FetchProfile
    FetchProfile fp = new FetchProfile();
    fp.add(FetchProfile.Item.ENVELOPE);
    folder.fetch(msgs, fp);
    for (int i = 0; i < msgs.length; i++) {
    System.out.println("--------------------------");
    System.out.println("MESSAGE #" + (i + 1) + ":");
    dumpPart(msgs[i]);
    public static void dumpPart(Part p) throws Exception {
    if (p instanceof Message)
    dumpEnvelope((Message)p);
    String ct = p.getContentType();
    try {
    pr("CONTENT-TYPE: " + (new ContentType(ct)).toString());
    } catch (ParseException pex) {
    pr("BAD CONTENT-TYPE: " + ct);
    * Using isMimeType to determine the content type avoids
    * fetching the actual content data until we need it.
    if (p.isMimeType("text/plain")) {
    pr("This is plain text");
    pr("---------------------------");
    System.out.println((String)p.getContent());
    } else {
    // just a separator
    pr("---------------------------");
    public static void dumpEnvelope(Message m) throws Exception {       
    pr(" ");
    Address[] a;
    // FROM
    if ((a = m.getFrom()) != null) {
    for (int j = 0; j < a.length; j++)
    pr("FROM: " + a[j].toString());
    // TO
    if ((a = m.getRecipients(Message.RecipientType.TO)) != null) {
    for (int j = 0; j < a.length; j++) {
    pr("TO: " + a[j].toString());
    // SUBJECT
    pr("SUBJECT: " + m.getSubject());
    // DATE
    Date d = m.getSentDate();
    pr("SendDate: " +
    (d != null ? d.toString() : "UNKNOWN"));
    static String indentStr = " ";
    static int level = 0;
    * Print a, possibly indented, string.
    public static void pr(String s) {
    System.out.print(indentStr.substring(0, level * 2));
    System.out.println(s);
    }END OF PART 2
    END OF PROGRAM 2
    P.S: CHECKING !!
    STEP 1.
    First compile and execute the PROGRAM 1 with your USERNAME & PASSWORD. This will send a mail to your own account.
    STEP 2.
    Now compile both PART 1 & PART 2 of PROGRAM 2. Then, execute PART 1 - Main.java. This will retrive the mail sent in step 1. njoy! :)
    In future, I hope this is added to the demo programs of the Java Mail API download package.
    This is for 3 main reasons...
    1. To prevent a lot of silly questions being posted on this forum [like the ones I did :(].
    2. To give the first time Java Mail user with a real time working example without code modification [code has to use command line args like the demo programs - for instant results].
    3. Also, this is what google has to say..
    "The Gmail Team is committed to making sure you always can access your mail. That's why we're offering POP access and auto-forwarding. Both features are free for all Gmail users and we have no plans to charge for them in the future."
    http://mail.google.com/support/bin/answer.py?answer=13295
    I guess bshannon & Java Mail team is hearing this....
    Again, Hurray and thanks for helping me make it!! cheers & no more frowned faces!!
    (: (: (: (: (: GO JCODERS GO!! :) :) :) :) :)
    codeace
    -----                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Thanks for the reply,
    I did checked by enabling session debuging and also checked pop settings it's enabled for all
    mails, I tried deleting some very old messages and now the message count is changed to 310.
    This may be the problem with gmail.
    Bellow is the output i got,
    DEBUG: setDebug: JavaMail version 1.4ea
    DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]
    DEBUG POP3: connecting to host "pop.gmail.com", port 995, isSSL false
    S: +OK Gpop ready for requests from 121.243.255.240 n22pf5432603pof.2
    C: USER [email protected]
    S: +OK send PASS
    C: PASS my_password
    S: +OK Welcome.
    C: STAT
    S: +OK 310 26900234
    Custom output: messageCount : 310
    C: QUIT
    S: +OK Farewell.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Java Receiver Proxy Base Info

    Hi
    i have a File-to-RFC Scenario replaced with a File-to-ABAPProxy Scenario. This works. It's possible to replace the ABAP Proxy on my SAP Target System by a Java Receiver Proxy?
    Reason for this question: I understand, that in my ABAP proxy i do the mapping from my PI Dataformat to the RFC destination Format (ABAP Function) manually in the Proxy class in ABAP. I'm actually a Java Programmer and would prefer to do the mapping in Java.
    I searched on this subject and understood that i have to install the Java Proxy Runtime, but I'm don't know if this only works for a non-central AE and non-SAP interfaces or if I also can encapsulate a remote ABAP function on my target system.
    Thanks in advance
    Michael

    Michael,
    >>I understand, that in my ABAP proxy i do the mapping from my PI Dataformat to the RFC destination Format (ABAP Function) manually in the Proxy class in ABAP.
    Yes, You are right
    >>I'm actually a Java Programmer and would prefer to do the mapping in Java.
    You can do with the help of Java too
    >>i have to install the Java Proxy Runtime
        You are right
    >>but I'm don't know if this only works for a non-central AE and non-SAP interfaces
    We can do it for SAP system too, for example thru portal service we can trigger the BAPI
    Thanks
    Agasthuri

  • How to use Http test Client  for Java Client Proxy Scenario

    Hi,
    I build a scenario using Java Client Proxy where JSP as my FrontHand.
    Can I know that whether i can use Http Test Client in place of JSP for sending data and getting response back. If yes than how can i implement this ?
    Regards,
    Abhi

    Hi,
    with Http Test Client you post your messages
    directly to the Integration Engine (not using adapter framework)
    so you can use Http Test Client to simulate any message
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Using Java mail API from JSPDynPage

    Hi Experts,
    I am working on a Portal Assignment that requiresto sent work flow mails on the basis of error conditions.
    Can u please suggest if at all I can use Java Mail APIs from JSP page within the JSP DYN Page Framework.
    If at all Java Mail can be used could u please suugest some help docs on the same.
    Thanks for the help.
    Manab C Ghosh
    EP Consultant
    Kolkata INDIA
    +919830603327

    Hi Experts,
    Thanks for all the responses to my Mail question(mailing from JSPDynPage).
    I have found the solution.
    Here is how I have got the things: (pls note there are other solns)
    Using Java Mail APIs;
    Create a Java file in the scr.core / src.api
    MailSender.java
    * Created on Jul 21, 2005
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package com.mailsend.test;
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    * Edited on Jul 24, 2005
    * @author Manab C Ghosh
    public class MailSender {
         public String sendMessage(){
            String msg ="Hello mail Test";
            String smtpServer ="mySMTPServer";
            String smtpSender = "senderemailaddress";
            String smtpRecipient="receipientemailaddress";
            String stBody =  msg ;
            //String stDate = new Date().toString() ;
            String stSubject = "Mail Test ";
            Send(     smtpServer,          //SMTPServer
                      smtpSender,          //Sender
                      smtpRecipient,     //Recipient
                      stSubject,          //Subject
                      stBody               //Body
                        );               //Attachments                    
         return "Mail Success";
    public static void Send(String SMTPServer,
                                  String From,
                                  String To,
                                  String Subject,
                                  String msgText1
            // Error status;
            int ErrorStatus = 0;
            // create some properties and get the default Session
            Properties props = System.getProperties();
            props.put("mail.smtp.host", SMTPServer);
            Session session = Session.getDefaultInstance(props, null);     
            try {
                 // create a message
                 MimeMessage msg = new MimeMessage(session);
                 msg.setFrom(new InternetAddress(From));
                 InternetAddress[] address = {new InternetAddress(To)};
                 msg.setRecipients(Message.RecipientType.TO, address);
                 msg.setSubject(Subject);
                 // create and fill the first message part
                 MimeBodyPart mbp1 = new MimeBodyPart();
                 mbp1.setText(msgText1);
                 // create the Multipart and its parts to it
                 Multipart mp = new MimeMultipart();
                 mp.addBodyPart(mbp1);
                 //mp.addBodyPart(mbp2);
                 // add the Multipart to the message
                 msg.setContent(mp);
                 // set the Date: header
                 msg.setSentDate(new Date());
                 // send the message
                 Transport.send(msg);
            } catch (MessagingException mex) {
    Call this file from the JSP page (which is set at JSPDynPage controller)
    one important thing-----
    Create a dir under PORTAL-INF and import the following jars-- activation.jar, mail.jar,imap.jar,smtp.jar, mailapi.jar.
    This works..
    Thanks once again to the Experts.
    happy mailing
    Manab Ghosh.
    INDIA (+919830603327)

  • JSP & Java Mail

    Hai Buddies,
    I don't know about JSP (only little bit), Iwant to create a page in jsp any one plzzz help me i will give the details about the the page ie given below..
    The page containning
    --number, name contacts, comments ,action plan,dre name,lead name
    --when i stores the above details to the database a mail is sent to the dre and the lead respectively
    --Using JSP & Java Mail                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    There is a forum on java database connectivity
    http://forum.java.sun.com/forum.jspa?forumID=48
    A forum on java mail
    http://forum.java.sun.com/forum.jspa?forumID=43
    There are loads of tutorials on the sun site and elsewhere, you need to read these and start coding. No-one is going to write this for you.
    Before posting questions use the search bar to the left, most of the questions you ask have been dealt with MANY times before, you will find code quickly using the search facility, saving you a lot of time.

  • Failed to build Java Mail API 1.4.5 with maven-3.0.4

    Hi,
    I am trying to build Java Mail 1.4.5 with Maven-3.0.4 using default settings of maven.
    It is getting failed to build due to following errors -
    [ERROR] COMPILATION ERROR :
    [INFO] -----------------------------------------------------------
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[210,37] cannot find symbol
    symbol : variable Version
    location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[369,47] cannot find symbol
    symbol : variable Version
    location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[913,29] cannot find symbol
    symbol : variable Version
    location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[916,29] cannot find symbol
    symbol : variable Version
    location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[919,29] cannot find symbol
    symbol : variable Version
    location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[922,29] cannot find symbol
    symbol : variable Version
    location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[925,29] cannot find symbol
    symbol : variable Version
    location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[928,29] cannot find symbol
    symbol : variable Version
    location: class javax.mail.Session
    [INFO] 8 errors
    [INFO] -----------------------------------------------------------
    [INFO] ----------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ----------------------------------------------------------------------
    [INFO] Total time: 1:51.197s
    [INFO] Finished at: Tue Jan 08 13:06:01 IST 2013
    [INFO] Final Memory: 12M/67M
    [INFO] ----------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
    3.2:compile (default-compile) on project javax.mail: Compilation failure: Compil
    ation failure:
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[210,37] cannot find symbol
    [ERROR] symbol : variable Version
    [ERROR] location: class javax.mail.Session
    [ERROR]\Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[369,47] cannot find symbol
    [ERROR] symbol : variable Version
    [ERROR] location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[913,29] cannot find symbol
    [ERROR] symbol : variable Version
    [ERROR] location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[916,29] cannot find symbol
    [ERROR] symbol : variable Version
    [ERROR] location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[919,29] cannot find symbol
    [ERROR] symbol : variable Version
    [ERROR] location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[922,29] cannot find symbol
    [ERROR] symbol : variable Version
    [ERROR] location: class javax.mail.Session
    [ERROR]\Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[925,29] cannot find symbol
    [ERROR] symbol : variable Version
    [ERROR] location: class javax.mail.Session
    [ERROR] \Workarea\mySourceData\src\Mail\mail\src\main\java\javax\mail\Session.java:[928,29] cannot find symbol
    [ERROR] symbol : variable Version
    [ERROR] location: class javax.mail.Session
    [ERROR] -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
    rg.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on
    project javax.mail: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
    .java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
    .java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
    .java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
    ct(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
    ct(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
    ild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
    eStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
    cher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
    a:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
    uncher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
    352)
    Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation fail
    ure
    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompiler
    Mojo.java:656)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
    BuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
    .java:209)
    ... 19 more
    [ERROR]
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please rea
    d the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExceptionSame issue I am facing when I am trying to build Java Mail with netbeans - 7.2.1, it getting failed with same version issue in Session.java class.
    How can I set this Version in Session.java class to get rid of this error?
    If we can use nexus repository then please let me know how to set this.
    Thanks,
    Neelam Sharma

    I answered this question here:
    http://stackoverflow.com/questions/14217596/failed-to-build-java-mail-api-1-4-5-with-maven-3-0-4/14288418#14288418

Maybe you are looking for

  • Apple TV - really not useful for streaming

    I bought an Apple TV last week - I have 400GB of Apple Lossless audio files stored on my PC, and a number of TV shows in MPEG2 format, extracted from my Humax digital recorder. The size of my media library means that syncing to the Apple TV's paltry

  • CX61 have internet problem win 8.1

    Hey. I upgrage to Win 8.1 two days ago, and from yesterday i can't go to internet. I see that i have wifi connection, and i try in another host. and i try to connect directly from the router, I see the connection in the icon (Win don't say there is a

  • Gantt chart in OBIEE11115

    Hi , We got a requirement to create a Gantt Chart in obiee11115 for project module, Can any provide me any document to create Gantt chart in obiee11115 I found this link http://oraclebizint.wordpress.com/2007/12/06/oracle-bi-ee-101332-marquee-images-

  • Possible memory leaks in the code , ASSERT messages in debug version !!!

    Hi, I have my Indesign C++ plugin running successfully in DEBUG and RELEASE versions of Indesign. But in Debug version, when I close my Indesign, I get a series of ASSERTS which I am not able to figure out why. Below is the list of ASSERT I am gettin

  • My iPhone 4 was working and then just closed down

    Hi. My iPhone 4 was working perfectly until about an hour ago. Now it won't even turn on or update through iTunes. Anyone else had this problem?