[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to keep virtual domain name on outgoing sendmail

Posted on 2013-11-29
6
Medium Priority
?
316 Views
Last Modified: 2014-03-14
I have a host with multiple domain names: thishost.com, thathost.com. My sendmail.mc file has:

MASQUERADE_AS(`thishost.com')
FEATURE(`masquerade_envelope')
FEATURE(`masquerade_entire_domain')

I originally had this setting before adding thathost.com, mainly to prevent the hostname from showing up in the From:  address. e.g. myuser@thishost.com instead of myuser@server.thishost.com.  However, when I added thathost.com to /etc/mail/local-host-names and the line

thisuser@thathost.com          thisuser

to the /etc/virtusertable, I cannot send mail addressed from users on thathost.com. The domain always gets changed to thishost.com. E.g. a message sent by thatuser@thathost.com gets sent as From: thatuser@thishost.com.

I suspect the way to fix this is to remove the MASQUERADE_AS directives in sendmail.mc, but I'd like some confirmation from a expert before I start experimenting.
0
Comment
Question by:jmarkfoley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 19

Expert Comment

by:xterm
ID: 39685936
How are you sending the mail?  You should be able to set the return-path with the -f flag to sendmail, and configure any From address you want.
0
 
LVL 80

Expert Comment

by:arnold
ID: 39686196
This only affects emails sent from the shell?  Look at configuring the email client settings to use a
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 39686374
xterm: > You should be able to set the return-path with the -f flag to sendmail, and configure any From address you want.

My email client is mailx 12.4. The option to do what you are describing is -r which sets the From address. That used to work just fine to set whatever address I wanted as the Reply-To:. Since setting /etc/virtusertable and /etc/local-host-names it will set the username part of the address, but always overrides what I specify as the domain. mailx also let's me specifically set From:, Reply-To: and Sender: The domains on all of these settings get overridden.

Arnold:  > Look at configuring the email client settings

Did that, and have had those set and working for years. With mailx you use the -A <account> parameter which looks up e.g.

account mercurey {
    set from="myuser@thathost.com (Mark Foley)"
    set hostname=thathost.com
    set ORGANIZATION="Mercurey Technologies SA, Limited"
}

in the $HOME/,mailrc file. Again, this has always worked until I set the virtusertable and local-host-names.

So, I don't think this is something I can fix from the mail client. I could remove the settings in virtusertable and/or local-host-names, but then this host won't be able to receive mail for thathost.com.

I could remove the MASQUERADE directive in sendmail.mc, but then I'll have the machine name attached to the domain name in the messages.

I'm sure I have some sendmail configuration wrong. Computers host email for multiple domains all the time. I've just never set this up before.

I'm in a quandary!
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 80

Assisted Solution

by:arnold
arnold earned 1000 total points
ID: 39686387
I think there are two masquerade, one that masks the name of the server which seems to be what you are looking to do. the other deals with masquerading the sender which seems to be what you have configured.
i.e. user@domain will be converted to user@anotherdomain

not sure why/what the issue you have not reflecting the true name of the server?

the other deals with when the sender is identified as username only, the mydomain will be appended to it.


I prefer other mail server to sendmail.
The following covers the different variations and options.
http://www.sendmail.com/sm/open_source/docs/m4/masquerading.html
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 39698604
I've tried two things, both of which appear to have worked:

1) I removed all MASQUERADE directives in sendmail.mc and put in $HOME/.mailrc e.g.

account thatDomain {
    set from="user@thathost.com (My Name)"
    set hostname=thathost.com
    set ORGANIZATION="Mercurey Technologies SA, Limited"
}

for each account I want to use. The "set from" seems to do the trick. I don't see that the "set hostname" does much.

2) I kept MASQUERADE_AS in sendmail.mc, removed FEATURE(`masquerade_envelope')
(not sure why I had that one set in the first place) and FEATURE(`masquerade_entire_domain'). I then added MASQUERADE_EXCEPTION(`thathost.com')

Both of these seem to work. Probably method 1 is more desirable because I'd have to set a MASQUERADE_EXCEPTION for each domain hosted.

I suppose if I multi-home a dozen different domains I'll have to have the appropriate "set from" in each user's .mailrc file.

Is this the normal way multi-homed hosts set up their email users? Seems highly dependent on the mail client used.
0
 
LVL 13

Accepted Solution

by:
Sandy earned 1000 total points
ID: 39876165
yes, method 1 is suggested one.. Not exactly highly dependent on the mail client  used but it requires basic headers value to be filled.

TY/SA
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question