LINUX.ORG.RU
ФорумAdmin

Отправка почты через доступный мне почтовый сервер с авторизацией на php не работает

 ,


0

1

Добрый день всем! Подскажите в какой строчке конфига postfix искать? Хочу отправить почту через php авторизируясь на доступном мне почтовом сервере, но сервер не пропускает письма. Даже в очередь postfix не попадает



Последнее исправление: pochtaliot (всего исправлений: 4)

Мб в developer все таки? Ну или если очень хочется тут, то логи постфикса, кусочек кода?

З.Ы. А в каком конфиге Вы postfix ищете?

crabssss
()
Ответ на: комментарий от crabssss

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no



# appending .domain is the MUA's job. append_dot_mydomain = no



# Uncomment the next line to generate «delayed mail» warnings # delay_warning_time = 4h



readme_directory = /usr/share/doc/postfix



# smtp_helo_name = $myhostname # TLS parameters smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache



# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. mydestination = имя хоста, localhost, localhost.localdomain
myorigin = /etc/mailname
# byla pelna domana myhostname = имя хоста
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a «$EXTENSION»
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
message_size_limit = 50000000
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_helo_required = yes
# 09-06-2014 unknown_hostname_reject_code = 550
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = «The user you are trying to reach is over quota.»
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
# dla autorespondera wylanczam 10-10-2012 Wlaczone 14-07-2014 # smtpd_sender_login_maps = mysql:/etc/postfix/mysql_virtual_sender_login_maps.cfg smtpd_sasl_auth_enable = yes
smtpd_delay_reject = yes
broken_sasl_auth_clients = yes
strict_rfc821_envelopes = yes
unknown_address_reject_code = 550
disable_vrfy_command = yes



smtpd_soft_error_limit = 3
smtpd_error_sleep_time = 60
smtpd_sasl_authenticated_header = yes
smtpd_client_connection_count_limit = 30
smtpd_client_connection_rate_limit = 10
anvil_rate_time_unit = 60s
smtpd_client_recipient_rate_limit = 60
smtpd_client_message_rate_limit = 60



relay_domains =



smtpd_client_restrictions =
# odrzucamy Chiny, Koree, i kilka innych klas
# reject_rbl_client chikor.rbl.tld,
# check_client_access hash:/etc/postfix/restrict,
reject_unauth_pipelining,
permit



smtpd_helo_restrictions =
reject_unauth_pipelining,
reject_invalid_helo_hostname,
# reject_unknown_helo_hostname, #NEW by denis
check_helo_access hash:/etc/postfix/helo_checks,
check_helo_access pcre:/etc/postfix/helo_checks.pcre,
#reject_unknown_hostname, #new denis
#reject_non_fqdn_hostname, #new denis
permit



smtpd_sender_restrictions =
permit_sasl_authenticated,
reject_unknown_sender_domain,
check_client_access hash:/etc/postfix/restrict,
reject_non_fqdn_sender,
reject_unknown_address,
# 14-07-2014
# reject_sender_login_mismatch,
check_sender_access pcre:/etc/postfix/sender_checks.pcre,
reject_unauth_pipelining,
#reject_non_fqdn_hostname, #new denis
permit



smtpd_recipient_restrictions =
check_client_access hash:/etc/postfix/restrict,
permit_sasl_authenticated,
# 20140714
# hash:/etc/postfix/sender_checks,
reject_unauth_pipelining,
reject_non_fqdn_recipient,
check_client_access hash:/etc/postfix/whitelista,
reject_unknown_recipient_domain,
check_recipient_access pcre:/etc/postfix/recipient_checks.pcre,
# reject spamerom
check_sender_access mysql:/etc/postfix/mysql_blacklist.cf,
permit_mynetworks,
reject_unauth_destination,
check_sender_access hash:/etc/postfix/sender_checks_my,
# permit_mynetworks,

# biała lista
check_helo_access hash:/etc/postfix/helo_checks,
check_helo_access pcre:/etc/postfix/helo_checks.pcre,
check_sender_access pcre:/etc/postfix/sender_checks.pcre,
check_sender_access hash:/etc/postfix/sender_checks_my,
#15-06-14 reject_unknown_helo_hostname,
reject_non_fqdn_helo_hostname,
check_sender_mx_access cidr:/etc/postfix/mx_access.cidr,
check_helo_mx_access cidr:/etc/postfix/mx_access.cidr,
# unknown user od razu?
#reject_unlisted_recipient,
reject_rhsbl_helo revdns.rbl.tld,



# smtpd_relay_restrictions = permit_mynetworks,
# permit_sasl_authenticated,
# reject_unauth_destination

#reject_non_fqdn_hostname,
#reject_non_fqdn_sender,
#reject_unverified_recipient

smtpd_reject_unlisted_sender = yes



smtpd_data_restrictions =
reject_unauth_pipelining,
reject_multi_recipient_bounce,
# dwa wiersze- 14-07-2012
# body_checks = pcre:/etc/postfix/body_checks.pcre,
# header_checks = pcre:/etc/postfix/header_checks.pcre,
permit
hopcount_limit = 40
show_user_unknown_table_name = no
smtpd_recipient_limit = 500
bounce_queue_lifetime = 1d
maximal_queue_lifetime = 1d
unknown_client_reject_code = 550
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
autoresponder_destination_recipient_limit = 1

pochtaliot
() автор топика
Ответ на: комментарий от crabssss

в логах postfix тоже нет информации про авторизацию. Дело в том, что немного раньше все работало. Подозреваю что-то изменили в конфиге

pochtaliot
() автор топика
Ответ на: комментарий от pochtaliot

По правилам форума оформи пост, и кусок php кода показывай, где подключаешься к почте и отправляешь письмо.

crabssss
()
Ответ на: комментарий от pochtaliot

Дело в том, что немного раньше все работало.

если изменений в коде не было, и вы уверены в том, что проблема в постфиксе, выкладывайте сюда конфиги (main.cf и master.cf)

dada ★★★★★
()
Ответ на: комментарий от dada

main.cf:


smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = /usr/share/doc/postfix
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
mydestination = имя хоста, localhost, localhost.localdomain
myorigin = /etc/mailname
myhostname = имя хоста
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
message_size_limit = 50000000
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_helo_required = yes
unknown_hostname_reject_code = 550
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
smtpd_sasl_auth_enable = yes
smtpd_delay_reject = yes
broken_sasl_auth_clients = yes
strict_rfc821_envelopes = yes
unknown_address_reject_code = 550
disable_vrfy_command = yes
smtpd_soft_error_limit = 3
smtpd_error_sleep_time = 60
smtpd_sasl_authenticated_header = yes
smtpd_client_connection_count_limit = 30
smtpd_client_connection_rate_limit = 10
anvil_rate_time_unit = 60s
smtpd_client_recipient_rate_limit = 60
smtpd_client_message_rate_limit = 60
relay_domains = 
smtpd_client_restrictions =
	reject_unauth_pipelining,
	permit
smtpd_helo_restrictions = 
    reject_unauth_pipelining,
    reject_invalid_helo_hostname,
    check_helo_access hash:/etc/postfix/helo_checks,
    check_helo_access pcre:/etc/postfix/helo_checks.pcre,
    permit
smtpd_sender_restrictions = 
    permit_sasl_authenticated,
    reject_unknown_sender_domain,
    check_client_access hash:/etc/postfix/restrict,
    reject_non_fqdn_sender,
    reject_unknown_address,
    check_sender_access pcre:/etc/postfix/sender_checks.pcre,
    reject_unauth_pipelining,
    permit
smtpd_recipient_restrictions = 
    check_client_access hash:/etc/postfix/restrict,
    permit_sasl_authenticated, 
    reject_unauth_pipelining,
    reject_non_fqdn_recipient,
    check_client_access hash:/etc/postfix/whitelista,  
    reject_unknown_recipient_domain,
    check_recipient_access pcre:/etc/postfix/recipient_checks.pcre,
    check_sender_access mysql:/etc/postfix/mysql_blacklist.cf,
    permit_mynetworks, 
    reject_unauth_destination,
    check_sender_access hash:/etc/postfix/sender_checks_my,
    check_helo_access hash:/etc/postfix/helo_checks,
    check_helo_access pcre:/etc/postfix/helo_checks.pcre,
    check_sender_access pcre:/etc/postfix/sender_checks.pcre,
    check_sender_access hash:/etc/postfix/sender_checks_my,
    reject_unknown_helo_hostname,
    reject_non_fqdn_helo_hostname,
    check_sender_mx_access cidr:/etc/postfix/mx_access.cidr,
    check_helo_mx_access cidr:/etc/postfix/mx_access.cidr,
    reject_rhsbl_helo revdns.rbl.tld,
smtpd_reject_unlisted_sender = yes 
smtpd_data_restrictions =
	reject_unauth_pipelining,
	reject_multi_recipient_bounce,
	permit
hopcount_limit = 40
show_user_unknown_table_name = no
smtpd_recipient_limit = 500
bounce_queue_lifetime = 1d
maximal_queue_lifetime = 1d
unknown_client_reject_code = 550
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
autoresponder_destination_recipient_limit = 1

master.cf:

smtp      inet  n       -       -       -       -       smtpd
submission inet n       -       -       -       -       smtpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       3       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
	-o smtp_fallback_relay=
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix	-	n	n	-	2	pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

amavis unix - - - - 2 smtp
        -o smtp_data_done_timeout=1200
        -o smtp_send_xforward_command=yes

127.0.0.1:10025 inet n - - - - smtpd
        -o content_filter=
        -o local_recipient_maps=
        -o relay_recipient_maps=
        -o smtpd_restriction_classes=
        -o smtpd_client_restrictions=
        -o smtpd_helo_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o mynetworks=127.0.0.0/8
        -o strict_rfc821_envelopes=yes
        -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
        -o smtpd_bind_address=127.0.0.1
yaa     unix    -       n       n       -       -       pipe
                                                        user=vmail
                                                        argv=/usr/local/postfix-tools/yaa-0.3.1/bin/yaa.pl

pochtaliot
() автор топика

PHP отправки писем есть на этом же почтовом сервере (HOME), а так же на другом (S2).

Когда пробую выслать с S2 на отличный почтовый сервер от HOME авторизируясь на HOME, то письма доставляются. Если таким же способом высылаю письма на HOME, то нет.

Если высылаю на любой почтовый сервер с HOME, авторизируясь на HOME вообще никуда не идут.

pochtaliot
() автор топика
Ответ на: комментарий от pochtaliot

Ну пока что это похоже на блог, ты пишешь, люди читают, сочувствуют. А помочь никто не может, т.к. данных мало :(

crabssss
()
Ответ на: комментарий от crabssss

Какие еще данные нужны. Вопрос был изначально в том какую настройку нужно смотреть чтобы можно было отправлять письма, авторизируясь средвствами php на том же сервере что и почта, либо на других серверах

pochtaliot
() автор топика
Ответ на: комментарий от targitaj

дело в том что раньше все работало, на php пользуюсь phpmailer

Сейчас в логе postfix при попытке отправить почту через php пишет:

Sep 28 18:04:00 хост logger: sendmail-ext-log: site=, client=, script=, pwd=каталог скрипта, uid=33, user=www-data
pochtaliot
() автор топика
Ответ на: комментарий от pochtaliot

ищи / честно признаться не укажу точно, строку с «гроуппс», и добавить группу и укажи вновь (по аналогии аккаунта игроприставок этого поколения)(?)

anonymous
()
Ответ на: комментарий от pochtaliot

Да блин элементарно строку скрипта, которую я просил 2 раза уже. Нам все возможные варианты перебирать за тебя чтоли?

crabssss
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.