sendmail weird Local Delivery Problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sendmail weird Local Delivery Problem
# 1  
Old 05-04-2012
sendmail weird Local Delivery Problem

Hi Guys,

Just joined the forum though I have been lurking here for many years now.

Wondering if anyone can help me out with a problem that I'm currently having. Smilie

I have a few servers that are relaying all email off of the box to an exchange server. There is a SmartHost configured in sendmail.cf

The problem is, is that it relaying ALL emails, even the emails bound for local users. I have another box which is working correctly and only relaying "external" email. I have checked though and compared the sendmail.cf, submit.cf (not in use), domaintable, access and local-host-names as well as the /etc/hosts and /etc/aliases file and they all appear to be identical in both cases.

I've thought that it could be some issue with the /etc/hosts as on the broken server it has several entries for itself pointing it's own IP address;

IP ADDRESS broken_server.domain.com

On the working Server these entries are not present so I decided to replicate the local IP address entries on the working server in the hope that this would break it in the same fashion. It didn't.

I've been toying with the idea of using the -

Code:
Cwlocalhost
# file containing names of hosts for which we receive email
Fw/etc/mail/local-host-names

and/or the Class L -

Code:
# class E: names that should be exposed as from this host, even if we masquerade
# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
# class N: domains that should not be converted to $M
#CL root
C{w}localhost.localdomain

.... to try and put a "sticking plaster" on the situation but would like to understand the odd behaviour if possible.


Working Server

[root@working_server.domain.com mail]# sendmail -bvv username
username... deliverable: mailer local, user username

[root@working_server.domain mail]# sendmail -bvv username@working_server
username@working_server... deliverable: mailer local, user username

[root@working_server.domain mail]# sendmail -bvv username@working_server.domain.com
username@working_server.domain.com... deliverable: mailer local, user username

[root@working_server.domain mail]# sendmail -bvv username@remote_domain.com
username@endava.com... deliverable: mailer relay, host [MAIL_RELAY IP ADDRESS], user username@endava.com



Not Working - Should keep all of these emails local

[root@broken_server.com.domain mail]# sendmail -bvv username
username... deliverable: mailer local, user username
Fine

[root@broken_server.domain.com mail]# sendmail -bvv username@localhost
username@localhost... deliverable: mailer local, user username
Fine

[root@broken_server.domain.com mail]# sendmail -bvv username@localhost.localdomain
username@localhost.localdomain... deliverable: mailer local, user username
Fine

[root@broken_server.domain.com mail]# sendmail -bvv username@broken_server
username@broken_server... deliverable: mailer relay, host [MAIL_RELAY IP ADDRESS], user username@broken_server.domain.com
Borked

[root@broken_server.domain.com mail]# sendmail -bvv username@broken_server.domain.com
username@broken_server.domain.com... deliverable: mailer relay, host [MAIL_RELAY IP ADDRESS], user username@broken_server.domain.com
Borked


Any ideas gents?

Last edited by PACETREE; 05-04-2012 at 10:55 AM..
# 2  
Old 05-04-2012
Please post what Operating System and version you are running on both servers.

Have you compared:
Code:
sendmail.cw

Make sure that the localhost line is present and that the local node name is correct.


Usually for local unix mail you don't specify the domain name in the mail address.
This User Gave Thanks to methyl For This Post:
# 3  
Old 05-04-2012
Hey Methyl. Thanks for your quick response!

Both Servers are Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

I am not using - FEATURE(use_cw_file)) and there is no corressponding /etc/sendmail.cw file present on either server.

Are you suggesting that I should ensure that "localhost" is present in /etc/sendmail.cw ?

What do you mean my "local node name" specifically?

I'm leaning towards adding
Code:
# class E: names that should be exposed as from this host, even if we masquerade
# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
# class N: domains that should not be converted to $M
#CL root
C{w}localhost.localdomain
C{w}broken_server.domain.com

into my sendmailf.cf file.

Moderator's Comments:
Mod Comment Please use next time code tags for your code and data

Last edited by vbe; 05-04-2012 at 09:04 AM..
# 4  
Old 05-04-2012
I would expect the sendmail configuration to be in the directory /etc/mail .

Also compare the service.switch file.


Did you actually run the unix diff program to compare the two sendmail.cf files and then find them to be identical ?

Last edited by zaxxon; 11-14-2014 at 05:42 AM.. Reason: code tag typo
# 5  
Old 05-04-2012
All config files are located in /etc/mail/ but there is no sendmail.cw file. I did a quick google and someone else said that there sendmail.cw file was located under /etc/sendmail.cw so I assumed that might be where it was.

There is no service.switch nor sendmail.cw file located under /etc/mail/ on either of these systems.

I actually exported the files and ran a diff in another system but yes, it's a full diff none-the-less. Obviously they are not identical-identical as the "built-by", "in" & "using" are different but the end result of the compiled sendmail.cf actual configuration is identical in every other respect.
# 6  
Old 05-04-2012
I'm beginning to think that your sendmail is different from ours.
We have a "Class w" which defines the aliases for Local Host. There are two entries Cw (name of local host) and Fw (list of aliases for local host).
Code:
Cwlocalhost
Fw/etc/mail/sendmail.cw

Sounds like yours is different.

Multiple entries in /etc/hosts for the hostname of the local machine can confuse sendmail - especially if they are incorrectly placed on different lines in /etc/hosts . Also check that localhost is the first non-comment line in /etc/hosts and that the local hostname is the second non-comment line in /etc/hosts .

Make sure that nslookup for the fully qualified server name returns the correct name as the first name.

Last edited by methyl; 05-04-2012 at 11:13 AM.. Reason: Amend Fw line - its simpler on later versions.
# 7  
Old 05-04-2012
Yeah dude. Except on my system, within the sendmail.cf file, the file that you refer to as "sendmail.cw" is called "local-host-names" for some reason;

Code:
Cwlocalhost
# file containing names of hosts for which we receive email
Fw/etc/mail/local-host-names

I'm going to try and amend this file to add the aliases and will post back my results probably next week.

Thanks for your help.

---------- Post updated at 04:12 PM ---------- Previous update was at 03:00 PM ----------

I've just tested this now and it seems to work!

No messing about with the sendmail.cf file.

I added the aliases to the /etc/mail/local-host-names and all is now good.

Code:
[root@broken_server mail]# more local-host-names
# local-host-names - include all aliases for your machine here.
broken_server
broken_server.domain.com
[root@broken_server mail]#

Still, it doesn't explain why there was a difference in my systems to begin with!! I guess I will never know.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Qmail mail delivery problem

Dear Concern, As per below article, we have configured qmail in our system. THE LINUX STUFF: qmail Installation Steps on Linux But when we try to send any mail in own domain, got below error message. Please advise. Apr 17 17:01:20 BLAUDITSCPTEST sendmail: alias database /etc/aliases... (0 Replies)
Discussion started by: makauser
0 Replies

2. Shell Programming and Scripting

Weird behavior of command "local"

Hi there, I'm running into a very weird situation. Let's forget about the purpose of my initial script please. I noticed the bug whatever I'm trying to do. I'm on an old server running bash 3.1.17. Say we have the following script : foo:~# cat /tmp/test #!/bin/bash f1() { local... (9 Replies)
Discussion started by: chebarbudo
9 Replies

3. Shell Programming and Scripting

Weird awk problem

Hi, I have a simple awk script: BEGIN{} { $a=$2-$1; print $a } END{if(NR==0){ print "0" } } to which I provide the following input 2.9 14 22.2 27 (4 Replies)
Discussion started by: jamie_123
4 Replies

4. SCO

Sendmail delivers mail to local user if it exists instead of passing it to the smart relay

Environment: SCO Unix Openserver 6 Sendmail ver: 8.11.3 I just put this server online replacing it's old counterpart, same OS on new machine. There are many different servers on this domain, windowssrv.thisdomain.com, oldunix.thisdomain.com, and the new newunix.thisdomain.com just to name a... (2 Replies)
Discussion started by: checkpro
2 Replies

5. UNIX for Advanced & Expert Users

Sendmail: how to restrict delivery based on "to" or "from"?

Hello, I manage a large sendmail server that handles more than 20,000 pieces of mail per day. It's a bit unusual in that all this mail is only being sent to and from 4 local accounts. (It's an automated transaction processing system, whereby users submit a transaction via email attachment). ... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies

6. Solaris

Weird crontab problem

Greetings To All! I am running Solaris 10 in a sparc environment. Here is the deal: In /var/spool/cron/crontabs, there is a cron user named "sys". If I do a crontab -l sys, it returns: # 0 * * * 0-6 /usr/lib/sa/sa1 # 20,40 8-17 * * 1-5 /usr/lib/sa/sa1 # 5 18 * * 1-5 /usr/lib/sa/sa2... (8 Replies)
Discussion started by: RobSand
8 Replies

7. Linux

local mail relay problem in Sendmail

I have a linux box. Sendmail is work fine in this box. The only problem I am facing is whenever I send mail using the mail command to the outside world or to root@localhost, I get this error - 127.0.0.1 localhost denied from relaying The command I used to send mail is - Ls -l | mail -s... (0 Replies)
Discussion started by: RajaRC
0 Replies

8. UNIX for Dummies Questions & Answers

Weird Problem???

I have a problem I don't understand... I am trying to declare a variable, and then output the results of that variable, couldn't be simpler #!/bin/ksh VAR='Oranges' if then echo "Found Lemons" elif then echo "Found Oranges" fi The output shouold clearly be "Found Oranges", but... (2 Replies)
Discussion started by: danhodges99
2 Replies

9. UNIX for Advanced & Expert Users

sendmail : connect local host (brocken)

hi there I've got a strange problem with a webserver box (suse linux 7.2). My MTA is sendmail, and when I tried manually send a mail. Sendmail -v "user@something" < /etc/hosts The Server tried "simon@localhost... Connecting to local..." but nothing happend and the system hold on. This... (3 Replies)
Discussion started by: mrsaint
3 Replies

10. Programming

Sendmail & mail.local + MySQL API

I've searched this message board, and the newgroups THOROUGHLY, in search of any information towards implenting the MySQL API with C... I'm a "beginner" to the C language I suppose, and i've made a few functions in C that can be implemented into the source code of Sendmail/mail.local, so that any... (2 Replies)
Discussion started by: CGrusden19
2 Replies
Login or Register to Ask a Question