VirtualHost - which domain is sending email using sendmail?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.