I am using Posfix with virtual mailboxes. Dovecot hosts these mailboxes and 
Posfix delivers mails via the LMTP delivery agent to Dovecot.

I am looking for an option to temporarily pause delivery via LMTP and defer 
mail while the Dovecot mailboxes are being backed-up in order to get an 
consistent state. After the backup has been completed, I want to re-enable mail 
delivery.

Delivery via the LMTP delivery agent shall be paused independently from how the 
mail got into Postfix. This means, even if a mail has been picked up locally 
(from sendmail) and the mail's destination is a virtual mailbox, the mail shall 
be deferred. At the same time, mails which are supposed to be sent off the 
machine shall still be delivered via the SMTP delivery agent normally.

What is the best way to configure that behavior?

In the following, I'll present my approach as far as I got.

According to my understanding of the Postfix architecture the correct place to 
do that is after the incoming queue. (Most solutions from the Internet tinker 
with the configuration of the SMTPD, but this does not suit my objectives.) I 
assume that the better solution is to use the `transport_maps` and to override 
the LMTP delivery agent with the ERROR delivery agent for the virtual mailbox 
delivery.

My current configuration is

```
virtual_mailbox_domains = my-domain.de
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap/virtual-mailboxes.cf
virtual_alias_maps = proxy:ldap:/etc/postfix/ldap/virtual-aliases.cf
```

I am planning to use 

```
transport_maps = hash:/etc/postfix/transport
```

with `/etc/postfix/transport` something like

```
my-domain error:4.2.1 Mailbox read-only, not accepting messages
```

At the beginning of the backup process, the backup program would write the line 
into `/etc/postfix/transport` and remove that line after the backup has been 
completed.

Is that approach possible? Better ideas?

Specific questions:

 - I would like to encode the status code 4.2.1 acc. to RFC 3463 Sec. 3.3 into 
the error response. Is the shown syntax of `/etc/postfix/transport` correct?
 - Which Postfix daemon uses `transport_maps` and how fast does the daemon 
pick-up changes to the map? Do I need a `postfix reload` or is `postmap 
/etc/postfix/transport` enough?
 - Does Postfix keep the mails in it own deferred queue and delivers the 
deferred mail later or does Postfix bounce the mail back to the original sender?

Bests and thank you for any help in advance, Matthias

-- 
Matthias Nagel
Dachtlerstr. 2, 40499 Stuttgart
Festnetz: +49-711-25295180, Mobil: +49-151-15998774
E-Mail: matthias.h.na...@posteo.de, Skype: nagmat84, Threema: 86VM8KN7


_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to