Cannot create log file and send emails

Get help from other users here.

Moderators: Developer, Contributor

atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

Now the same question again, hope you understand it now.
Does sending work if you don't use SMTP?
Check settings PHPMAILER_METHOD_MAIL and PHPMAILER_METHOD_SENDMAIL
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post by worker »

atrol wrote:Now the same question again, hope you understand it now.
Does sending work if you don't use SMTP?
Check settings PHPMAILER_METHOD_MAIL and PHPMAILER_METHOD_SENDMAIL

If i run with PHPMAILER_METHOD_SENDMAIL i receive this error:

"Could not execute: /usr/sbin/sendmail"

If i run with PHPMAILER_METHOD_MAIL i receive this:

"Could not instantiate mail function."

:? :? :?
atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

Do you have mail or sendmail installed on your system?
Are you able to start mail or sendmail from command line?
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post by worker »

atrol wrote:Do you have mail or sendmail installed on your system?
Are you able to start mail or sendmail from command line?
Yes, i have installed and configured sendmail.
I can send emails via command line between users.

Edit:

I changed config_inc.php to $g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL and received this error "Could not execute: /usr/sbin/sendmail"

By default sendmail configuration files are located at /etc/mail

How can I change the mantis to point to the folder /etc/mail instead /usr/sbin/sendmail?
atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

What do you wet when entering the following command

Code: Select all

type sendmail
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post by worker »

atrol wrote:What do you wet when entering the following command

Code: Select all

type sendmail
sendmail is /usr/sbin/sendmail
atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

Do you get any errors or warnings in web server log?
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post by worker »

atrol wrote:Do you get any errors or warnings in web server log?
No. It's all right... :(
atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

Any error or warning in mail log?
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post by worker »

atrol wrote:Any error or warning in mail log?
In my maillog i have this

"localhost sendmail[32626]: NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied"

I followed this link: http://stackoverflow.com/questions/1280 ... send-email, I saw the permissions and they are ok.
Only I didn't do the part of SELinux, i don't know what it does and it seems risky. Whenever I change my SELinux, my VM is unbootable.
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post by worker »

Sorry for double post but i solved the problem.
I did this:

Code: Select all

#to see Selinux Booleans

getsebool -a | grep mail
and httpd is not allowed to use sendmail.

Code: Select all

#allow_postfix_local_write_mail_spool --> on
#httpd_can_sendmail --> off
#logging_syslogd_can_sendmail --> off
So I used this command:

Code: Select all

setsebool -P httpd_can_sendmail on 
Tested and i received all the emails.

Thanks for the support, no doubt that was a big help. :P
atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

Thanks for coming back and telling the solution.
Please use Search before posting and read the Manual
Post Reply