[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

POSTFIX+MYSQL - Será que funciona mesmo?



Pessoal utilizo o DEBIAN SARGE, e estou tentando utilizar COURIE+POSTFIX+MYSQL.

Ja segui todas as receitas de bolo disponíveis sobre o assunto, tanto nacional quanto internacional, fiz algumas alterações, porém nenhuma resolveu os problemas aqui apresentados.

Espero que na comunidade o sucesso seja melhor.



- Quando dou um start no postifix

- Tenho os seguintes resultados no syslog

postfix/postfix-script: stopping the Postfix mail system

postfix/master[28293]: terminating on signal 15

postfix/postfix-script: starting the Postfix mail system

postfix/master[28398]: daemon started -- version 2.1.4

- Ao testar localmente

Telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

220 meuhost.meudominio ESMTP meudominio

- Com o comando anterior tenho o seguinte resultado no syslog

postfix/smtpd[28407]: connect from localhost[127.0.0.1]

- Quanto tento continuar o teste, ao digitar a linha abaixo

mail from: to user

- Obtenho o seguinte resultado no syslog

Oct 30 10:32:52 meu_host postfix/trivial-rewrite[28412]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Oct 30 10:32:52 meu_host postfix/trivial-rewrite[28412]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/ru

n/mysqld/mysqld.sock' (2)

Oct 30 10:32:52 meu_host postfix/trivial-rewrite[28412]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,100): table lookup problem

Oct 30 10:32:53 meu_host postfix/smtpd[28407]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Oct 30 10:32:53 meu_host postfix/smtpd[28407]: warning: problem talking to service rewrite: Success

Oct 30 10:32:53 meu_host postfix/master[28398]: warning: process /usr/lib/postfix/trivial-rewrite pid 28412 exit status 1

Oct 30 10:32:54 meu_host postfix/trivial-rewrite[28413]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/ru

n/mysqld/mysqld.sock' (2)

Oct 30 10:32:54 meu_host postfix/trivial-rewrite[28413]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/ru

n/mysqld/mysqld.sock' (2)

Oct 30 10:32:54 meu_host postfix/trivial-rewrite[28413]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,100): table lookup problem

Oct 30 10:32:55 meu_host postfix/smtpd[28407]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Oct 30 10:32:55 meu_host postfix/smtpd[28407]: warning: problem talking to service rewrite: Success

Oct 30 10:32:55 meu_host postfix/master[28398]: warning: process /usr/lib/postfix/trivial-rewrite pid 28413 exit status 1

Oct 30 10:32:55 meu_host postfix/master[28398]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

Oct 30 10:33:01 meu_host /USR/SBIN/CRON[28415]: (root) CMD (/usr/sbin/tz-brasil)

- No passwd encontrase o usuario user

user:x:1001:1001:,,,:/home/user:/bin/bash

- No arquivos .cf, nos campos user e password, fiz o seguinte teste:

Loguei como o user e password definidos nos arquivos.cf, acessei normalmente o mysql, ou seja, realizo todas as operacoes no banco sem problema algum.

- Porem os testes, como apresentado, mostram que o postfix nao consegue conversar com o MYSQL, alguem, teria alguma sugestao?

- Vejam meus arquivos de configuracao:

#============main.cf

#======== CONFIGURACOES ===============

queue_directory = /var/spool/postfix/

program_directory=/usr/sbin

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

default_privs=nobody

default_transport=smtp

alias_maps=hash:/etc/aliases

alias_database=hash:/etc/aliases

readme_directory = no

sample_directory = /etc/postfix/sample

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

manpage_directory = /usr/share/man

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

smtpd_banner=$myhostname ESMTP $mydomain

disable_vrfy_command=yes

home_mailbox=Maildir/

# ========== NOME DO DOMINIO ===========

myhostname=nome_do_host.meudominio

mydomain=meudominio

myorigin= $mydomain

mydestination= $myhostname, localhost.$mydomain, $mydomain, nome_do_host.$mydomain

###======== MYSQL ==============

virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf

virtual_mailbox_base = /postfix

virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf

virtual_gid_maps = static:108

virtual_gid_maps = static:108

transport_maps = mysql:/etc/postfix/mysql_transport_maps.cf

#======= Quota ============

virtual_mailbox_limit_inbox = no

virtual_mailbox_limit_maps= mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf

virtual_mailbox_limit_override = yes

virtual_maildir_extended = yes

virtual_create_maildirsize = yes

virtual_mailbox_limit = 100000000

virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.

virtual_overquota_bounce = yes

# =======MAILDROP ==========

virtual_transport = maildrop

fallback_transport = /usr/bin/maildrop

maildrop_destination_recipient_limit = 1

unknown_local_recipient_reject_code = 55555

#====================mysql_transport_maps.cf

user=user_do_mysql

password=senha

hosts=localhost

dbname=database_mysql

table=domain

select_field=transport

where_field=domain

#==================mysql_virtual_alias_maps.cf

user=user_do_mysql

passwd=senha

dbname=database_mysql

table=alias

select_field=goto

where_field=address

host=localhost

#==================mysql_virtual_mailbox_maps.cf

user=user_do_mysql

password=senha

dbname=postifx

table=mailbox

select_field=maildir

where_field=username

host=localhost

#==================mysql_virtual_mailbox_limit_maps.cf

user=user_do_mysql

password=senha

dbname=database_mysql

table=mailbox

select_field=quota

where_field=username

hosts=localhost

#====================master.cf

#

# ==========================================================================

# service type  private unpriv  chroot  wakeup  maxproc command + args

#               (yes)   (yes)   (yes)   (never) (100)

# ==========================================================================

smtp      inet  n       -       n       -       -       smtpd

pickup    fifo  n       -       n       60      1       pickup

cleanup   unix  n       -       -       -       0       cleanup

qmgr      fifo  n       -       -       300     1       qmgr

rewrite   unix  -       -       -       -       -       trivial-rewrite

bounce    unix  -       -       -       -       0       bounce

defer     unix  -       -       -       -       0       bounce

trace     unix  -       -       -       -       0       bounce

verify    unix  -       -       -       -       1       verify

flush     unix  n       -       -       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

smtp      unix  -       -       -       -       -       smtp

relay     unix  -       -       -       -       -       smtp

showq     unix  n       -       -       -       -       showq

error     unix  -       -       -       -       -       error

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

#

#

maildrop  unix  -       n       n       -       -       pipe

flags=DRhu user=maildrop argv=/usr/bin/maildrop -w 90 -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 -d -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}




Reply to: