On Jul 13, 2021, at 2:15 AM, Matus UHLAR - fantomas <uh...@fantomas.sk> wrote:

>> On Jul 11, 2021, at 1:06 PM, Claus R. Wickinghoff <cl...@mobile.oche.de> 
>> wrote:
>>> I think this can be achieved with  reject_unverified_recipient to query
>>> dovecot via lmtp but I've no practical experience with this.  Probably
>>> you've to do some googling...
> 
> On 12.07.21 10:19, Ron Garret wrote:
>> That turned out to be the Right Answer.  I simply added 
>> reject_unverified_recipient to smtpd_recipient_restrictions and that fixed 
>> the problem.
>> 
>> The chain of events that led to this problem is kind of interesting.  What
>> happened was that I migrated my email server from one machine, where it
>> had been running with no problem for many years, to a new machine at a new
>> provider.  I had simply copied the main.cf file from the old machine to
>> the new one, but changed the delivery mechanism from direct delivery (i.e. 
>> postfix as LDA) to LMTP (i.e.  dovecot as LDA).  So what was happening
>> before (I think) is that postfix was looking up users in the user DB, not
>> because of smtpd_recipient_restrictions (because I didn’t have that set)
>> but because it had to in order to deliver local messages.  When I switched
>> to LMTP that was no longer the case.  Postfix now thought it was possible
>> to deliver to non-existent users, and that’s what resulted in the
>> backscatter.
> 
> it MAY still be possible to set up postfix to read local recipients from
> database dovecot uses.
> Look at local_recipient_maps directive if it's possible, depends on your
> dovecot setup.
> 
> reject_unverified_recipient requires verifying each recipient and keep track
> of them (deliverable or not) which is useful for cases where you can not use
> local_recipient_maps

Yes, it is certainly possible to set up postfix to read local recipients from 
the same DB that dovecot uses.  And in fact that is how I had it set up on my 
previous server.  However, on my previous server I was using MySQL and when I 
switched to the new server I decided to try switching to SQLite3.  That turned 
out to be a very fateful decision because of how SQLite handles simultaneous 
access from multiple processes to the same DB.  It’s a long story, but the 
upshot is that setting up Postfix and Dovecot to use the same DB causes 
intermittent errors which in turn cause Postfix to lose mail, which is Bad.  
That was the problem that originally caused me to move to LMTP in the first 
place.

See this thread:

http://postfix.1071664.n5.nabble.com/What-is-the-right-way-to-update-a-postfix-sqlite-database-td109636.html

If you want the gory details.

rg

Reply via email to