1824484 Members
11542 Online
109671 Solutions
New Discussion юеВ

Sendmail config problem

 
Nicolas_17
Frequent Advisor

Sendmail config problem

Hey boys and girls,

I have a little trouble configuring sendmail like i want it. From this machine, i would like to be able to send mails to any user/machine/domain.

Presently, i can send mail to local users:
# mailx -s 'testing' nicolas < message

I can also send mail to users on other *nix machines in my lan, in the same domain or not:
# mailx -s 'testing' nicolas@host.otherdomain.lan < message

What i cannot do, is send mail to an outside email account that goes through our exchange server:
# mailx -s 'testing' nicolas@outside.com < message

I'm not too sure which parameter fixes this. If I configure SMART_HOST as our exchange server, then I can't send any mail to any user accounts on *nix machines because exchange doesn't know these users/machines. So how do I tell sendmail to discriminate in function of the domain name?

I thought I had it with the /etc/mail/access file by tweaking it to RELAY only the domains inside our lan; then I tried the mailertable to specify the outside.com messages should be routed to our exchange server. No luck.
I attached my sendmail.mc, along with access and mailertable files.

Thanks.
10 REPLIES 10
Ivan Ferreira
Honored Contributor

Re: Sendmail config problem

When you configure a SMART_HOST, only mail that cannot be directly delivered should go to this host, so, it seems that you have a DNS problem.

The /etc/mail/local-host-names should contain the domain/s name/s for the domains that you want to accept mail, and the DNS should resolve the MX resource record properly to the host.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Vipulinux
Respected Contributor

Re: Sendmail config problem

Hi

Try using the sendmail command instead of mail command:
sendmail -f vaildname@yourdomain.com touser@userdomain.com < yourmessege.txt

Cheers
Vipul
Bejoy C Alias
Respected Contributor

Re: Sendmail config problem

For ur local domains u put an entry in the mailertable to route those mails to that particular domains and set the smart_host to ur exchange server . This will deliver the mails in ur local domains to the local server or to the other *nix machines using the mailertable , all the mails which are not included in these two will be forwarded to the exchange server . Ur exchange server should be configured to accept relaying from ur local linux mail server . There is no need to edit access file .
Be Always Joy ......
Nicolas_17
Frequent Advisor

Re: Sendmail config problem

Ok, i set the SMART_HOST parameter to our exchanger server and I can send out mail.
But now, I can't send anything to other *nix systems.

Ivan, looks like you were right about a DNS issue. That's fixed now.

"The /etc/mail/local-host-names should contain the domain/s name/s for the domains that you want to accept mail"

So I put in local-host-names the domain name from which this server can receive, or to which it can send, or both?

Bejoy, how do I set the mailertable if I have 5 or 6 *nix systems in the same domain?

Thanks again guys, for your very appreciated help.
Nicolas_17
Frequent Advisor

Re: Sendmail config problem

Ok, i got it!

I'm going to leave to thread open a little longer though, cause i know i'm bound to have problems as soon as i start tackling procmail...in about 15 minutes...

;-)
Bejoy C Alias
Respected Contributor

Re: Sendmail config problem

For setting the mailertable , suppose u have 3 unix machines abc.unix.com , bcd.unix.com , cde.unix.com . If ur email addersses for these domains are with their full domain names ( like test@abc.unix.com , hi@bcd.unix.com etc. ) then u can simply put
abc.unix.comsmtp:abc.unix.com
bcd.unix.comsmtp:bcd.unix.com
cde.unix.comsmtp:cde.unix.com
in ur mailertable where means u should press the tab key in ur kbd. If ur email's domain is common ( like unix.com ) , then u need to modify ur aliase database to reflect their corresponding domains ( like
testtest@abc.unix.com
hihi@bcd.unix.com )
Be Always Joy ......
Nicolas_17
Frequent Advisor

Re: Sendmail config problem

Thx Bejoy, i got that working now...

I'm having trouble creating the procmail recipes that I want though.

I want to filter everything destined for nicolas@abc.unix.com to a folder, say /home/nicolas.

So i have this recipe:

:0:
* ^TOnicolas@abc.unix.com
/home/nicolas/

That doesn't work though. Any ideas?
Bejoy C Alias
Respected Contributor

Re: Sendmail config problem

I dont have much idea about procmail , but in sendmail u can simply add the file name to the alias file to redirect or append the mails destined for a specific user like this
test@abc.unix.com:actual@test.com, /file-name
This will append a copy to the specified filename , if u remove the actual alias, it will only append to the file
Be Always Joy ......
Stuart Browne
Honored Contributor

Re: Sendmail config problem

I think you want:

:0
* ^To:.*nicolas@abc.unix.com
/home/nicolas/foldername
One long-haired git at your service...
Nicolas_17
Frequent Advisor

Re: Sendmail config problem

Thanks guys,I got everything I wanted working, and sorry for leaving the post open for so long.