Log from Sendmail and PHP
If I leave my default sendmail options set in php.ini it works fine and sends an email. However if I change the sendmail path to:
sendmail_path = "sendmail -t -i -x /var/log/mail.log"
mail() returns false.
If I run:
ls -l /var/mail/mail.log
I get:
-rwxrw-rw- 1 www-data www-data 0 Sep 17 14:49 /var/mail/mail.log
Which I believe is correct. All I want sendmail to do is log my emails but for some reason it really really doesn't want to play ball!
Just for clarity - this isn't the mail.log parameter which logs the PHP interactions with the script. The output when this is set is something like this:
[17-Sep-2016 15:38:20 Europe/London] mail() on [/home/server/www/dev1/htdocs/mail.php:15]: To: TO -- Headers: MIME-Version: 1.0 From: ME
php sendmail
add a comment |
If I leave my default sendmail options set in php.ini it works fine and sends an email. However if I change the sendmail path to:
sendmail_path = "sendmail -t -i -x /var/log/mail.log"
mail() returns false.
If I run:
ls -l /var/mail/mail.log
I get:
-rwxrw-rw- 1 www-data www-data 0 Sep 17 14:49 /var/mail/mail.log
Which I believe is correct. All I want sendmail to do is log my emails but for some reason it really really doesn't want to play ball!
Just for clarity - this isn't the mail.log parameter which logs the PHP interactions with the script. The output when this is set is something like this:
[17-Sep-2016 15:38:20 Europe/London] mail() on [/home/server/www/dev1/htdocs/mail.php:15]: To: TO -- Headers: MIME-Version: 1.0 From: ME
php sendmail
add a comment |
If I leave my default sendmail options set in php.ini it works fine and sends an email. However if I change the sendmail path to:
sendmail_path = "sendmail -t -i -x /var/log/mail.log"
mail() returns false.
If I run:
ls -l /var/mail/mail.log
I get:
-rwxrw-rw- 1 www-data www-data 0 Sep 17 14:49 /var/mail/mail.log
Which I believe is correct. All I want sendmail to do is log my emails but for some reason it really really doesn't want to play ball!
Just for clarity - this isn't the mail.log parameter which logs the PHP interactions with the script. The output when this is set is something like this:
[17-Sep-2016 15:38:20 Europe/London] mail() on [/home/server/www/dev1/htdocs/mail.php:15]: To: TO -- Headers: MIME-Version: 1.0 From: ME
php sendmail
If I leave my default sendmail options set in php.ini it works fine and sends an email. However if I change the sendmail path to:
sendmail_path = "sendmail -t -i -x /var/log/mail.log"
mail() returns false.
If I run:
ls -l /var/mail/mail.log
I get:
-rwxrw-rw- 1 www-data www-data 0 Sep 17 14:49 /var/mail/mail.log
Which I believe is correct. All I want sendmail to do is log my emails but for some reason it really really doesn't want to play ball!
Just for clarity - this isn't the mail.log parameter which logs the PHP interactions with the script. The output when this is set is something like this:
[17-Sep-2016 15:38:20 Europe/London] mail() on [/home/server/www/dev1/htdocs/mail.php:15]: To: TO -- Headers: MIME-Version: 1.0 From: ME
php sendmail
php sendmail
edited Sep 17 '16 at 14:40
Antony
asked Sep 17 '16 at 13:59
AntonyAntony
11927
11927
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The problem in this instance was that I was using -x and not -X. Once I did the capital it worked fine!
Apparently this should be the accepted answer.
– pa4080
Jan 21 at 8:15
add a comment |
If you use PHP version 5.3.0 or newer then correct answer will be to use mail.log directive in configuration like said in manual.
I believe this is the PHP log not the mail log itself.
– Antony
Sep 17 '16 at 14:10
And I believe your sendmail -t -i command just deliver mail to local mailer daemon which already log all that related to mail delivery. Try to look in /var/log/mail.log or something - maybe you already have all logs you need.
– Igor Shipenkov
Sep 17 '16 at 14:20
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f826127%2flog-from-sendmail-and-php%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The problem in this instance was that I was using -x and not -X. Once I did the capital it worked fine!
Apparently this should be the accepted answer.
– pa4080
Jan 21 at 8:15
add a comment |
The problem in this instance was that I was using -x and not -X. Once I did the capital it worked fine!
Apparently this should be the accepted answer.
– pa4080
Jan 21 at 8:15
add a comment |
The problem in this instance was that I was using -x and not -X. Once I did the capital it worked fine!
The problem in this instance was that I was using -x and not -X. Once I did the capital it worked fine!
answered Sep 17 '16 at 15:24
AntonyAntony
11927
11927
Apparently this should be the accepted answer.
– pa4080
Jan 21 at 8:15
add a comment |
Apparently this should be the accepted answer.
– pa4080
Jan 21 at 8:15
Apparently this should be the accepted answer.
– pa4080
Jan 21 at 8:15
Apparently this should be the accepted answer.
– pa4080
Jan 21 at 8:15
add a comment |
If you use PHP version 5.3.0 or newer then correct answer will be to use mail.log directive in configuration like said in manual.
I believe this is the PHP log not the mail log itself.
– Antony
Sep 17 '16 at 14:10
And I believe your sendmail -t -i command just deliver mail to local mailer daemon which already log all that related to mail delivery. Try to look in /var/log/mail.log or something - maybe you already have all logs you need.
– Igor Shipenkov
Sep 17 '16 at 14:20
add a comment |
If you use PHP version 5.3.0 or newer then correct answer will be to use mail.log directive in configuration like said in manual.
I believe this is the PHP log not the mail log itself.
– Antony
Sep 17 '16 at 14:10
And I believe your sendmail -t -i command just deliver mail to local mailer daemon which already log all that related to mail delivery. Try to look in /var/log/mail.log or something - maybe you already have all logs you need.
– Igor Shipenkov
Sep 17 '16 at 14:20
add a comment |
If you use PHP version 5.3.0 or newer then correct answer will be to use mail.log directive in configuration like said in manual.
If you use PHP version 5.3.0 or newer then correct answer will be to use mail.log directive in configuration like said in manual.
answered Sep 17 '16 at 14:04
Igor ShipenkovIgor Shipenkov
613
613
I believe this is the PHP log not the mail log itself.
– Antony
Sep 17 '16 at 14:10
And I believe your sendmail -t -i command just deliver mail to local mailer daemon which already log all that related to mail delivery. Try to look in /var/log/mail.log or something - maybe you already have all logs you need.
– Igor Shipenkov
Sep 17 '16 at 14:20
add a comment |
I believe this is the PHP log not the mail log itself.
– Antony
Sep 17 '16 at 14:10
And I believe your sendmail -t -i command just deliver mail to local mailer daemon which already log all that related to mail delivery. Try to look in /var/log/mail.log or something - maybe you already have all logs you need.
– Igor Shipenkov
Sep 17 '16 at 14:20
I believe this is the PHP log not the mail log itself.
– Antony
Sep 17 '16 at 14:10
I believe this is the PHP log not the mail log itself.
– Antony
Sep 17 '16 at 14:10
And I believe your sendmail -t -i command just deliver mail to local mailer daemon which already log all that related to mail delivery. Try to look in /var/log/mail.log or something - maybe you already have all logs you need.
– Igor Shipenkov
Sep 17 '16 at 14:20
And I believe your sendmail -t -i command just deliver mail to local mailer daemon which already log all that related to mail delivery. Try to look in /var/log/mail.log or something - maybe you already have all logs you need.
– Igor Shipenkov
Sep 17 '16 at 14:20
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f826127%2flog-from-sendmail-and-php%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown