exim4 vs gmail FROM field

389 views Asked by At

I've configured exim on my server as MTA to work with gmail. Here is a configuration:

gmail_login:
       driver = plaintext
       public_name = LOGIN
       client_send = : [email protected] : mypassword

The configuration is OK and I'm able to send a mail using a php script:

$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

if (mail($to, $subject, $message, $headers)) {
  echo 'mail() Success!' . "<br />\n";
}
else {
  echo 'mail() Failure!' . "<br />\n";
}

However I've encountered an issue:

gmail shows [email protected] in the FROM field instead of the actual email specified in the FROM field in my script ([email protected]). The reply-to field is OK.

Please, help to solve the issue.

1

There are 1 answers

0
dave wanta On

Gmail overwrites any FROM value you specify. Gmail overwrites it with the authenticated FROM value.