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.
I'm running a server with two sites which both need to be able to send emails. Currently I have Postfix set up to send email via Google Apps. This works fine, but Google's servers ignore the From: address I specify and substitute the one I logged in with. Is there a way to make Postfix log into Google Apps with a different username based on what site the email is coming from? The server does not recieve any mail itself; Google recieves it and we have it set to forward it to the appropriate person's real email address. I'm only worried about sending mail.
(Postfix is not a requirement here, so if there's another mailer that can do this better, I'm open to ideas. However, sending email directly from the server isn't an option as it's a residential IP address and blocked by most of the big email providers.)
But it seems PHP doesn't pass -f to sendmail. sendmail seems to ignore that address when deciding how to authenticate, so I get this in my mail.log:
Quote:
Jul 20 10:58:58 farfalle postfix/smtp[9455]: 195A329CD67: to=<myemail@gmail.com>, relay=smtp.gmail.com[209.85.133.111]:587, delay=45, delays=44/0/0.42/0.02, dsn=5.5.1, status=bounced (host smtp.gmail.com[209.85.133.111] said: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://mail.google.com/support/bin/a...y?answer=14257 c37sm1004877ana.2 (in reply to MAIL FROM command))
PHP's mail() function does provide a way to pass it myself, but is there a way to make it ALWAYS use -f based on which site it's serving? I ask because I really don't want to repatch Drupal every time I update it.
But it seems PHP doesn't pass -f to sendmail. sendmail seems to ignore that address when deciding how to authenticate, so I get this in my mail.log:
PHP's mail() function does provide a way to pass it myself, but is there a way to make it ALWAYS use -f based on which site it's serving? I ask because I really don't want to repatch Drupal every time I update it.
well try mail . instead of sendmail ,,
the last time i used Postfix i had to disable sendmail .
service sendmail stop ; chkconfig sendmail off
and you use mail command for postfix . hope this works .
There's a mail.force_extra_parameters paramter in php.ini:
Code:
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
Unfortunately, according to this,
you can't override it in an apache config (e.g. per site).
There's a mail.force_extra_parameters paramter in php.ini:
Code:
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
Unfortunately, according to this,
you can't override it in an apache config (e.g. per site).
I found that too. Didn't think of setting it per site, but if it wouldn't have worked anyway I feel no stupider. :-)
Edit: There's also sendmail_from but it's Windows-only. Where do these arbitrary restrictions come from?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.