10 Replies Latest reply on Jul 8, 2009 1:43 PM by 807567

    sendmail vs. mailx problem

    807567
      Hi,

      I've a problem with mail sending from Solaris 8 machine. When I send the mails using 'sendmail' command, the mail reach it destination. But when I am using mailx command, mail sending fails:

      This works:
      -
      echo " TEST" | sendmail -s "test" -f root@<some.address>.com <receipient>@<domain.com>
      This does not work:
      -
      echo " TEST" | mailx -s "test" -r root@<some.address>.com <receipient>@<domain.com>
      error message example from /var/log/mail.log:
      Feb 20 12:06:50 +<server name>+ sendmail[11817]: [ID 801593 mail.info] m1KB6oU11815: to=+<receipient@domain.com>+, ctladdr=root@+<from server>+ (0/1), delay=00:00:00, xdelay=00:00:00, mailer=smtp, pri=120079, relay=<relay address> [+<relay IP>+], dsn=5.7.1, stat=*User unknown*

      info from the returned mail:
      Final-Recipient: RFC822; +<receipient>+
      Action: failed
      Status: 5.7.1
      Remote-MTA: DNS; <relay>
      Diagnostic-Code: SMTP; 550 5.7.1 <+receipient+>... Relaying denied. IP name lookup failed [+<IP address>+]
      Last-Attempt-Date: Wed, 20 Feb 2008 12:06:50 +0100 (MET)

      Any idea what could be the reason of such a wierd behaviour? Thx
        • 1. Re: sendmail vs. mailx problem
          807567
          sendmail has the 'intelligence' to figure out how to send the mail to a recipient not on the local machine - provided the machine has access/can route to the network where recipient is located. In order for mailx to do this, you need to use /etc/aliases ( /etc/mail/aliases ) . In the aliases file, and the bottom of the file, enter:

          recipient: <recipient>@<domain.com>

          save file and exit vi.
          run: newaliases

          Try your test again. (aliases file belongs to sendmail; this is how mailx can use sendmail's ability to route mail to non-localhost recipients)
          • 2. Re: sendmail vs. mailx problem
            807567
            Thx for the answer. But unfortunately this did not work. I did:

            edited /etc/mail/aliases with new line
            <receipient>: <receipient>@<domain.com>

            and run newaliases with good output:
            sendmail[12571]: [ID 702911 mail.notice] alias database /etc/mail/aliases rebuilt by root

            but the problem persist without any change.

            I still got this message in the /var/log/mail.log

            Feb 21 21:42:53 <server name> sendmail[12576]: [ID 801593 mail.info] m1LKgr412574: to=<receipient>@<domain.com>, ctladdr=root@<server's domain> (0/1), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120068, relay=<relay's domain>. [<relay's IP>], dsn=5.7.1, stat=User unknown

            Edited by: trige123 on Feb 21, 2008 12:51 PM
            • 3. Re: sendmail vs. mailx problem
              807567
              Is DNS on your machine set up properly?
              nslookup ip-addr-of-your-machine (should return hostname of your machine)
              nslookup hostname (should return ip-address.in-addr.arpa)
              .
              ie.
              .
              -> nslookup mymachine
              Server: ip.addr.dns.serv
              Address: ip.addr.dns.serv#53

              Non-authoritative answer:
              Name: mymachine@mydomain.com
              Address: 192.168.3.5

              -> nslookup 192.168.3.5
              Server: ip.addr.dns.serv
              Address: ip.addr.dns.serv#53

              Non-authoritative answer:
              5.3.168.192.in-addr.arpa name = mymachine@mydomain.com.

              .
              Did you shut sendmail down and opt to use mailx instead, or are you going to use both for mail?

              Edited by: SolarisSAinPA on Feb 21, 2008 4:23 PM
              • 4. Re: sendmail vs. mailx problem
                807567
                I used nslookup in the very beginning. I checked <server> relays and mailhost. All this works (shows IP address corresponding to the name or vice versa)

                sendmail has to stay as a main mail daemon on the server so I am not able to use mailx and stop sendmail.

                In the beginning I thought that there is some misconfiguration in the /etc/mail/<somefile>. To test this I've copied the whole structure of /etc/mail from the other server (on which mailing is working) with the similar configuration. But this did not change anything.

                So I am starting to think that the problem is out of the server.

                Now I just hope that mail gateway admin will be able to help, cause I am really out of ideas.
                • 5. Re: sendmail vs. mailx problem
                  807567
                  Did you check DNS entries for machine you are trying to run mailx from?
                  • 6. Re: sendmail vs. mailx problem
                    807567
                    Yes, I did.

                    (root@<server>:~)#nslookup <server>
                    Server: <server1>
                    Address: <ip1>

                    Name: <server>
                    Address: <ip>


                    in /etc/resolv.conf the entries are correct
                    • 7. Re: sendmail vs. mailx problem
                      807567
                      Want to make sure reverse lookup works, too:

                      nslookup ip.of.server.that.cant.mailx

                      should return FQDN of the machine having trouble sending mail via mailx

                      Are you still getting returned mail similar to this?
                      Final-Recipient: RFC822; ><receipient>
                      Action: failed
                      Status: 5.7.1
                      Remote-MTA: DNS; <relay>
                      Diagnostic-Code: SMTP; 550 5.7.1 ><+receipient+>... Relaying denied. >IP name lookup failed [+<IP >address>+]
                      Last-Attempt-Date: Wed, 20 Feb >2008 12:06:50 +0100 (MET)
                      If it's not a DNS issue, then I'm at a loss -- your logs state that the server is having DNS problems.

                      Good Luck.
                      • 8. Re: sendmail vs. mailx problem
                        807567
                        Hi

                        problem was in the FW rule change. The previous relay was forbidden. I've set a new relay so now it is working.

                        Anyway thx for your answers!
                        • 9. Re: sendmail vs. mailx problem
                          807567
                          Hi,
                          I'm able to send mail to all users (out of server! ) but bot able to send from root to root. When i try to send get messages as below.
                          is there any idea?

                          mailx -s "DENEME" root@lagos < /tmp/dnm

                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.alert] n66DajL0012671: Losing ./qfn66DajL0012671: savemail panic
                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.info] n66DajKx012671: from=root, size=85, class=0, nrcpts=1, msgid=<200907061336.n66DajKx012671@lagos.turkcell.tgc>, relay=root@localhost
                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.info] n66DajKx012671: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30085, relay=smtp3401.turkcell.entp.tgc [10.200.123.135], dsn=5.7.1, stat=User unknown
                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.info] n66DajKx012671: n66DajL0012671: DSN: User unknown
                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.info] n66DajL0012671: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31109, relay=smtp3401.turkcell.entp.tgc [10.200.123.135], dsn=5.7.1, stat=User unknown
                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.info] n66DajL0012671: n66DajL1012671: return to sender: User unknown
                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.info] n66DajL1012671: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32133, relay=smtp3401.turkcell.entp.tgc [10.200.123.135], dsn=5.7.1, stat=User unknown
                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.alert] n66DajL0012671: Losing ./qfn66DajL0012671: savemail panic
                          Jul 6 16:36:45 lagos sendmail[12671]: [ID 801593 mail.crit] n66DajL0012671: SYSERR(root): savemail: cannot save rejected email anywhere
                          • 10. Re: sendmail vs. mailx problem
                            807567
                            in addition;
                            i'm able to send at other system , when it sends mail from root to root it is connecting to local host;

                            root@othersystem # /usr/lib/sendmail -v -d8.99 root@localhost </tmp/dnm
                            getmxrr([127.0.0.1], droplocalhost=1)
                            root@localhost... **Connecting to [127.0.0.1]* via relay...*

                            But at this system it's connecting to mailhost;
                            root@lagos # /usr/lib/sendmail -v -d8.99 root@localhost </tmp/dnm
                            getmxrr(smtp3401.turkcell.entp.tgc, droplocalhost=1)
                            root@localhost... Connecting to smtp3401.turkcell.entp.tgc via relay...