LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-24-2012, 09:37 AM   #1
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Rep: Reputation: 16
Per user domain on outgoing email


I've installed sendmail on centos and have configured it for virtual domains. Incoming mail works as it should but outgoing only goes out as the main domain.

I've searched the net for days and have tried countless things but all of them seem to not end up being what I am after. Most of it ends up being outgoing masquerading so that all email goes out one domain.

Can someone please let me know which options I should be looking at or a doc on the net which shows how I can assign a domain name to users so that when they send mail, the email will show their domain only.

Thanks.
 
Old 01-24-2012, 10:26 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
You don't mention how users are going to be sending mail from your server, are they making use of a mail client? In which case they should be able to specify the mail address in the client, or are they actually logging in by ssh/telnet to the server to send mail?
 
Old 01-24-2012, 10:29 AM   #3
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by TenTenths View Post
You don't mention how users are going to be sending mail from your server, are they making use of a mail client? In which case they should be able to specify the mail address in the client, or are they actually logging in by ssh/telnet to the server to send mail?
I wasn't sure what to mention right off the bat but it's only the server owner who needs to send from multiple domains. Right now, that person is just using webmin/sendmail but might use a mail client later, perhaps with dovecot.
 
Old 01-24-2012, 10:39 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Well on the command line they can use:
Code:
sendmail -fusername@whatever.bla
to set the outbound e-mail address used. If they are going to be doing any volume of mail though they would be much better getting some form of e-mail client sorted and using that instead of webmin/sendmail.
 
Old 01-24-2012, 02:07 PM   #5
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by TenTenths View Post
Well on the command line they can use:
Code:
sendmail -fusername@whatever.bla
to set the outbound e-mail address used. If they are going to be doing any volume of mail though they would be much better getting some form of e-mail client sorted and using that instead of webmin/sendmail.
Ok, so the answer is really the sending client then and not something I need to set in sendmail.
Time to get dovecot working I guess.

Thanks very much for your help.
 
Old 01-24-2012, 02:55 PM   #6
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Cool, I didn't even have to install dovecot. I only installed squirrelmail as a local domain, configured it and it's all good now.
Now when I send email out, the reply address does indeed show the proper name/domain to reply to.

However, that didn't change the primary behavior I was hoping to fix which is that the email is still being shown as coming from the main domain when sending. I need it to show as the actual domain which is sending it.
 
Old 01-24-2012, 04:38 PM   #7
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

I'm sorry it's not directly related to your sendmail, but Postfix address rewriting is doing it (at least I think it does)
maybe sendmail has similar options.

good luck
 
Old 01-24-2012, 05:24 PM   #8
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by lithos View Post
Hi,

I'm sorry it's not directly related to your sendmail, but Postfix address rewriting is doing it (at least I think it does)
maybe sendmail has similar options.

good luck
I don't have postfix installed on this server. Do you mean I need to install this in order to add what is needed?
 
Old 01-25-2012, 02:38 AM   #9
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
No, I don't mean to suggest you to install Postfix instead of sendmail, but to search for an option in Sendmail like postfix has (address rewriting)

I don't know how, and I don't have it done, so I can't suggest you, sorry.
 
Old 01-28-2012, 10:48 AM   #10
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Oh I've spent a lot of time trying to find the answer searching and testing but never did. That's why I posted the question.

Thanks for your help.
 
Old 01-30-2012, 08:09 AM   #11
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by mlewis View Post
Oh I've spent a lot of time trying to find the answer searching and testing but never did. That's why I posted the question.

Thanks for your help.
I am not very sure if I am getting you completely

But have you used this feature of sendmail?
Code:
dnl MASQUERADE_AS(`mydomain.com')dnl
just replace mydomain.com with the domain you want to use and your mails will be received by the client with that domain name

and if this is not what you are looking for then I would like to know in detail for what you want exactly
 
Old 02-06-2012, 01:12 PM   #12
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Receiving is not an issue, it's sending that is.

When sending as a user from a certain domain on the same server, all email contains the headers of the server name itself and not the users domain.

So for example. Say the server's FQDN is mydomain1.com and one of the virtual domains is vdomain1.com.
When a user sends as user@vdomain1.com, the headers show up as follows on the receiving server.

Received: from user@vdomain1.com by (x.x.x.x:25) via mydomain1.com
(x.x.x.x:37089) with [remote.Com SMTP Server] id 1255614756.WH99
for receiver@remote.com; Mon, 6 Feb 2012 11:08:10 -0800
Received: from www.mywebmailgui.net (mydomain1.com [127.0.0.1])

This should fully explain what I am trying to fix
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forward user email to one domain Prime235 Linux - Newbie 2 11-23-2010 07:42 AM
Sendmail block email to particular user on same domain CEdstrom Slackware 4 10-16-2008 11:27 AM
what are the things i need to send/rcv email to internet with user@domain.org? kublador Linux - Newbie 4 06-26-2006 04:12 AM
cant send email (using sendmail) to newly added domain user sirjosi Linux - Newbie 0 10-22-2003 01:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration