F
F
Fyodor Buzinov2016-04-02 15:16:37
PHP
Fyodor Buzinov, 2016-04-02 15:16:37

Postfix, php-fpm how to properly send mail through Amazon SES?

Hello!
The task is to use Amazon SES to send emails in which the sender is [email protected]
Set up postfix to send emails via Amazon SES.
Everything works if I send from the console:
this is how it goes through Amazon

echo "Hello there" | mail -s "testing" -r [email protected] [email protected]

and so it goes through another smtp server
echo "Hello there" | mail -s "testing" -r [email protected] [email protected]

If I use php, then the letter goes through another smtp server:
mail("[email protected]", "subj", "message text", "From: [email protected]");

added parameter:
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i [email protected]

after that, all letters began to go through amazon, where the sender is [email protected] and [email protected]
For example, I send an email:
mail("[email protected]", "subj", "message text", "From: [email protected]");

In the postfix log, the from field:
postfix/qmgr[22411]: 349EB2BE17F5: from=<[email protected]>, size=21398, nrcpt=1 (queue active)

and ship via amazon.
In the letter itself, the from field.
From: [email protected]
Is it possible to somehow configure the server (postfix or php-fpm), so that when sent from the site, the letters leave as when sent from the console.
The solution with an additional parameter in mail is not suitable. I am using CMS.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question