Writing my own readLine() method

I am trying to write my own readLine() method. I am using the read() method from BufferedReader to read one char at a time into an array. Then when I encounter a \n chacter I convert the array to a string and return it.
The problem arrises when i reach the end of a file.
The read() method returns a -1 when the end of the file has been reached.
How can I get my readline method to read the last line and return it but also tell the user the end of the file has been reached?
Thanks.

The reason I want to write my own is beacause
readLine() in BufferedReader has been deprecated.
No it isn't. Not until 1.3.1, at least.
I want to read and return lines until read() returns a
-1. But how can i still return the last line? err... with a return statement?
It may contain a string and then be the end of the file. How
can I return the string and the -1?You can't. You'll have to do it the way readLine already does or really think of something new.

Similar Messages

  • When do we override our own clone method not the Object class clone method

    Hi,
    I have a confusion in overriding clone method.We can create clone object by writing Object.clone() but some times I have seen writing our own clone method ,when do we write this,also clone() is defined protected and when we write our own clone it is said to write it public,why?
    Thanks
    Sumit

    protected methods can only be called in the same class and it subclass. You can make clone protected if this is all you need.
    However if you need to clone() the object from another class, it need to be public.
    This is the same for any method.
    Also as Object.clone() is protected you cannot make it private or package-local (this is true of any protected method)

  • I am part of a family sharing setup.  Can I have my own payment method so the organizer does not get charged for my purchases?

    I am part of a family sharing setup.  Can I have my own payment method so the organizer does not get charged for my purchases?  If so, how do I set this up?

    Yes.  Just redeem gift cards so that your own account always has a sufficient credit balance.  Here is how it works:
    Family purchases and payments
    After you set up your family, any time a family member initiates a new purchase it will be billed directly to your account unless that family member has gift or store credit. First, their store credit will be used to pay the partial or total bill. The remainder will bill to the family organizer's card.

  • How to use the readLine()  method when reading data from a URL?

    Hello,
    I have a URL which contains text input.
    The only way to get the data from this URL is by opening a URL connection to it.
    I would like to get the data from this URL but at the same time I would like to be able to use readLine() method of BufferedReader in order to read the data line by line.
    My question is how do I combine between these two requirements in order to reed the data from the URL?
    Roy

    Hello Roy,
    can you try out this code.
      URL yahoo = new URL("http://www.yahoo.com/");
            URLConnection yc = yahoo.openConnection();
            BufferedReader in = new BufferedReader(
                                    new InputStreamReader(
                                    yc.getInputStream()));
            String inputLine;
            while ((inputLine = in.readLine()) != null)
                System.out.println(inputLine);
            in.close();
    Regards,
    Mohan R

  • I need a solution for the deprecated readLine() method .

    import java.io.*;
    import java.net.*;
    class UC {
    public static void main(String args[]) throws Exception
    DataInputStream inFromUser = new DataInputStream(System.in);
    DatagramSocket clientSocket = new DatagramSocket();
    InetAddress IPAddress = InetAddress.getByName("hostname");
    byte[] sendData = new byte[1024];
    byte[] receiveData = new byte[1024];
    while(true)
    String[] sentence = inFromUser.readLine(); /* It says the readLine() method is deprecated. what is the solution for this? */
              sentence.getSubstringBytes(sentence,0, sentence.length(), sendData, 0);
    //sentence.getBytes(0, sentence.length(), sendData, 0);
    DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, 9876);
    clientSocket.send(sendPacket);
    DatagramPacket receivePacket
    = new DatagramPacket(receiveData, receiveData.length);
    clientSocket.receive(receivePacket);
    String modifiedSentence =
    new String(receivePacket.getData());
    System.out.println("FROM SERVER:" + modifiedSentence);
         public void getSubstringBytes(String sentence,int space,int Size,byte[] sendData,int space)
                   byte[] bytes=sentence.getBytes();
                   System.arraycopy(bytes,0,sendData,0,sentence.length()-0);
    }

    Sorry, It should be the BufferedReader , not BufferedInputStream.

  • BufferedReader's readLine() method problem.

    Hello,
    If anyone can help me out I would not have to struggle :)
    Here is the thing. I have a file like this:
    1     srjetnuaazcebsqfbzerhxfbdfcbxyvihswlygzsfvjleengcftwvxcjriwdohjisnzppipiwpnniuiyjpeppaezftgjfviwxunu
    2     ekjghqflatrcdteurofahxoiyvrwhvaxjgcuvkkpondsqhedxylxyjizflfbgusoizogbffgwnswohenjixwufcdlbjlkoqevqdy
    3     stfhcbslgcrywwrgbsqdkcxfbizvniyookceonscwugixgrxvvkxiqezltsiwhhepqusjdlkhadvkzgiefgarenbxnxtxnqdqpfh
    4     dcuefkdrkoovjwdrqbpgoirruutphuiobqweknxhboyktxzcczgekrlbfsbfuygjpheydiwaasxifphtldawxsfepotkgqqsivur
    5     fpfrspbuhangkeugfuwexsgivetovkoyloddgofdcajwwlrocgjrhonsrfrfxozvgohwoytycfjoycrxdhnhxyitkeqynedrbroh
    6     hgzqqsfgnotfepywbpccrosxborslqtkanyffrwknjapnzjnesjlkbbsckbyvgrxujqyocpcpctsqyzapcinhjyysxsdwfjugndr
    7     pltzealtrklzrugxdcskndqyvsrzncitqvjcnndeqossyrifzvbqovtdzsixjlizsbxwutgqipuxfidxyoktwupsuqbqgnxdfbze
    8     avpxfjgwpxnzfsfosgsryhpyaezigrqsxsgdvwdbwovhcchrijbitvbcvltrgvadogokaennwpjjpkuuttidlnqftdnzqpqafels
    9     oyvztgletdwdtibshpzeuqryvulnubrqtgxwizfsdzqlgxvsebhslnovphgehfigbjyyqsirqcwflbnbnrflotpqytqzbgnkeyrk
    10     unvryrnlqucuydrasyzyiclnjvospzdoviqchdhasxzffblwsewikzbznyegrqtjvxfxfjenvrboofbxfsynlxhyuvqprqbvoruk
    and my java programs is like this:
    public String searchForAString(String fileName, int lineNumber)
    File fileObject = new File(fileName);
    String finalString ="";
    String record = "";
    int line;
    try
    FileInputStream fileInputStreamObject = new FileInputStream(fileObject);
    BufferedInputStream bufferedInputStreamObject = new BufferedInputStream(fileInputStreamObject);
    //DataInputStream dataInputStreamObject = new DataInputStream(bufferedInputStreamObject);
    BufferedReader bufferedReaderObject = new BufferedReader(new InputStreamReader(bufferedInputStreamObject));
    //System.out.println(bufferedReaderObject.readLine());
    //System.out.println("_____________________");
    while((bufferedReaderObject.readLine()) != null)
    System.out.println(bufferedReaderObject.readLine());
    Last System.out.println statement only displays second, forth, sixth, eigth, tenth and null lines. Why not every line? Any ideas? Thanks!

    You do relize that when you call the in.readLine()in
    your loop conditional and in your loop body itreads
    in diffrent lines. Try this:
    public String searchForAString(String fileName,int
    lineNumber)
    File fileObject = new File(fileName);
    String finalString ="";
    String record = "";
    int line;
    try
    FileInputStream fileInputStreamObject = new
    FileInputStream(fileObject);
    BufferedInputStream bufferedInputStreamObject =new
    BufferedInputStream(fileInputStreamObject);
    //DataInputStream dataInputStreamObject = new
    DataInputStream(bufferedInputStreamObject);
    BufferedReader bufferedReaderObject = new
    BufferedReader(new
    InputStreamReader(bufferedInputStreamObject));
    //System.out.println(bufferedReaderObject.readLine());
    //System.out.println("_____________________");
    String s = bufferedReaderObject.readLine();
    while(s != null)
    System.out.println(bufferedReaderObject.readLine());
    s = bufferedReaderObject.readLine();
    Every time you call the readLine method, it doesread
    a diffrent line. Java does not know you want toread
    the same line twice.Err, shouldn't that be:
    while(s != null)
    System.out.println(s);
    s = bufferedReaderObject.readLine();
    Otherwise, you're still discarding a line if you use
    two readLines in the while loop.yes you are correct... srry late last night and I wsa copying his code :).

  • BufferedReader's readLine() method problem (REPOST)

    Hello,
    If anyone can help me out I would not have to struggle :)
    Here is the thing. I have a file like this:
    1 srjetnuaazcebsqfbzerhxfbdfcbxyvihswlygzsfvjleengcftwvxcjriwdohjisnzppipiwpnniui yjpeppaezftgjfviwxunu
    2 ekjghqflatrcdteurofahxoiyvrwhvaxjgcuvkkpondsqhedxylxyjizflfbgusoizogbffgwnswohe njixwufcdlbjlkoqevqdy
    3 stfhcbslgcrywwrgbsqdkcxfbizvniyookceonscwugixgrxvvkxiqezltsiwhhepqusjdlkhadvkzg iefgarenbxnxtxnqdqpfh
    4 dcuefkdrkoovjwdrqbpgoirruutphuiobqweknxhboyktxzcczgekrlbfsbfuygjpheydiwaasxifph tldawxsfepotkgqqsivur
    5 fpfrspbuhangkeugfuwexsgivetovkoyloddgofdcajwwlrocgjrhonsrfrfxozvgohwoytycfjoycr xdhnhxyitkeqynedrbroh
    6 hgzqqsfgnotfepywbpccrosxborslqtkanyffrwknjapnzjnesjlkbbsckbyvgrxujqyocpcpctsqyz apcinhjyysxsdwfjugndr
    7 pltzealtrklzrugxdcskndqyvsrzncitqvjcnndeqossyrifzvbqovtdzsixjlizsbxwutgqipuxfid xyoktwupsuqbqgnxdfbze
    8 avpxfjgwpxnzfsfosgsryhpyaezigrqsxsgdvwdbwovhcchrijbitvbcvltrgvadogokaennwpjjpku uttidlnqftdnzqpqafels
    9 oyvztgletdwdtibshpzeuqryvulnubrqtgxwizfsdzqlgxvsebhslnovphgehfigbjyyqsirqcwflbn bnrflotpqytqzbgnkeyrk
    10 unvryrnlqucuydrasyzyiclnjvospzdoviqchdhasxzffblwsewikzbznyegrqtjvxfxfjenvrboofb xfsynlxhyuvqprqbvoruk
    and my java programs is like this:
    public String searchForAString(String fileName, int lineNumber)
    File fileObject = new File(fileName);
    String finalString ="";
    String record = "";
    int line;
    try
    FileInputStream fileInputStreamObject = new FileInputStream(fileObject);
    BufferedInputStream bufferedInputStreamObject = new BufferedInputStream(fileInputStreamObject);
    //DataInputStream dataInputStreamObject = new DataInputStream(bufferedInputStreamObject);
    BufferedReader bufferedReaderObject = new BufferedReader(new InputStreamReader(bufferedInputStreamObject));
    //System.out.println(bufferedReaderObject.readLine());
    //System.out.println("_____________________");
    while((bufferedReaderObject.readLine()) != null)
    System.out.println(bufferedReaderObject.readLine());
    Last System.out.println statement only displays second, forth, sixth, eigth, tenth and null lines. Why not every line? Any ideas? Thanks!
    Re: BufferedReader's readLine() method problem.
    Author: EagleEye101 Feb 18, 2005 8:48 PM (reply 1 of 1)
    You do relize that when you call the in.readLine() in your loop conditional and in your loop body it reads in diffrent lines. Try this:
    public String searchForAString(String fileName, int lineNumber)
    File fileObject = new File(fileName);
    String finalString ="";
    String record = "";
    int line;
    try
    FileInputStream fileInputStreamObject = new FileInputStream(fileObject);
    BufferedInputStream bufferedInputStreamObject = new BufferedInputStream(fileInputStreamObject);
    //DataInputStream dataInputStreamObject = new DataInputStream(bufferedInputStreamObject);
    BufferedReader bufferedReaderObject = new BufferedReader(new InputStreamReader(bufferedInputStreamObject));
    //System.out.println(bufferedReaderObject.readLine());
    //System.out.println("_____________________");
    String s = bufferedReaderObject.readLine();
    while(s != null)
    System.out.println(bufferedReaderObject.readLine());
    s = bufferedReaderObject.readLine();
    Every time you call the readLine method, it does read a diffrent line. Java does not know you want to read the same line twice.
    Tried it, did not work. I need to go through each line of the file I have. Any ideas?

    solution should be in your other thread.
    Please do not repeat threads--it really bugs the people here, just some 'nettiquite' --I don't mean to be a grouch.
    --later.  : )                                                                                                                                                                                                                                                                                                                                                       

  • BufferedReader's readLine() method

    i use this readLine() method to read from a file.
    in this file, there is only a line of normal text, say "hello".
    after saving the returned String from readLine() method,
    i find that it is not as same as "hello" anymore -> i get a
    false while comparing the two strings : one is the derived string from bufferedreader's readLine() method, another one is from a string variable i defined in the program.
    what is wrong here ?

    hi ya abnormal !
    below is the piece of code of mine :
    =====================================               FileReader bf = new FileReader("test.txt");
                   BufferedReader br = new BufferedReader(bf);
                   br.readLine();
                   String s1 = br.readLine();
                   String s2 = "hihi";
                   char[] c1 = s1.toCharArray();
                   char[] c2 = s2.toCharArray();
                   System.out.println("String 1: ");
                   for (int x = 0; x < c1.length; x++)
                   {  System.out.print((int)c1[x]+" ");}
                   System.out.println();System.out.println("String 2: ");
                   for (int x = 0; x < c2.length; x++)
                   {  System.out.print((int)c2[x]+" ");}
                   System.out.println();               
                   boolean result = false;
                   if (s1 == s2)
                   result=true;
                   System.out.println(result);
                   br.close();
                   bf.close();
    =============================
    i get a false :(
    from your piece, the output integers representing the two strings are equal. but not after the comparison...
    of course , the first line in the file test.txt is "hihi".
    i even tried to move the "hihi" to the 2nd line out of 3 lines in the test.txt file, to avoid EOF or \r\n , if there are... the result is the same. false ....
    what could be wrong ?

  • Writing my own methods

    I'm trying to learn how to write my own methods and couldn't figure out what the problem is with the codes below.
    public class methodtry {
        public static int myMethod1 (int a)
              a += 10;
              System.out.println("*** Method1, a is : " + a);
              return (a);
                 int b = myMethod1(3);
               System.out.println(b);     
    }it gives identifier expected error in the last System.out.println(b); part..
    Edited by: SwmeRt on Mar 26, 2009 7:27 AM

    You can't have free-floating statements like System.out.println(b); just inside a class. Why not put that statement in a method:
    public class MethodTry {
        public static int myMethod1(int a) {
            a += 10;
            System.out.println("*** Method1, a is : " + a);
            return a;
        public static void main(String[] args) {
            int b = myMethod1(3);
            System.out.println(b);
    }Start here: [http://java.sun.com/docs/books/tutorial/java/index.html]

  • How to get Application Module in JDev 10.13 with own java Methode ?

    Hello,
    I've tried to save a table from my BC4J to file system...
    for this i call my class from a jsp page:
    <%
    try {
    // RESPONSE
    String aktDbName = request.getParameter("aktDbName");
    response.setContentType("text/html");
    ByteArrayOutputStream buffer = Err_alertLogPageController.saveAL(pageContext);
    String filename = "alert_"+aktDbName+".log";
    response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\"");
    // DOWNLOAD
    DataOutput output = new DataOutputStream(response.getOutputStream());
    byte[] bytes = buffer.toByteArray();
    response.setContentLength(bytes.length);
    for (int i = 0; i < bytes.length; i++) {
    output.writeByte(bytes);
    } catch (Exception ex) {
    %>
    Sorry, error...
    <% } %>
    My Java Methode looks like this:
    public static ByteArrayOutputStream saveAL(PageContext ctx) {
    ByteArrayOutputStream baos = null;
    try {                         
    System.out.println("Get container...");
    DCBindingContainer bindings = (DCBindingContainer)ctx.getRequest().getAttribute("bindings");
    BindingContext bc = bindings.getBindingContext();
    System.out.println("get AM...");
    DCDataControl dc = bc.findDataControl("AppModuleDataControl");
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    System.out.println("get View");
    ViewObject voAL = am.findViewObject("DispAlertLogView");
    System.out.println("create streamer...");
    baos = new ByteArrayOutputStream();
    PrintStream ps = new PrintStream(baos);
    System.out.println("loop...");
    voAL.first();
    ps.println(voAL.getCurrentRow().getAttribute("Line").toString());
    while(voAL.hasNext()){
    voAL.next();
    ps.println(voAL.getCurrentRow().getAttribute("Line").toString());
    } catch (Exception e) {
    System.out.println("Error on FileSave (alert log): " + e);
    return baos;
    in principle it works well, but i get a null Pointer exception at:
    DCBindingContainer bindings = (DCBindingContainer)ctx.getRequest().getAttribute("bindings");
    I already tried to deliver PageLifecycleContext in jsp page, but then an error occur that it is not possible to deliver this variable.
    I hope you know a solution to get AppModul,
    or even deliver the PageLifecycleContext-Variable then i could get AppModul on my own
    Thanks
    Sebastian
    Message was edited by:
    Sebastian_ME

    Note that there is an extension called Simple Java Bean Editor that will give you back a similar tab - get it through help->check for updates

  • URGENT!! - Bug on read (readLine) method?

    Hello to all, I have need of a large aid.
    I need to know if There is the possibility that the method read() or readLine(), than I use for reading data from a socket from a PLC, has a Bug.
    This why, with the socket opened and of the data in arrival from the PLC (than does not give to errors), the method read() raises the "Connection exception reset by peer."
    The Technicians of the PLC say not to have errors but and I am surest of the correct operation of the server socket, also why it has been tested with telnet, hyperterminaly and others client without problems.
    I do not know that what to say and what to try.
    Thanks for every eventual aid.

    I don't think there is a bug with BufferedReader. But instead of using buffered reader, you can try using the socket input stream directly for reading to see if it makes any difference:
    try {
      // if the PLC is a client:
      ServerSocket serverSocket = new ServerSocket(...);
      Socket socket = serverSocket.accept();
      // or if the PLC is a server:
      Socket socket = new Socket(...);
      // and the rest of the code to test with
      InputStream in = socket.getInputStream();
      byte[] buffer = new byte[1024];
      int length;
      while ((length = in.read(buffer)) != -1) {
        System.out.println("Read "+length+" bytes");
      System.out.println("Connection closed");
    } catch (Exception e) {
      e.printStackTrace();
    }See if that little example works.
    Is the PLC i client or server? Is the PLC the first to write something to your java program or do you have to write something to it first (maybe it doesn't understand what you write to it).
    If you use reader/writer classes, there could be problems with the character encoding you use. If you don't specify any with InputStreamReader/OutputStreamWriter, then you will use the default platform encoding. I don't know which character encoding the PLC use, but if the characters are between 0 and 255, and you really want to use reader and writer classes, then use the ISO 8859-1 encoding.

  • Writing my own droplet

    Hi,
    I am learning how to write my own droplet.
    In this droplet I have to take input from user as an integer value and then in output I have to print the values from 1 to that input valuue.
    Please help me regarding this.
    Regards,
    Prateek G

    If I want to give a text box where user has to fill the value and then click on a submit button the result will show under that text box.So How can I implement this ?
    >
    In such type of requirement you can try like below:
    [1]. write input.jsp
    input.jsp:
    <html>
         <head>
              <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
              </script>
              <script>
                   $(document).ready(function(){
                        $("#name").change(function(){
                             var name=$("#name").val();
                             $.ajax({
                                  type: "POST",
                                  url: "callDroplet.jsp",
                                  data: {name: name},
                                  success:function(result){                    
                                       $("#showOutput").html(result);                    
              </script>
         </head>
         <body>
              <input type="text" id="name">
              <div id="showOutput">callDroplet.jsp's output will come here</div>
         </body>
    </html>[2]. Write callDroplet.jsp
    <body>
              <dsp:droplet name="/a/b/c/MyXYZDroplet">
                   <dsp:param name="input_param" param="name">
                   <dsp:oparam name="output">
                        Your output message goes here
                   </dsp:oparam>
              </dsp:droplet>
         </body>-RMishra
    Edited by: RMishra on May 25, 2013 2:38 PM

  • [spamassassin] failure on writing his own files

    Hello,
    i set up a mail server using arch, postfix, dovecot, mysql, spamassassin.
    almost everything is working fine, but i got an error about spamassassin not able to create/read some files, an bayes eval failure.
    here is the log :
    2012-11-22T11:34:55.100773+00:00 localhost postfix/postscreen[20895]: CONNECT from [209.85.214.46]:62210 to [92.243.17.51]:25
    2012-11-22T11:34:55.100996+00:00 localhost postfix/postscreen[20895]: PASS OLD [209.85.214.46]:62210
    2012-11-22T11:34:55.117560+00:00 localhost postfix/smtpd[20896]: connect from mail-bk0-f46.google.com[209.85.214.46]
    2012-11-22T11:34:55.506511+00:00 localhost postfix/smtpd[20896]: 7B9E3255C2: client=mail-bk0-f46.google.com[209.85.214.46]
    2012-11-22T11:34:55.749004+00:00 localhost postfix/cleanup[20902]: 7B9E3255C2: message-id=<[email protected]m>
    2012-11-22T11:34:55.773781+00:00 localhost postfix/qmgr[17253]: 7B9E3255C2: from=<[email protected]>, size=1506, nrcpt=1 (queue active)
    2012-11-22T11:34:55.788150+00:00 localhost spamd[16751]: spamd: connection from localhost [127.0.0.1] at port 46217
    2012-11-22T11:34:55.788961+00:00 localhost spamd[16751]: spamd: setuid to nobody succeeded
    2012-11-22T11:34:55.789217+00:00 localhost spamd[16751]: spamd: creating default_prefs: //.spamassassin/user_prefs
    2012-11-22T11:34:55.790047+00:00 localhost spamd[16751]: config: cannot create user preferences file //.spamassassin/user_prefs: No such file or directory
    2012-11-22T11:34:55.790284+00:00 localhost spamd[16751]: spamd: failed to create readable default_prefs: //.spamassassin/user_prefs
    2012-11-22T11:34:55.792041+00:00 localhost spamd[16751]: spamd: processing message <[email protected]m> for nobody:99
    2012-11-22T11:34:58.650172+00:00 localhost spamd[16751]: plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create lockfile /.spamassassin/bayes.mutex: No such file or directory
    2012-11-22T11:34:58.652776+00:00 localhost spamd[16751]: spamd: clean message (-0.8/5.0) for nobody:99 in 2.9 seconds, 1477 bytes.
    2012-11-22T11:34:58.653071+00:00 localhost spamd[16751]: spamd: result: . 0 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW scantime=2.9,size=1477,user=nobody,uid=99,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=46217,mid=<[email protected]m>,autolearn=unavailable
    2012-11-22T11:34:58.694529+00:00 localhost postfix/pickup[18387]: A94E7255C4: uid=99 from=<[email protected]>
    2012-11-22T11:34:58.696117+00:00 localhost postfix/pipe[20903]: 7B9E3255C2: to=<[email protected]>, relay=spamassassin, delay=3.3, delays=0.41/0.01/0/2.9, dsn=2.0.0, status=sent (delivered via spamassassin service)
    2012-11-22T11:34:58.698830+00:00 localhost postfix/qmgr[17253]: 7B9E3255C2: removed
    2012-11-22T11:34:58.699185+00:00 localhost postfix/cleanup[20902]: A94E7255C4: message-id=<[email protected]m>
    2012-11-22T11:34:58.701168+00:00 localhost spamd[16750]: prefork: child states: II
    2012-11-22T11:34:58.723994+00:00 localhost postfix/qmgr[17253]: A94E7255C4: from=<[email protected]>, size=1863, nrcpt=1 (queue active)
    2012-11-22T11:34:58.760261+00:00 localhost dovecot: auth-worker(20909): mysql(localhost): Connected to database postfix_db
    2012-11-22T11:34:58.793178+00:00 localhost dovecot: lda([email protected]): sieve: msgid=<[email protected]m>: stored mail into mailbox 'Latex.gut'
    2012-11-22T11:34:58.794782+00:00 localhost postfix/pipe[20907]: A94E7255C4: to=<[email protected]>, relay=dovecot, delay=0.13, delays=0.06/0.01/0/0.06, dsn=2.0.0, status=sent (delivered via dovecot service)
    2012-11-22T11:34:58.795047+00:00 localhost postfix/qmgr[17253]: A94E7255C4: removed
    2012-11-22T11:35:26.227313+00:00 localhost postfix/smtpd[20896]: disconnect from mail-bk0-f46.google.com[209.85.214.46]
    i suspect this :
    2012-11-22T11:34:55.788961+00:00 localhost spamd[16751]: spamd: setuid to nobody succeeded
    to be part of the problem, but i'm not sure, and maybe some guru here can help me ?
    here is postconf -n :
    alias_database = $alias_maps
    alias_maps = hash:/etc/postfix/aliases
    body_checks = regexp:/etc/postfix/body_checks.cf
    broken_sasl_auth_clients = yes
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/lib/postfix
    data_directory = /var/lib/postfix
    debug_peer_level = 2
    debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
    dovecot_destination_recipient_limit = 1
    header_checks = regexp:/etc/postfix/header_checks.cf
    html_directory = no
    inet_protocols = ipv4
    local_recipient_maps = $virtual_mailbox_maps
    local_transport = virtual
    mail_owner = postfix
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    mime_header_checks = regexp:/etc/postfix/mime_headers_checks.cf
    newaliases_path = /usr/bin/newaliases
    postscreen_dnsbl_action = enforce
    postscreen_dnsbl_sites = zen.spamhaus.org*2 bl.spamcop.net*2 b.barracudacentral.org*1 bl.mailspike.net*1
    postscreen_dnsbl_threshold = 2
    postscreen_greet_action = enforce
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix
    relay_domains = *
    sample_directory = /etc/postfix/sample
    sendmail_path = /usr/sbin/sendmail
    setgid_group = postdrop
    smtpd_recipient_restrictions = reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_non_fqdn_sender, reject_unknown_recipient_domain, reject_invalid_helo_hostname, reject_unlisted_recipient, reject_unlisted_sender, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_unauth_destination, permit
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain = $mydomain
    smtpd_sasl_path = /var/run/dovecot/auth-client
    smtpd_sasl_security_options = noanonymous
    smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
    smtpd_sasl_type = dovecot
    smtpd_tls_auth_only = yes
    smtpd_tls_cert_file = /etc/ssl/private/server.crt
    smtpd_tls_key_file = /etc/ssl/private/server.key
    smtpd_tls_loglevel = 1
    transport_maps = hash:/etc/postfix/transport
    unknown_local_recipient_reject_code = 550
    virtual_alias_maps = proxy:mysql:/etc/postfix/virtual_alias_maps.cf
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /srv/vmail
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/virtual_domains_maps.cf
    virtual_mailbox_limit = 512000000
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/virtual_mailbox_maps.cf
    virtual_minimum_uid = 5000
    virtual_transport = dovecot:
    virtual_uid_maps = static:5000
    master.cf :
    # Postfix master process configuration file. For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master").
    # Do not forget to execute "postfix reload" after editing this file.
    # ==========================================================================
    # service type private unpriv chroot wakeup maxproc command + args
    # (yes) (yes) (yes) (never) (100)
    # ==========================================================================
    #smtp inet n - n - - smtpd
    smtp inet n - n - 1 postscreen
    smtpd pass - - n - - smtpd -o content_filter=spamassassin
    dnsblog unix - - n - 0 dnsblog
    tlsproxy unix - - n - 0 tlsproxy
    submission inet n - n - - smtpd
    #smtp inet n - n - - smtpd -o content_filter=spamassassin
    # -o syslog_name=postfix/submission
    -o smtpd_tls_security_level=encrypt
    -o smtpd_sasl_auth_enable=yes
    # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    # -o milter_macro_daemon_name=ORIGINATING
    #smtps inet n - n - - smtpd
    # -o syslog_name=postfix/smtps
    # -o smtpd_tls_wrappermode=yes
    # -o smtpd_sasl_auth_enable=yes
    # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    # -o milter_macro_daemon_name=ORIGINATING
    #628 inet n - n - - qmqpd
    pickup fifo n - n 60 1 pickup
    cleanup unix n - n - 0 cleanup
    qmgr fifo n - n 300 1 qmgr
    #qmgr fifo n - n 300 1 oqmgr
    tlsmgr unix - - n 1000? 1 tlsmgr
    rewrite unix - - n - - trivial-rewrite
    bounce unix - - n - 0 bounce
    defer unix - - n - 0 bounce
    trace unix - - n - 0 bounce
    verify unix - - n - 1 verify
    flush unix n - n 1000? 0 flush
    proxymap unix - - n - - proxymap
    proxywrite unix - - n - 1 proxymap
    smtp unix - - n - - smtp
    relay unix - - n - - smtp
    # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq unix n - n - - showq
    error unix - - n - - error
    retry unix - - n - - error
    discard unix - - n - - discard
    local unix - n n - - local
    virtual unix - n n - - virtual
    lmtp unix - - n - - lmtp
    anvil unix - - n - 1 anvil
    scache unix - - n - 1 scache
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    # Many of the following services use the Postfix pipe(8) delivery
    # agent. See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #maildrop unix - n n - - pipe
    # flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
    # ====================================================================
    # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
    # Specify in cyrus.conf:
    # lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
    # Specify in main.cf one or more of the following:
    # mailbox_transport = lmtp:inet:localhost
    # virtual_transport = lmtp:inet:localhost
    # ====================================================================
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    #cyrus unix - n n - - pipe
    # user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
    # ====================================================================
    # Old example of delivery via Cyrus.
    #old-cyrus unix - n n - - pipe
    # flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
    # ====================================================================
    # See the Postfix UUCP_README file for configuration details.
    #uucp unix - n n - - pipe
    # flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    # ====================================================================
    # Other external delivery methods.
    #ifmail unix - n n - - pipe
    # flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    #bsmtp unix - n n - - pipe
    # flags=Fq. user=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
    #scalemail-backend unix - n n - 2 pipe
    # flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
    # ${nexthop} ${user} ${extension}
    #mailman unix - n n - - pipe
    # flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
    # ${nexthop} ${user}
    spamassassin unix - n n - - pipe user=nobody argv=/usr/bin/vendor_perl/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
    #using LDA with dovecot
    dovecot unix - n n - - pipe
    flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -d ${recipient}

    i'm probably a bit stupid...
    mkdir & chown spamd: did the job...

  • Where can one find information on writing thier own app?

    Have an idea that I would like to develop into an app.  Where might one begin in writing the necessary software?

    Get an iOS Developer Account...
    Choosing an iOS Developer Program / Which Developer Program is for you?
    ...then use the resources that come with it in the iOS Dev Center.
    iOS Human Interface Guidelines
    iOS Starting Point
    Start Developing iOS Apps Today
    App Development Overview
    App Store Review Guidelines for iOS Apps
    Your First iOS App

  • Writing your own adapter

    Hi everybody,
    I'm pretty sure this is general enough not to be in the Swing forum, although this particular example involves Swing, if not, please let me know. :)
    Anyway, I'm trying to write an adapter class that can use methods in many different listener classes, but doesn't need to implement all of them. I need certain methods from each listener class, but not all of them, and the extra methods would clutter my code up. I can't extend them all, I know.
    My first attempt at this was:
    public abstract class Adapter implements ActionListener, MenuListener, MouseInputListener,
              WindowFocusListener, WindowListener {
    }I've also tried:
    public interface Adapter extends ActionListener, MenuListener, MouseInputListener,
              WindowFocusListener, WindowListener {
    }In both cases, I get warnings and errors saying I need to implement every method in each interface (windowClosing, actionPerformed, etc.). Does anyone know what I'm doing wrong here?
    Thanks,
    Jezzica85

    KelVarnson wrote:
    Encephalopathic wrote:
    The thing is though the Adapter class is by nature ugly and will have many methods declared that do nothing. If you want to create this, yours is going to be cluttered with many empty methods.Isn't that the whole point of an Adapter class? Yes. I didn't say that this is a bad thing, just that it doesn't look pretty; it's cluttered. What is bad is her desire to lump them all together into one big unholy mess.
    But yes, I do agree with your points against a mega-Adapter.As we both agree on.

Maybe you are looking for

  • Unable to Install Logic Studio

    I am trying to install Logic Studio and am failing every time. I have a Powerbook G4 1.5 Ghz with 1.25 mb Ram running OSX 10.4.10 I am able to start the installation, choose the location of the install, and select which components I'd like to install

  • Empty lines at the end of the payload generated in FTP server

    Hi All, I am facing an issue in one of the use cases that I am trying to implement. I am getting a purchase order from one of the trading partners through Oracle B2B. B2B forwards this B2BM (B2B message ) to AIAB2BInterface. From AIAB2BInterface my B

  • Best workflow for editing Logic Pro 8 regions/tracks in Soundtrack Pro?

    I've searched for a solution for the below question in several forums and to no avail. Thanks in advance for any help! What is the easiest workflow for editing Logic Pro 8 audio files with Soundtrack Pro 2? And I'm thinking of a process very similar

  • IDES ERP 2005 ECC 6.0 SR2 - unicode  configuration

    Hi Experts, I successfully installed IDES ERP 2005 ECC 6.0 SR2 - unicode on windows 2003 32 bit with oracle10g on my home computer. The system has inbuilt mySAP Business Suite components: BW 7.0/SEM 6.0, SRM 5.0, CRM 5.0, SCM 5.0, GTS 7.0 etc. I can

  • What's the exact use of GNS(Grid Naming Server) ???

    Hi, I have doubt that what's the use of GNS ? What's the logic behind GNS ? Can we use DNS in stead of GNS ( I assume that probably we can use DNS in place of GNS as GNS is sub domain of DNS ). The last question : Can we use GPNP without GNS ? Regard