On Sun, 2007-07-08 at 23:48 +0200, Michael Monnerie wrote:
> On Samstag, 7. Juli 2007 Paul Stevens wrote:
> > > That's why I looked into triggers, and found postgreSQL to have
> > > rules: CREATE RULE drop_messages_with_mailbox AS ON DELETE TO
> > > dbmail_messages DO DELETE FROM dbmail_physmessage WHERE id =
> > > OLD.physmessage_id;
> >
> > Evil dude. That's a simple foreign key constraint masking as a rule.
> 
> Nobody should use that rule: I found that rule to have the effect of 
> deleting all new arriving e-mail - it just vanishes, although I am not 
> sure why. It arrives via LMTP, and is not in your mailbox. But that 
> rule should only fire on DELETE, so there must be a delete somewhere in 
> the path when a new message is inserted, or postgres has a bug, or 
> whatever.

The message is first inserted for the internal delivery user, then a
copy of the messages table entry is made for each recipient (it is this
way that we have some primitive one-physmessage-many-messages support).
When delivery is done, the message is removed from the internal delivery
user's mailbox. That's what activates your rule.

Aaron

_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to