I'll use Mariadb to store alias_map, uid/gid.etc The previous is just a quick test. Thanks.
On Sat, Mar 30, 2019 at 4:35 PM luckydog xf <luckydo...@gmail.com> wrote: > Thanks for your kindly reply. I read the book you recommended carefully > and get answer. > > I paste stuff as below for anyone whoever may run into this problem. > ------------ > ## Tells Postfix to use Dovecot's LMTP instead of its own LDA to save > emails to the local mailboxes. > virtual_transport = lmtp:unix:/usr/var/run/dovecot/lmtp > virtual_mailbox_domains = ad.pthl.hk #* remove $mydomain for > $mydestination* > virtual_mailbox_maps = hash:/etc/postfix/vmailbox > virtual_alias_maps = hash:/etc/postfix/virtual_alias_map > virtual_uid_maps = static:600 > virtual_gid_maps = static:12 > virtual_mailbox_base = /var/mail > it works. > > And this is my personal understanding, virtual delivery agent( refer to as > virtual in postfix docs) unlike Local delivery agent ( Refer to as Local > in postfix doc) does not need user exists in the postfix-running system. So > it relies on virtual_mailbox_map to get user's information and other stuff > to get mail location. > > Besides, postfix could use its own LMTP ,pipe, maildrop to deliver mail to > mailbox, right? > > Thanks a lot, you save me out of it. :), > > > On Sat, Mar 30, 2019 at 2:26 AM Noel Jones <njo...@megan.vbhcs.org> wrote: > >> On 3/29/2019 5:04 AM, luckydog xf wrote: >> > Hi, >> > >> > I'm new to postfix, and I use postfix + dovecot, and I add MX/A/PTR. >> > >> > I use Mariadb as Dovecot passdb and Cyrus SASL Authentication. >> > >> > And I configure email client (MUA) and try to send email to >> > another user in the same domain, it says, >> > >> > "Recipient address rejected: User unknown in local recipient table" >> > >> > I can read literally this user does not exist on this machine. How >> > can I solve this problem? >> > >> > I also read docs of postfix, which is quite difficult for me since >> > I'm new to email field. >> >> Postfix needs to know which domains it should handle, the valid >> users, and what postfix should do with that mail. >> >> It sounds like all your users are stored in dovecot and not unix >> system users. Postfix calls this a virtual mailbox domain. Some >> docs for that can be found here: >> http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox >> >> Other documents can be found here: >> http://www.postfix.org/documentation.html >> >> You'll probably want something like: >> mydestination = localhost (or set this empty) >> virtual_mailbox_domains = {your domain name here} >> virtual_mailbox_maps = {dovecot user database here} >> virtual_transport = {dovecot delivery agent here} >> >> >> You may also find one of the postfix books helpful, "The Book of >> Postfix" by Hildebrandt and Koetter; or "Postfix: The Definitive >> Guide" by Dent. Both are very old and won't cover new features, but >> the basic structure of postfix hasn't changed, and they're still >> useful for an overview of how things work. >> >> >> >> -- Noel Jones >> >