2009/4/5 Xn Nooby <xno...@gmail.com>: > I am working on a Webmail solution, that uses Squirrelmail, Postfix, > and Dovecot. I am trying to block email between users, and I don't > seem to be able to do this.
People seem to ask about this specific scenario a bit (want to stop users sending mail to each other), I wonder why. Seems kinda silly to me. Anyway... > I was having trouble blocking emails selectively, so now I just trying > to block all emails - to make sure it is working. > > In my main.cf, I have: > > smtpd_sender_restrictions = > check_sender_access regexp:/etc/postifx/check_sender_access.regexp It's preferred that you show the output of `postconf -n` so everyone can agree on what your server is doing. And you misspelt "postfix" there :) > The check_sender_access.regexp file consists of: > > /./ REJECT > /.*/ REJECT > > > Shouldn't this reject all email that goes through the system? > > My local users can still email eachother. It is as if Postfix is being > bypassed. How does the webmail system inject mail? If it uses the "sendmail" command then you CANNOT reject. sendmail is used by system processes etc., cases when failure is not an option and mail must be accepted. smtpd_mumble_restrictions applies only to mail received by SMTP. Chances are you'll need to modify the webmail software so that it sends mail via SMTP, then maybe you'll be able to reject it as you want to (this will depend on the webmail software setting the right sender address). > Non-local users are being blocked, so I am beginning to wonder if > Postfix is not being used when mail is between local user, perhaps it > is a Dovecot issue? NO. Dovecot does POP and IMAP, these are protocols only for mail retrieval. Use what you already know to formulate hypotheses. > Is there any way to trace how an email moves through Postfix? It would > be great to see what is happening when it encounters the > smtpd_sender_restrictions and smtpd_recipient_restrictions. You could check the logs, it's all there. They'll also tell you how the mail got into the system, which is particularly relevant here.