Jump to content

Exim from Apache: Failed to create spool file


Recommended Posts

Уважаемые специалисты, на вас надежда!

Опишу свою проблему...

КРАТКО: Не отправляется почта, если exim вызывается через Apache, обрабатывая php скрипт(mailtest.php -- простой <? mail(....) ?>). Отдельно же exim работает и даже если запускать этот mailtest.php просто в консоле "php mailtest.php" то всё сработает превосходно и почта отправится.

ПОДРОБНО:

Apache2 запускает чилдов под пользователем apache.

Exim я не компилировал, а установил из rpm. Из него я понял что группа и пользователь exim:exim

Права на /var/spool

[root@myhost exim]# ls -l

total 24

drwxr-x--- 2 exim exim 4096 Mar 1 11:43 db

drwxr-x--- 20 exim exim 4096 Mar 6 11:58 input

drwxr-x--- 19 exim exim 4096 Mar 6 11:58 msglog

[root@myhost input]# ls -l

total 116

drwxr-x--- 2 exim exim 4096 Mar 1 12:26 1

drwxr-x--- 2 exim exim 4096 Mar 3 04:02 5

drwxr-x--- 2 exim exim 4096 Mar 3 04:53 8

drwxr-x--- 2 exim exim 4096 Mar 1 12:31 a

drwxr-x--- 2 exim exim 4096 Mar 4 04:02 e

drwxr-x--- 2 exim exim 4096 Mar 1 11:43 F

drwxr-x--- 2 exim exim 4096 Mar 4 04:58 g

drwxr-x--- 2 exim exim 4096 Mar 1 11:43 G

drwxr-x--- 2 exim exim 4096 Mar 5 04:02 H

drwxr-x--- 2 exim exim 4096 Mar 6 11:59 J

drwxr-x--- 2 exim exim 4096 Mar 6 04:03 k

drwxr-x--- 2 exim exim 4096 Mar 1 11:44 L

drwxr-x--- 2 exim exim 4096 Mar 6 04:42 Q

drwxr-x--- 2 exim exim 4096 Mar 6 11:59 t

drwxr-x--- 2 exim exim 4096 Mar 2 04:02 T

drwxr-x--- 2 exim exim 4096 Mar 6 11:59 V

drwxr-x--- 2 exim exim 4096 Mar 1 10:58 w

drwxr-x--- 2 exim exim 4096 Mar 1 12:25 Y

1. ЛОГИ

1.1 Apache (var/log/error_log)

2007-03-06 14:53:16 1HOgeq-0003H6-Hm Failed to create spool file /var/spool/exim/input/q/1HOgeq-0003H6-Hm-D: Permission denied

1.2. EXIM

/var/log/exim/exim-panic.log -- пусто

/var/log/exim/exim-main-***.log -- ничего по поводу ошибки не написано (только информация об обработки очереди и заверешнии)

2. КОНФИГИ

2.1 php.ini

[root@myhost exim]# cat /etc/php.ini|grep sendmail

;sendmail_from = root@myhost .ru

sendmail_path = "/usr/sbin/exim -ti"

2.2. exim.conf

[root@dnmarket exim]# cat /etc/exim/exim.conf

############################################################ ##########

# Runtime configuration file for Exim #

############################################################ ##########

############################################################ ##########

# MAIN CONFIGURATION SETTINGS #

############################################################ ##########

primary_hostname = myhost.ru

domainlist local_domains = @ : lsearch;/etc/exim/localdomains

hostlist relay_hosts = lsearch;/etc/exim/relaydomains

hostlist auth_relay_hosts = *

log_selector = -retry_defer -skip_delivery -host_lookup_failed \

+incoming_interface +incoming_port +smtp_confirmation \

+sender_on_delivery +return_path_on_delivery +delivery_size \

+received_recipients +all_parents +address_rewrite \

+tls_certificate_verified +tls_peerdn \

+smtp_protocol_error +smtp_syntax_error \

+deliver_time +queue_time \

-lost_incoming_connection

log_file_path=/var/log/exim/exim-%s-%D.log

allow_domain_literals = false

never_users = daemon:root:bin:sync:named

host_lookup = *

trusted_users = exim

gecos_pattern = ^([^,:]*)

gecos_name = $1

freeze_tell = postmaster

auto_thaw = 1h

ignore_bounce_errors_after = 30m

timeout_frozen_after = 7d

received_header_text = "Received: \

${if def:sender_rcvhost {from ${sender_rcvhost}\n\t}\

{${if def:sender_ident {from ${sender_ident} }}\

${if def:sender_helo_name {(helo=${sender_helo_name})\n\t}}}}\

by ${primary_hostname} \

${if def:received_protocol {with ${received_protocol}}} \

(Exim ${version_number} #${compile_number})\n\t\

id ${message_id}\

${if def:received_for {\n\tfor <$received_for>}}"

system_filter = /etc/exim/system-filter

message_body_visible = 5000

message_size_limit = 10M

smtp_accept_max = 2048

smtp_connect_backlog = 256

queue_only

split_spool_directory

queue_run_max = 1

remote_max_parallel = 1

rfc1413_hosts = *

rfc1413_query_timeout = 0s

smtp_banner = "Welcome on our mail server!\n\

This system does not accept Unsolicited \

Commercial Email\nand will blacklist \

offenders via our spam processor.\nHave a \

nice day!\n\n${primary_hostname} ESMTP Exim \

${version_number} ${tod_full}"

############################################################ ##########

# ACL CONFIGURATION #

# Specifies access control lists for incoming SMTP mail #

############################################################ ##########

acl_not_smtp = acl_check_not_smtp

begin acl

acl_check_not_smtp:

warn

log_message = Called from {$pid} {$value} }

accept

check_recipient:

accept hosts = :

deny local_parts = ^.*[@%!/|]

deny senders = *@dbm;/etc/exim/access.db : \

dbm;/etc/exim/access.db

require verify = sender

deny message = unrouteable address

hosts = !127.0.0.1/8:0.0.0.0/0

!verify = recipient

accept domains = +local_domains

endpass

message = unknown user

verify = recipient

accept hosts = +relay_hosts

accept hosts = +auth_relay_hosts

endpass

message = authentication required

authenticated = *

deny message = relay not permitted

check_message:

accept

############################################################ ##########

# ROUTERS CONFIGURATION #

# Specifies how addresses are handled #

############################################################ ##########

# THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! #

# An address is passed to each router in turn until it is accepted. #

############################################################ ##########

begin routers

dnslookup:

driver = dnslookup

domains = ! +local_domains

transport = remote_smtp

ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8

no_more

system_aliases:

driver = redirect

allow_fail

allow_defer

data = ${lookup{$local_part}lsearch{/etc/exim/aliases}}

user = mail

file_transport = address_file

pipe_transport = address_pipe

userforward:

driver = redirect

check_local_user

file = $home/.forward

no_verify

no_expn

check_ancestor

allow_filter

modemask = 002

file_transport = address_file

pipe_transport = address_pipe

reply_transport = address_reply

localuser:

driver = accept

check_local_user

transport = local_delivery

############################################################ ##########

# TRANSPORTS CONFIGURATION #

############################################################ ##########

# ORDER DOES NOT MATTER #

# Only one appropriate transport is called for each delivery. #

############################################################ ##########

begin transports

remote_smtp:

driver = smtp

local_delivery:

driver = appendfile

file = /var/mail/$local_part

delivery_date_add

envelope_to_add

return_path_add

group = mail

mode = 0600

address_pipe:

driver = pipe

return_output

address_file:

driver = appendfile

delivery_date_add

envelope_to_add

return_path_add

address_reply:

driver = autoreply

############################################################ ##########

# RETRY CONFIGURATION #

############################################################ ##########

begin retry

# Domain Error Retries

# ------ ----- -------

* * F,2h,15m; G,16h,1h,1.5; F,4d,6h

############################################################ ##########

# REWRITE CONFIGURATION #

############################################################ ##########

begin rewrite

############################################################ ##########

# AUTHENTICATION CONFIGURATION #

############################################################ ##########

2.3

[root@dnmarket exim]# cat /etc/exim/localdomains

myhost.ru

2.4

[root@dnmarket exim]# cat /etc/exim/relaydomains

localhost

Link to post
Share on other sites

А апач под каким пользователем запускается? Если стандартный apache, то конечно он не сможет ничего записать в /var/spool/exim, поскольку права на каталоги 750, а значит, писать в них может только пользователь exim. Попробуйте проделать chmod -R 777 /var/spool/exim, если поможет, можно будет подумать о более безопасном решении.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...