Operating System - Linux
1827477 Members
2080 Online
109965 Solutions
New Discussion

Linux Redhat - sendmail - can't send outside domain due to FROM address

 
SOLVED
Go to solution
Matt Shaffer_1
Regular Advisor

Linux Redhat - sendmail - can't send outside domain due to FROM address

emails are being sent out as user@host.domain.com. This is fine within our domain but when sending outside the domain this address is not recognized. need to figure out how to send as userhost@domain.com or host@wescodist.com
18 REPLIES 18
Rick Garland
Honored Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

In the /etc/mail/sendmail.cf file will be a section in there for masquerading.

Using this masquerade feature will allow you to modify the FROM value.

Rick Garland
Honored Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

This is starting at line 137 in my sendmail.cf file.

I am masquerading everybody sending mail to just 'localdomain'. The 'localhost' line is commented out and will not be in the FROM line.

Remember to recycle sendmail for changes to take effect.
service sendmail restart


# 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{E}root
#C{w}localhost.localdomain
C{w}localdomain
Matt Shaffer_1
Regular Advisor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

that's great! It solves one of my problems. The other thing is that I have 350 branch systems and we are getting emails from the super account on all of them. I can't tell which system the emails are coming from.Is there anyway to adjust this name of the user to superbranchxxxx (ex superB1234) or just B1234?
Rick Garland
Honored Contributor
Solution

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

You can change the localdomain in the C{w} to whatever you like. They can be specific values for specific systems if you like but that sounds like work. (Don't want to do that!)

Maybe setup by location if you have several systems at specific locations?

Matt Shaffer_1
Regular Advisor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

When I make that change the email now comes as super@host.domain.com and that won't work. Any other ideas? thanks
Matt Shaffer_1
Regular Advisor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

I have made no other change to sendmail.cf except commenting out C{w}localhost.localdomain. The email came through as super@localdomain.com once. Now it has reverted back to super@localhost.localdomain.com. The above line is still commented out and no other changes have been made. I restart sendmail and the result is the same. HELP PLEASE
Rick Garland
Honored Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

Looks as if you will want to build a separate sendmail.cf file for each super (or 1 sendmail.cf for all systems if there are super.)

A resource is found on the web site
http://www.sendmail.org

This will describe how to build a sendmail.cf file with the MASQUERADE_AS feature, masquerade the envelops, compile the new sendmail.cf, put it into place and test it.
Here is the site that describes compile for Linux
http://www.sendmail.org/compiling.html#Linux

Here is the site for masquerade issues
http://www.sendmail.org/faq/section3.html#3.16

Rick Garland
Honored Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

In the interim to get over the initial hump, have the 1 domain as listed in C{w}localdomain.

This will remove the host name in the FROM address.

Being that you want different envelopes as well as different domains you will need to create more than 1 sendmail.cf file and put them into their respective locations on the respective systems.

This will be using the m4 compiler to create the new .cf files. In the source file will be FEATURE(MASQUERADE_AS) declaration - as an example.

On the Linux box, look in the /usr/share/sendmail-cf directory. Lots of docs an examples.

NOTE, the sendmail RPMs must be loaded as well.


Matt Shaffer_1
Regular Advisor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

Maybe this will help. I edited the line C{w}localdomain to C{w}wescodist.com. This created /tmp/dead.letter. Here are the contents:
/tmp/dead.letter... Saved message in /tmp/dead.letter

QA12-LX-> more /tmp/dead.letter
From super Thu May 26 13:17:26 2005
Return-Path:
Received: (from super@localhost)
by QA12-LX.wescodist.com (8.12.11/8.12.11/Submit) id j4QHHQP6014833
for mshaffer@wescodist.com; Thu, 26 May 2005 13:17:26 -0400
Date: Thu, 26 May 2005 13:17:26 -0400
From: root
Message-Id: <200505261717.j4QHHQP6014833@QA12-LX.wescodist.com>
To: mshaffer@wescodist.com

\n WESNET Branch System - Release 08.10.00 - C
Rick Garland
Honored Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

One question would be why it went to dead.letter? Also, it doesn't appear that the envelope was changed.
renarios
Trusted Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

Hi Matt,

If you search for 200505261717.j4QHHQP6014833, what does your maillog say?
Please reply.

Cheerio,

Renarios
Nothing is more successfull as failure
Bejoy C Alias
Respected Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

What you exactly want to do. ?
make the mails as coming from super123@yourdomain.com ?
or super@yourdomain123.com ?
First option can de done by masquerading.
Check whether DM macro is set properly..
# sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter

>$M

this should return ur masq.. domain.
Be Always Joy ......
Matt Shaffer_1
Regular Advisor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

I want all emails from super@B1234.domain.com to come as superB1234@domain.com. the first is not recognized as a valid domain name by outside sites. When I run sendmail -bt I get my domain name as a response. All changes that I have tried do not work. I've tried to change masq, I've made changes in sendmail.mc and none of the changes are giving me the results that I want.
Rick Garland
Honored Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

You have the masquerade_domain part. What is needed now is changing the FROM header to rewrite to what you want. This is accomplished using the genericstable.

Check out the following site and look down towards #6. This explains about the genericstable.

http://www.sendmail.org/virtual-hosting.html
Steven E. Protter
Exalted Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

You have almost all the tools you need in this thread to complete the task.

I would look back at the answers and do the following.

Set up entires in virtusertable and genricstable to allow the subdomains to work.

Set up the sendmail.mc file as noted in the virtual host link above to allow for multiple domains.

I'm attaching a script called buildmail. It has some extra steps for building a spam database, which I'm removing because I don't think you need the complication right now.

You will note some commented anti-spam code on the top of the script. It took me months to develop the full version. I might be able to spare some time to help you with installation, but really the script should just run and solve your entire issue.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bejoy C Alias
Respected Contributor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

The best option to this domain rewriting is to include generics support in sendmail.cf . This may not be installed by default . U can install webmin and sendmail-cf rpm , then reconfigure sendmail using webmin , which i think is the easy way than manual editing of sendmail.cf/mc .
Be Always Joy ......
Matt Shaffer_1
Regular Advisor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

thanks everyone. finally got this to work.
Matt Shaffer_1
Regular Advisor

Re: Linux Redhat - sendmail - can't send outside domain due to FROM address

worked with HP to resolve this issue. had to install sendmail-cf rpm. make some changes and additions to sendmail.mc, run make and restart sendmail. emails from super are now coming as hostname@domain.com