Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

mails sent but they get lost

SOLVED
Go to solution
Ruben Cardenal
Frequent Advisor

mails sent but they get lost

Hi,

I'm setting up somo machines to send all logs to another where they will be read. In one of those machines, i have a problem with sendmail:

root@grecopr1:/etc/mail# echo Hola | mail logs@grecopr2
root@grecopr1:/etc/mail# tail -2 /var/adm/syslog/mail.log
Feb 5 12:21:59 grecopr1 sendmail[24185]: MAA24185: from=root, size=6, class=0, pri=30006, nrcpts=1, msgid=<200202051121.MAA24185@grecopr1.>, relay=root@localhost
Feb 5 12:21:59 grecopr1 sendmail[24187]: MAA24185: to=logs@grecopr2, ctladdr=root (0/3), delay=00:00:00, xdelay=00:00:00, mailer=local, stat=Sent
root@grecopr1:/etc/mail#

The mail seems to have been sent, but the message doesn't arrive. This is all my sendmail minimal configuration related information:

root@grecopr1:/etc/mail# cat /etc/nsswitch.conf
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any name services.
#
hosts: files
aliases: files
passwd: files
group: files
hosts: files
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files
root@grecopr1:/etc/mail#

/usr/sbin/sendmail -bd -q30m && echo "sendmail"

root@grecopr1:/etc/mail# cat /etc/hosts

10.15.7.21 grecopr1 grecopr1.
10.15.7.22 grecopr2
10.15.7.29 grecopkg
10.15.7.23 grecods
10.15.7.27 tareadb
10.15.7.25 tareaap1
10.15.7.26 tareaap2
10.15.7.24 tareads
135.10.0.6 greco01
135.14.1.1 eh41
127.0.0.1 localhost loopback
root@grecopr1:/etc/mail#

root@grecopr1:/etc/mail# cat sendmail.cw
localhost
grecopr1
grecopr1.
root@grecopr1:/etc/mail#

And these parts of /etc/mail/sendmail.cf:

Dj$w.
DH grecopr2
CL root

Can anybody help?

TIA
6 REPLIES
Robin Wakefield
Honored Contributor

Re: mails sent but they get lost

Hi,

Trace the rulesets being used:

/usr/lib/sendmail -d21.12 -bv logs@grecopr2

and see why it's deciding to use a local mailer. Check it's using the $H macro.

Rgds, Robin
Ruben Cardenal
Frequent Advisor

Re: mails sent but they get lost

 
Robin Wakefield
Honored Contributor

Re: mails sent but they get lost

Hi,

rewrite: ruleset 98 returns: logs < @ grecopr2 . >
rewritten as: logs < @ grecopr2 . >
-----trying rule: $+ / $* / $* / $* / $* < @ $=w . >
----- rule fails
-----trying rule: $+ / $* < @ $=w . >
----- rule fails
-----trying rule: $=L < @ $=w . >
----- rule fails
-----trying rule: $+ < @ $=w . >
-----rule matches: $# local $: $1
rewritten as: $# local $: logs
rewrite: ruleset 0 returns: $# local $: logs

would indicate that grecopr2 is defined in the w (local machine name) class. Can you now run:

/usr/lib/sendmail -d37.8
to show the "w" class being defined.

Rgds, Robin.
Ruben Cardenal
Frequent Advisor

Re: mails sent but they get lost

Here it is:

root@grecopr1:/home/logs# /usr/lib/sendmail -d37.8 setdefaults: DefUser=daemon, DefUid=1, DefGid=5
inittimeouts()
Timeouts:
connect = 0
initial = 300
helo = 300
mail = 600
rcpt = 3600
datainit = 300
datablock = 3600
datafinal = 3600
rset = 300
quit = 120
nextcommand = 3600
miscshort = 120
ident = 30
fileopen = 60
setclass(w, grecopr1.)
setclass(k, grecopr1)
setclass(w, grecopr1)
setclass(w, grecopr1.)
setclass(w, [10.15.7.21])
setclass(w, localhost)
fileclass(/etc/mail/sendmail.cw, fmt=%s)
setclass(w, localhost)
setclass(w, grecopr1)
setclass(w, grecopr1.)
setclass(E, root)
fileclass(/etc/mail/uucp-hosts, fmt=%s)
setoption DeliveryMode (d).=background
setoption HoldExpensive (c).=False
setoption LogLevel (L).=9
setoption Timeout (r).queuereturn=5d
settimeout(queuereturn = 5d)
setoption Timeout (r).queuewarn=4h
settimeout(queuewarn = 4h)
setclass(P, .)
setclass(O, @)
setclass(O, %)
setclass(O, !)
setclass(., .)
map dequote, class dequote, flags 10001, file (null),
app (null), domain (null), rebuild (null)
setclass(P, REDIRECT)
setoption TryNullMXList (w).=
setoption SevenBitInput (7).=False
setoption EightBitMode (8).=pass8
setoption AliasWait (a).=10
setoption AliasFile (A).=/etc/mail/aliases
map aliases.files, class sequence, flags 1, file (null),
app (null), domain (null), rebuild (null)
setoption MinFreeBlocks (b).=100
setoption BlankSub (B).=.
setoption TempFileMode (F).=0600
setoption HelpFile (H).=/usr/share/lib/sendmail.hf
setoption SendMimeErrors (j).=True
setoption ForwardPath (J).=$z/.forward.$w:$z/.forward
setoption ConnectionCacheSize (k).=2
setoption ConnectionCacheTimeout (K).=5m
setoption UseErrorsTo (l).=False
setoption CheckAliases (n).=False
setoption OldStyleHeaders (o).=True
setoption PrivacyOptions (p).=authwarnings
setoption QueueDirectory (Q).=/var/spool/mqueue
setoption SuperSafe (s).=True
setoption StatusFile (S).=/etc/mail/sendmail.st
setoption TimeZoneSpec (t).=
setoption DefaultUser (u).=1:1
setdefuser: DefUid=1, DefUser=daemon
setoption SmtpGreetingMessage (0x90).=$j Sendmail $v/$Z; $b
setoption UnixFromLine (0x91).=From $g $d
setoption OperatorChars (0x92).=.:%@!^/[]+
setclass(t, root)
setclass(t, daemon)
setclass(t, uucp)
map host, class host, flags 1, file (null),
app ., domain (null), rebuild (null)
map aliases, class switch, flags 301, file aliases,
app (null), domain (null), rebuild (null)
setclass(m, )
setclass(w, [192.168.136.1])
setclass(w, grecopr2)
setclass(w, [10.15.8.21])
setclass(w, [127.0.0.1])
setclass(w, [10.15.7.29])
setclass(w, grecopkg)
setclass(w, grecopr1.)
setclass(n, multipart/signed)
setclass(s, rfc822)
setclass(e, 7bit)
setclass(e, 8bit)
setclass(e, binary)
root... Recipient names must be specified
root@grecopr1:/home/logs#
Robin Wakefield
Honored Contributor
Solution

Re: mails sent but they get lost

Hi,

Towards the end of the last output you posted, you can see:

setclass(w, [192.168.136.1])
setclass(w, grecopr2)
setclass(w, [10.15.8.21])
setclass(w, [127.0.0.1])
setclass(w, [10.15.7.29])
setclass(w, grecopkg)
setclass(w, grecopr1.)

These look like additional interfaces on the grecopr1 server. At a guess, I'd say 192.168.132.1 is resolving to grecopr2, which is why it being delivered locally. Is grecopr2 a different server?

Have you checked the "logs" mailbox locally?

Rgds, Robin.
Ruben Cardenal
Frequent Advisor

Re: mails sent but they get lost

Yes, in /etc/hosts that IP was defined too as the first IP related to localhost that appears in the file. I have removed it and all works fine now. Thanks :)