LinuxQuestions.org
Visit Jeremy's Blog.
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 06-01-2014, 08:05 PM   #1
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Rep: Reputation: 16
VirtualHost - which domain is sending email using sendmail?


On a VirtualHost, I can see which domain is sending email when the domain is using php.

However, when a domain is sending using sendmail directly, then there is nothing in the sendmail logs to show which domain is sending.

That being the case, when a spammer finds something interesting, they get away with it for a while because I can't find the sending domain.

Question is, what do I need to do in order to see which domain is sending when it is sending using sendmail?

Thanks.

Last edited by mlewis; 06-01-2014 at 11:42 PM.
 
Old 06-02-2014, 01:25 PM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Domains don't send mail - users do (in your case the webserver user).
You will need to set the from address by some method if you want to differentiate between hosted domains.
 
Old 06-02-2014, 01:48 PM   #3
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
The email is coming from one of the domains, and it is the domain which is sending that I am trying to find when something goes wrong.

I am aware that I need to set 'something' some some 'method' and that is why I posted right
 
Old 06-02-2014, 07:46 PM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
So add "-f senderaddressthatyouwant" or such to the sendmail call.
 
Old 06-02-2014, 10:13 PM   #5
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
If I knew what you were talking about, I would not have posted the question .
That said, I am assuming you mean in the sendmail config but how does that handle all of the domains on a VirtualHost setup?
 
Old 06-02-2014, 10:27 PM   #6
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
No, in the website code (php or whatever you use).

If you just pass a message to /usr/bin/sendmail without specifying a sender it will default to being from user-making-the-call@local-host-name
 
1 members found this post helpful.
Old 06-02-2014, 10:48 PM   #7
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
I don't use any custom code, the sites are all wordpress, joomla and others. As I mentioned, I enabled logging in php so I can see which domain emails are coming from when they are sent using php. What I can't see is which domains email are coming from when the domain is sending using sendmail directly.
 
Old 06-03-2014, 01:39 AM   #8
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Again - emails aren't coming from any domain, they are being sent by your webserver user (www-data or whatever your distro uses), and that is all that sendmail can see, unless you provide it with more info.

If you want to differentiate them you will need to code that into your web submission form to call the sendmail binary with the appropriate sender option.

Last edited by descendant_command; 06-03-2014 at 01:42 AM.
 
Old 06-03-2014, 05:32 AM   #9
rsathishkumarnd
LQ Newbie
 
Registered: Jun 2014
Posts: 1

Rep: Reputation: Disabled
I want to create user account without having primary group?
 
Old 06-03-2014, 09:26 AM   #10
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by rsathishkumarnd View Post
I want to create user account without having primary group?
Go start your own question please. This topic is unrelated.

Thanks.
 
Old 06-03-2014, 09:44 AM   #11
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by descendant_command View Post
Again - emails aren't coming from any domain, they are being sent by your webserver user (www-data or whatever your distro uses), and that is all that sendmail can see, unless you provide it with more info.

If you want to differentiate them you will need to code that into your web submission form to call the sendmail binary with the appropriate sender option.
Ah, I see what you are saying now. I know of masquerading and virtual hosting functions in sendmail 8.10+ but those are for aliasing as far as I can tell. Sendmail would still only see the mail being sent by apache and not from a specific domain.

I understand what you are saying about adding something into the code of each CMS but I can't imagine that is what folks are doing considering how many CMS and addons simply overwrite everything every time there is an update.

I don't care that at the final destination, the emails appear to be coming from anyone domain, I only want to know which domain is sending on the local host when a spammer finds something that wasn't updated, etc.
 
Old 06-03-2014, 01:22 PM   #12
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Yes, fiddling with your MTA config won't achieve anything - you need to investigate the documentation on the mailing functions of the various CMS you run - each will be a bit different, but I think most would have some method to do what you want.
 
Old 06-03-2014, 07:45 PM   #13
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
Ok, thank you for all of the input. I'll get on it.
 
  


Reply

Tags
php, sendmail, smtp, spammer



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
sendmail not sending files to a particular domain Majed17 Linux - Newbie 5 03-21-2013 06:28 AM
Sendmail not sending within local domain GarrettVD Linux - Server 6 04-01-2009 12:16 AM
Gmail Application and Sending Email to Local Domain kelepirci Linux - Server 1 10-07-2008 09:50 AM
Sendmail - not sending email to outside. Blash Linux - Networking 2 05-03-2007 05:09 AM
Sendmail sending as host.domain.com, i want it to be from just domain.com. PlatinumRik Linux - Software 5 10-07-2004 04:32 PM

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

All times are GMT -5. The time now is 06:59 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