sendmail : Relaying Denied

Hi, I'm working with RedHat 6.0 and sendmail 8.9.3, pop3d .

This server "should" work as a mail server for 10
differents domains.
When I try to send a mail from the local network to the Internet, it works
But if another domain try to send a mail to the Internet, it gives the message : Relaying Denied.

I know that with sendmail 8.8.7, we have a file : /etc/mail/ip-allow. And if I add networks number in this file, (and add this line in sendmail.cf :
F{LocalNames} /etc/mail/ip_allow   ) ,this solve the problem. But it doesn't work with snedmail 8.9.3.
I tried to add these line and file, without success.

Any Ideas ?
LVL 1
jacobyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

babblegeek_Commented:
Insert the domains that you wish to relay for into:

/etc/mail/relay-domains

Restart sendmail after modifying this file.

sendmail 8.9.x blocks relaying by default (a good thing) and this file controls the domains that you accept relays for.
j2Commented:
RH does NOT use that file by default. It uses /etc/mail/access and /etc/mail/name-allow

Add the domains in linuxconf ("relay for by name" in sendmail antispam section)
j2Commented:
oh, if you add them manually, dont forget to restart sendmail

/etc/rc.d/init.d/sendmail restart
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

jacobyAuthor Commented:
Thanks for your quicks answers.

Relay-domains was already created, with the correct settings, so this isn't the problem.


access is also in with the following settings:

mydomain.com   RELAY
blablabla      RELAY

but I've no name_allow

I'll add it and let you know.

Thanks, Jacoby.
j2Commented:
do NOT add it maually. Do this trough linuxconf. and make sure that you are using a RH generated sendmail.cf otherwise the RH implementation of sendmail will be "unhappy" ;)
jacobyAuthor Commented:
I added it with linuxconf. and used "original" sendmail provided with RedHat 6.0, but it still doesn't work.

I also have ip_allow file with network numbers.
(the file created by linuxconf was: name_allow, not name-allow)

I'll save my sendmail.cf and try to generate one with linuxconf.
Do u think it should help ?
j2Commented:
the - _ thing was a typo on my part. also if you use /etc/mail/access the ifo must be BOTH in that file and in the apropriate name_allow / ip_allow.

Linuxconf will complain that "this sendmail.cd isnt generated with linuxconf" if it isnt generated with linuxconf. Unless you are getting that message, this isnt the problem.

but AFTER you have added info do a /etc/rc.d/init.d/sendmail restart

This works like a charm in my 6.0 system. And also note that if you use "by domain" you MUST make sure that DNS is correctly configured.
jacobyAuthor Commented:
If I use Linuxconf generated sendmail.cf, sendmail won't start !

j2Commented:
Then you need to figure out WHY. whats the messages in /var/log/messages?

And once again "Is DNS configured correctly?" without it, sendmail wont run properly.
jacobyAuthor Commented:
about DNS, I think it's OK, but How can I be sure?
Everybody can surf and we can browse every sites hosted by this server.
Bind seems to start.

I'll post messages from /var/log/messages.
jacobyAuthor Commented:
about DNS, after a reboot here is /var/log/messages:
gnome server name [759] starting
""      ""     ""    "" name server starting
""      ""     "" [763] starting
""      ""     ""   ""  name server was running on display, exiting.

and also :

named : sent NOTIFY for d2i.fr; 1 NS; 1 A
named : received NOTIFY answer in SOA

But i found nothing about sendmail except for:

sendmail  : shutting down succeeded
(or starting succeded)

j2Commented:
well, you said sendmail doesnt start. and you you say you see "starting succeded"?
jacobyAuthor Commented:
sorry, when i saw that it doesn't start I restore my old sendmail.cf and restart.

if I generate sendmail.cf with linuxconf nd then ask to leave, linuxconf hangs during the activate changes command.
If I kill it, here is the log:
sendmail : sendmail shutdown succeeded.

then, after /etc/rc.d.init.d/sendmail restart :
I have  
shutting down sendmail         [failed]
(no mysteries: sendmail is already stopped)
and it hangs during sendmail start :

so after 3mns, Ctrl C !!  :=)
the log is now :
sendmail : sendmail shutdown failed and nothing else.

then, after a backup of my old sendmail.cf, and a sendmail start

I have :
sendmail : sendmail startup succeeded.

jacobyAuthor Commented:
my files are:

/etc/mail/access :

localhost.localdomain  RELAY
lvl-medical.fr  RELAY
dom.fr   RELAY


/etc/mail/ip_allow

194.8.120.
195.28.


/etc/mail/name_allow

lvl-medical.fr
dom.fr


relay-domains

lvl-medical.fr
dom.fr


/etc/sendmail.cf:

#access list database
Kaccess hash -o /etc/mail/access

#hosts that will permit relaying ($=R)
FR-o /etc/mail/relay-domains

#file containing IP numbers of machines which can use our relay

F{LocalIP} /etc/mail/ip_allow



(this are only parts of /etc/sendmail.cf)


access.db was created manually with:
makemap hash /etc/mail/access < /etc/mail/access


j2Commented:
then i dont know. I just used linuxconf. and it works for me.
j2Commented:
btw

"and it hangs during sendmail start :

so after 3mns, Ctrl C !!  :=) "


usually means DNS problem, it will hang for 2-4 minute per unresolavble domain.
jacobyAuthor Commented:
I tried again with linuxconf and reboot.

sendmail seems to start but in /var/log/maillog I've the following error:

test.test2@d2i.fr  ... cannot alias-non local names.


As I've more than 300 aliases, this may be the cause of this "hang".

How did u setup ur aliases ?
j2Commented:
aliases for what? multidomains? or just the "normal" aliases?
jacobyAuthor Commented:
hummm i don't know.
As I told u, I'm hosted some domains.
for exemple : lvl-medical.fr

and they want their e-mail as
john.smith@lvl-medical.fr

before,i had to add a line such as
john.smith@ lvl-medicla.fr : smith@lvl-medical.fr

but with linuxconf sendmail.cf, it seems to be different (cf maillog report)
jprohartCommented:
Comme vous etes francais, vous pouvez eventuellement utiliser le kit de Jussieu pour creer le fichier sendmail.cf.
Il est dispo sur
       http://www.prism.uvsq.fr/~pda/kit-jussieu/
La configuration en est facile et souple.
Documentation: http://www.prism.uvsq.fr/~pda/kit-jussieu/support/index.html

Salut.
jprohartCommented:
A propos, comment sont heberges les domaines?
Les machines que vous voulez relayer ont-elles un enregistrement DNS valide (A et PTR) ?
Sinon, sendmail ne peut pas resoudre l'adresse de
machine.mydomain.com et donc ne connait pas le domaine de la machine a relayer, et refuse.
Si vous hebergez ces machines, il faut creer une zone pour le domaine et ajouter des enregistrements PTR dans le fichier que je vous ai fait creer, sinon le fichier relay-domains est inutilisable.
jacobyAuthor Commented:
hehe, c'etait ma question de tout a l'heure sur les enregistrement a creer.

En fait, j'ai cree les zones comme suit:
dans /etc/named.conf:

pour lba-sa par exemple:
zone  "lba-sa.fr" {
      type master;
      file "/var/named/lba-sa.fr.hosts";
      };


et donc dans /var/named, il y a le fichier lba-sa.fr.hosts suivant:
lba-sa.fr.      IN      SOA      www.d2i.fr. fjacoby.d2i.fr. (
                  1999121005
                  86400
                  3600
                  604800
                  86400 )
lba-sa.fr.      IN      NS      www.d2i.fr.
www.lba-sa.fr.      IN      A      195.28.198.254
mail.lba-sa.fr.      IN      A      195.28.198.254
lba-sa.fr.      IN      NS      ns1.satelnet.fr.
lba-sa.fr.      IN      MX      10 mail


et dans httpd.conf, j'ai l'enregistrement suivant :
<VirtualHost 195.28.198.254>
      ServerName www.lba-sa.fr
      DocumentRoot /www/htdocs/lba-sa.fr
jprohartCommented:
Le probleme viendrait que sendmail essaye d'envoyer les courriers a serval.d2i.fr, et serval n'existe pas dans le DNS.
jacobyAuthor Commented:
Thanks everybody for your help !!
Please jprohart, answer and I'll grade !!
jprohartCommented:
This is a bad DNS configuration problem.
You have also unwanted records in the access file.
bye

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.