hoopycat wrote:
Hmmm... something like this would probably do it, assuming users' mail is stored in /home/blah/Maildir and you want to only send to users with mailboxes (vs. every user in /etc/passwd):
Every user gets a maildir by default, hence the skel

hoopycat wrote:
Code:
for i in `find /home/*/mail -maxdepth 0 | cut -d'/' -f3`; do
/usr/sbin/sendmail -bm -f "mailer-daemon@`hostname -f`" "$i"
done
You can then probably deliver to it with:
Code:
blah |/path/to/that/file
in your /etc/aliases or whereever. A very half-baked solution so far (and untested), but the overall goal is to make it automatic.
I'm looking at the man page for postfix's sendmail. The '-f' option has me confused. It sets the sender envelope and is where errors are sent to. From my understanding, it replaces the sender information and tells postfix where to send errors?
man sendmail wrote:
-f sender
Set the envelope sender address. This is the address where delivery problems are sent to. With Postfix versions before 2.1, the Errors-To: message header overrides the error return address.
I also don't understand the second code block. I'm guessing the for loop will build a list of users with maildirs then produce a file containing those users, then I'd need to use that file to copy the email being sent to my global email address (e.g.
team@mydomain.com)?
Azathoth wrote:
Procmail?
Possible to do when Postfix already uses Procmail to handle maildir delivery? (postfix seems to default to mbox unless I explicitly set the mailbox_command to push email to procmail for maildir delivery, even though I have home_mailbox set to the correct directory name (e.g. "home_mailbox = mail/"))