Announcement

Collapse
No announcement yet.

Sendmail config issue

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sendmail config issue

    Hi,

    Pretty new here so bare with me.
    I seem to have a problem with sendmail when system users send mail.
    Works perfectly sending from outside, works perfectly telnetting to localhost manually or when sending mail via a client through localhost but whenever a system user creates a mail it stacks up in /var/spool/mqueue-client and status is always "Deferred: Connection refused by [127.0.0.1]" increasing sendmails log level doesn't give any more clues.

    Happens for

    From To
    Anacron <root> root
    www-data www-data
    and
    Mail Delivery Subsystem <MAILER-DAEMON> www-data (which is a failure to deliver message for www-data, so I know sendmail is trying but can't)


    Searched everywhere but still cannot find any answer for it.

    If it was simply messages from root I wouldn't worry to much, in webmin you can view the messages in the queue OK and delete them but as seen www-data is failing which means any script I write for my webserver creates the mail OK both in Perl using sendmail and php using sendmail but cannot get delivered as sendmail is failing to accept it.

    I've tried adding all the users to trusted-users in sendmail, no change, I've tried changing the mail queue as this is a custom one from the submit files in /etc/mail but nothing so far has worked. Setup for sendmail is pretty much unchanged from default other than adding my domains in to accept incoming and outgoing mail, squirrelmail does not have a problem which is the only web based system I can get work.

    Many thanks for any suggestions.

    Mike

    #2
    Re: Sendmail config issue

    You don't use (or have (de)activated by accident) SSL or TLS encryption?

    Comment


      #3
      Re: Sendmail config issue

      Many thanks, I don't think I have touched either. Most of the configurations admendments attempted have been through webmin or where instructions have been clear remotely through ssh.
      This is what I get from ehlo

      ], pleased to meet you
      250-ENHANCEDSTATUSCODES
      250-PIPELINING
      250-EXPN
      250-VERB
      250-8BITMIME
      250-SIZE
      250-DSN
      250-ETRN
      250-AUTH DIGEST-MD5 CRAM-MD5
      250-DELIVERBY
      250 HELP

      Encryption doesn't interest me as I have no need for it for my applications.

      Comment


        #4
        Re: Sendmail config issue

        I'm not at home now, so I can't test it, but I believe you can do the command:

        netstat -an | grep 25

        Can you give us the results.

        Another question: have you done something in IPtables?

        I'm not an expert in sendmail btw, just trying some things ...

        Comment


          #5
          Re: Sendmail config issue

          Don't you know the difference....between a "Web Address", and an "E-mail Address"?
          The 'www.data'.....is a web address.
          Connection will alway be 'denied'....with web addresses.
          You need a E-mail address, to send e-mails.
          Not web addresses.

          Comment


            #6
            Re: Sendmail config issue


            Thanks for the input

            www-data is the user that runs apache

            Sendmail doesn't always need a domain name as it knows it is part of an established domain and will assume an address to a user there will be for that domain.

            That is why this works ok.

            mike@stan$ telnet localhost 25
            Trying 127.0.0.1...
            Connected to localhost.
            Escape character is '^]'.
            220 stan.mydomain.eu.com ESMTP Sendmail 8.14.2/8.14.2/Debian-2build1; Mon, 8 Sep 2008 21:33:12 +0100; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
            helo domainname.com
            250 stan.mydomain.eu.com Hello localhost [127.0.0.1], pleased to meet you
            mail from: me@domainname.com
            250 2.1.0 me@domainname.com... Sender ok
            rcpt to: root
            250 2.1.5 root... Recipient ok
            data
            354 Enter mail, end with "." on a line by itself
            blah blah blah
            .
            250 2.0.0 m88KXCMm031266 Message accepted for delivery


            Messages for root in this case are then alisased to my username.


            The only thing odd I have found is when sending by any manual means like the above it always has a valid return path
            Return-Path: <me@domainname.com>

            System generated messages from www-data and root have something like
            Return-Path: <?g>
            Received: (from www-data@localhost)by

            Could the return path be causing the problem, if so how is it changed for users root and www-data ?

            Comment


              #7
              Re: Sendmail config issue

              Output as requested.

              netstat -an | grep 25
              tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
              tcp 0 0 127.0.0.1:25 127.0.0.1:38475 TIME_WAIT

              Messages are getting in to sendmail as they are showing in the mqueue-client queue

              Comment


                #8
                Re: Sendmail config issue

                You sound like someone who knows what he's doing. I'm afraid the only advise I can give you is to set sendmail up as a daemon, and then restart sendmail.

                Good luck!

                Comment


                  #9
                  Re: Sendmail config issue

                  I know the theory and technology but I do not know the o/s or the finer points of sendmail.

                  webmin helps a lot

                  currently
                  Command to start sendmail in server mode
                  /usr/lib/sendmail -bd -q1h

                  Comment


                    #10
                    Re: Sendmail config issue

                    I am still having the problem, with your help it seems to have been diagnosed to a problem in the headers
                    messages sent from users www-data (apache) and root have a Return-Path as shown below and are not getting delivered, instead qeueing in mqueue-client

                    Does anyone know where the setting is that helps the system identify itself to sendmail as it seems it doesn't have that in place and is refusing to route messages.

                    Mail headers View basic headers
                    Return-Path: <?g>
                    Received: (from root@localhost)by stanley.domain.eu.com (8.14.2/8.14.2/Submit) id m946nKqK018267for root; Sat, 4 Oct 2008 07:49:20 +0100
                    Date: Sat, 4 Oct 2008 07:49:20 +0100
                    Full-Name: Anacron
                    Message-Id: <200810040649.m946nKqK018267@stanley.domain.eu.com >
                    From: Anacron <root>
                    To: root
                    Subject: Anacron job 'cron.daily' on stanley.domain.eu.com

                    Many many thanks for suggestions of where to check the host/system identity setup.

                    Comment

                    Working...
                    X