LinuxQuestions.org
Visit Jeremy's Blog.
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 10-23-2015, 06:18 AM   #1
rolty
LQ Newbie
 
Registered: Oct 2011
Location: Herefordshire
Distribution: Centos
Posts: 3

Rep: Reputation: Disabled
changing Sendmail from address (apache) to other depending on the virtual host


I have a server with many virtual domains.
Several of these have forms and alert emails which are sent via php and sendmail.
Currently these all have headers of the form:

Code:
Return-Path: <apache@xxx.com>
Received: from xxx.com (localhost.localdomain [127.0.0.1])
	by xxx.com (8.14.4/8.14.4) with ESMTP id t9NAHgLJ031067
	for <mail@blah.co.uk>; Fri, 23 Oct 2015 11:17:42 +0100
Received: (from apache@localhost)
	by xxx.com (8.14.4/8.14.4/Submit) id t9NAHgES031066;
This is causing a lot of problems with spam classification and blocks.
Ive tried adding relevant domains to the trusted domains list, and using php with the -f feature , eg

PHP Code:
mail("jim@blah.co.uk""Rolty's Form"$message$headers"-fmail@blah.co.uk"); 
This has no effect..
Ive also looked into using the generics table, but as the actual sender of the email is always apache, it looks like I could only rewrite that to one other address, is that correct?

Several hours on google has me going round in circles, can anyone point the way?

Thanks!
 
Old 10-23-2015, 11:50 AM   #2
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
If you were using Postfix, "virtual-alias-maps" might do the trick.
 
Old 10-24-2015, 05:45 AM   #3
rolty
LQ Newbie
 
Registered: Oct 2011
Location: Herefordshire
Distribution: Centos
Posts: 3

Original Poster
Rep: Reputation: Disabled
Sadly I'm not using Postfix, and it's not very likely that this situation will change.. Anyone have an idea for sendmail?
 
Old 10-24-2015, 10:23 AM   #4
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
Postfix has its own sendmail compatible interface - you probably won't know the difference.
Depending on your distro, if Postfix is installed it will install the sendmail interface too.

 
Old 10-25-2015, 02:14 PM   #5
rolty
LQ Newbie
 
Registered: Oct 2011
Location: Herefordshire
Distribution: Centos
Posts: 3

Original Poster
Rep: Reputation: Disabled
OK I will look into this... the mail server is live with over 100 active users so I will have to be very careful not to interrupt anyones service, its a shame there doesnt seem to be another way to do this!, will report back when Ive done some study, thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Changing my site's domain - need to set up an Apache virtual host for 301 redirects Pyplate Linux - Networking 3 07-15-2013 04:57 AM
Sendmail with TLS support is changing FROM: address tsst Linux - Server 0 06-05-2012 02:38 AM
Sendmail:Changing 'From' address in maillogs shree24985 Linux - Server 1 06-07-2010 04:50 PM
Any way to tunnel apache virtual host to an internal apache? ciuly Linux - Server 5 01-31-2010 12:53 PM
Changing sendmail source address looseCannon AIX 4 06-30-2005 07:13 AM

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

All times are GMT -5. The time now is 08:15 PM.

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