12 Replies Latest reply on Aug 30, 2006 5:05 PM by 807557

    Sendmail Error!!!!!!!

    807557
      When i am sending mail through sendmail i get the errror

      "Deferred: Connection reset by peer"

      and in mailq the error is:

      "(reply: read error from server)"

      Where exactly is the problem to trouble shoot???
        • 1. Re: Sendmail Error!!!!!!!
          807739
          Sounds like the connection was dropped by the remote host. Many times, this is a result of the remote host identifying you as a spam site and just dropping the connection.

          Try doing a manual connection to that host using telnet and just type the commands to see what might be wrong. If they are dropping you, most of the time they say why or that they are doing so.

          I replace sendmail with a bundled version of Exim on all my servers now. Better logging and easier configuration.
          • 2. Re: Sendmail Error!!!!!!!
            807557
            When i do Telnet, says connection open.

            what's this Exim?
            • 3. Re: Sendmail Error!!!!!!!
              807739
              To test with telnet, you need to provide the smtp port like

              # telnet hostname.domain.com 25

              That should get you that servers smtp port (many times Sendmail). You would then use smtp commands to test the server. Example...

              - - - - - - - - - - - - - - - - - - - -
              # telnet somehost.mail.com 25
              Trying XXX.XXX.XXX.XXX
              Connected to somehost.mail.com.
              Escape character is '^]'.
              220 somehost.mail.com ESMTP Generic MTA Thu, 27 Jul 2006 13:33:04 -0700
              helo myhost.com
              250 somehost.mail.com Hello myhost.com [xxx.xxx.xxx.xxx] <- IP would be your IP
              mail from: me@myhost.com
              250 OK
              rcpt to: touser@mail.com
              250 Accepted
              data
              354 Enter message, ending with "." on a line by itself
              Subject: This is a test

              This is a test message
              .

              250 OK id=1G6CY2-00044z-0B
              quit
              221 somehost.mail.com closing connection
              - - - - - - - - - - - - - - - - - - - -

              Exim = http://www.exim.org

              there are several binary builds you could use as well. I have a simple tarball that I built to load onto a Sun box that creates the necessary files/dirs permissions etc.. and all you have to do is change the hostname and you have a basic mail client/server. I replace sendmail on all our sun boxes with it.
              • 4. Re: Sendmail Error!!!!!!!
                807557
                Thanks Krelvinaz.

                How can i schedule this in a cron?
                • 5. Re: Sendmail Error!!!!!!!
                  807557
                  Man pages for sendmail are so fishy.

                  Can some one send me the options like

                  sendmail -v ......................................

                  Message: status report

                  from: xyz@abc.com

                  to: a1@abc.com, b2@abc.com

                  file: /tmp/report.log
                  • 6. Re: Sendmail Error!!!!!!!
                    807739
                    Assuming sendmail is configured properly, you want to use mailx instead of sendmail itself to do that...

                    Logged in as the user xyz
                       mailx -s 'status report' a1@abc.com, b2@abc.com < /tmp/report.log
                    To make it look like it is coming from a user other than the logged in user requires the use of sendmail but the user needs to be trusted to allow it.
                    • 7. Re: Sendmail Error!!!!!!!
                      807557
                      Thanks, Krelvinaz.

                      I was looking for options in Sendmail to do it.
                      • 8. Re: Sendmail Error!!!!!!!
                        807739
                        In order to make mail look like it comes from someone else, the sender must be Trusted. Then you can use the -f switch to say who the Envelope Sender (Sender of the mail) is like below:
                        /usr/lib/sendmail -f mickey@sample.com  -t < mail_file
                        The -t switch tells sendmail to use the headers found in the mail_file to do the rest of the headers including From: To: Subject etc. and figure out who the mail is sent to.

                        Make sure you create valid Date and Message-ID headers too or your mail may be dropped as Spam.

                        Sample mail_file:
                        From: mickey@sample.com
                        To: user1@sample.com, user2@sample.com
                        Subject: Test message
                        Date: Tue, 1 Aug 2006 12:31:24 -0700 (MST)
                        Message-ID: <2061.1154460684.mickey@sample.com>
                        
                        Sample Mail message using full headers.
                        If this is for Cron job like entries, unless you want to write your own wrapper for sendmail you are much better off using mailx.
                        • 9. Re: Sendmail Error!!!!!!!
                          807557
                          This is what i was expecting.

                          Now my question is can i add the log file which i need to be send to the users in the mail_file list?

                          /usr/lib/sendmail -f mickey@sample.com -t < mail_file /tmp/report.log

                          though i am now comfortable with mailx, would like to know out of curiosity!
                          • 10. Re: Sendmail Error!!!!!!!
                            807739
                            One of the reasons why you want to use mailx is because it is a Mail User Agent (MUA). It adds necessary headers when you use it so that you don't have to.

                            Sendmail is not a MUA but rather a Mail Transfer Agent (MTA) and is normally what an MUA talks to, to send mail. So it works more in raw mode.

                            You can create scripts (ksh, perl even PHP) that can do custom stuff with sendmail to get what you want but by default, mailx sends mail as the user that is running it and is more than enough to do what is necessary, especially for sending log files.

                            Doing that, you can make mail look like just about anything you want, but you need to know some coding to make it work.
                            • 11. Re: Sendmail Error!!!!!!!
                              807557
                              I cannot access my Inbox, instead Im receiving below error message

                              "ERROR: Could not complete request.
                              Query: SELECT "INBOX"
                              Reason Given: Internal error occurred. Refer to server log for more information. [2006-08-30 15:29:38]"

                              when I try to restart my sendmail the following error message appairs

                              Failed to start sendmail :
                              Starting sendmail: [  OK  ]
                              Starting sm-client: exim abandoned: unknown, malformed, or incomplete option -L
                              [FAILED]
                              • 12. Re: Sendmail Error!!!!!!!
                                807557
                                Are you restarting sendmail as root user?

                                Above threads would help you!