reklama

Postfix všechno doručuje do jednoho mailboxu

postfix

Postfix všechno doručuje do jednoho mailboxu
« kdy: 12. 07. 2018, 22:36:22 »
Ahoj, prosim o radu. Rozbehavam postfix a som sa sekol. Postfix vsetky maili dorucuje do jedneho mailboxu, ktory sa vola "1". To znamena, ze ked poslem testovaci mail, povedzme z gmailu na mail test@domena.tld a test1@domena.tld, tak maili pridu, ale obydva sa ulozia do jeneho mailboxu "/var/mail/1". Nie do separatnych mailboxov test a test1. Inak prijimanie a odosielanie mailov funguje bez problemov. V logu mail.log nic uzitocne okrem zaznamu o prijati mailu nie je... Pozivam virtualnych user, domeny, aliasy (MySQL). Jedna sa cisto o postfix, ziadny imap server nemam. prikladam konfiguraciu postfixu:

Kód: [Vybrat]
## TLS parameters
##
smtpd_tls_security_leve = may
smtp_tls_security_level = may
smtpd_tls_received_header = yes
smtpd_tls_auth_only = no
smtpd_log_level = 1
smtpd_tls_cert_file=/etc/ssl/letsencrypt/$domena/fullchain.pem
smtpd_tls_key_file=/etc/ssl/letsencrypt/$domena/privkey.pem
smtpd_use_tls = yes
smtpd_tls_note_starttls_offer = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_protocols = !SSLv2, !SSLv3
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
##
##END Config
###

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = smtp.domena.tld
mydomain = domena.tld
myorigin = domena.tld
mydestination = localhost
virtual_mailbox_domains = mysql:/etc/postfix/virtual-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/virtual-users.cf
virtual_alias_maps = mysql:/etc/postfix/virtual-aliases.cf
mydestination = localhost
relayhost = mail.upcmail.sk
mynetworks = 127.0.0.0/8, [::ffff:127.0.0.0]/104, [::1]/128, 192.168.1.0/24,
queue_directory = /var/spool/postfix
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/mail
« Poslední změna: 12. 07. 2018, 23:18:42 od Petr Krčmář »

reklama


Re:Postfix všechno doručuje do jednoho mailboxu
« Odpověď #1 kdy: 13. 07. 2018, 08:14:46 »
tipuju na problem v mysql
co je v konfiguracich

/etc/postfix/virtual-domains.cf
/etc/postfix/virtual-users.cf
/etc/postfix/virtual-aliases.cf

postfix

Re:Postfix všechno doručuje do jednoho mailboxu
« Odpověď #2 kdy: 13. 07. 2018, 09:11:28 »
/etc/postfix/virtual/domains.cf
Kód: [Vybrat]
user = postfix
password = postfixpass
hosts = 192.168.1.111
port = 3306
dbname = servermail
query = SELECT 1 FROM virtual_domains WHERE name='%s'

/etc/postfix/virtual-users.cf
Kód: [Vybrat]
user = postfix
password = postfixpass
hosts = 192.168.1.111
port = 3306
dbname = servermail
query = SELECT 1 from virtual_users WHERE email='%s'

/etc/postfix/virtual-aliases.cf
Kód: [Vybrat]
user = postfix
password = postfixpass
hosts = 192.168.1.111
port = 3306
dbname = servermail
query = SELECT destination FROM virtual_aliases WHERE source='%s'


Kód: [Vybrat]
mysql> select * from virtual_users;
+----+-----------+------------------------------------------------------------------------------------------------------------+-------------------------+
| id | domain_id     | password                                                     | email                                                               |
+----+-----------+------------------------------------------------------------------------------------------------------------+-------------------------+
|  1 |         1          | $6$08ce39f120eZ3lE4fTE9e33nGfoy2yov1 | test1@domena.tld                                              |
|  2 |         1          | $6$2fa8dc2174fb1156$xoEAnNS9L51K7v/ | test@domena.tld                                                |
+----+-----------+------------------------------------------------------------------------------------------------------------+-------------------------+
2 rows in set (0.00 sec)

mysql> select * from virtual_domains;
+----+-----------------+
| id | name                |
+----+-----------------+
|  1 | domena.tld        |
|  2 | mail.domena.tld |
+----+-----------------+

Re:Postfix všechno doručuje do jednoho mailboxu
« Odpověď #3 kdy: 13. 07. 2018, 10:15:53 »
problem mate v tom SELECT 1
je potreba upravit tu query aby vracela to co chcete. SELECT 1 vrati vzdy jenom tu jednicku a proto to cpe do mailboxu "1"

Lol Phirae

Re:Postfix všechno doručuje do jednoho mailboxu
« Odpověď #4 kdy: 13. 07. 2018, 16:37:04 »
 :D
 ;D ;D
 :) :) :)
 :D :D
 ;D


 

reklama