Patrick wrote regarding 'Re: [SLE] Locking a mailbox?' on Thu, Jan 20 at 07:26:
* John Andersen
[01-20-05 01:15]: I have several ex-employee accounts that are still getting mail. The data structures in their directories are something we want to keep. so we don't want to delete the accounts.
Is there any way to close a mailbox in Linux so that incoming mail just bounces (user unknown or something?)
add line to /etc/postfix/header_checks: /^To:.*<user-name>@<domain>/ REJECT <optional text reason> then run: postmap /etc/postfix/header_checks rcpostmap restart
Adding extra header checks is slow, since all of the regexps in that file get checked against each line in each header of every message. Better would be to add check_recipient_access to whatever other rules might already be in smtpd_recipient_restrictions (add it first so other rules don't short-circuit it): /etc/postfix/main.cf: smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/oldusers, /etc/postfix/oldusers: user1@ourdomain REJECT <optional reason> user2@ REJECT <another reason> Don't forget to run postmap on /etc/postfix/oldusers each time you change that file. Check out man 5 access for the format of the file - if you have multiple domains that you wanna close the address for, you may well want to use the "user@" syntax for the pattern. Actually, I use "relocated_maps" for this purpose, so I can provide the sender with a forwarding address without forwarding it myself. That's what relocated_maps is for. It works the same way - you'd just "specify relocated_maps = /etc/postfix/oldusers" instead of adding recipient restrictions. It's worth noting that you can delete a user account without deleting their files - though for convenience sake, you may consider changing the file ownership beforehand (and make sure that you don't pass "-r" as an argument to userdel!!). I usually change the ownership to a user named "retired"... --Danny, who seems to have finally gotten list posting to work again :)