LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   User management in postfix (https://www.linuxquestions.org/questions/fedora-35/user-management-in-postfix-510038/)

clpl1980 12-13-2006 09:16 AM

User management in postfix
 
Dear Sirs,

I have a server with Fedora Core 5 installed and Postfix as MTA.
In the system I have regular "human" users and some "virtual" users (the ones created by the system, for instance clamav, amavis, cups).
I have a problem:
when someone sends mail to "virtual" users, I can see it stored in the user's file inside /var/mail.
I receive mail for uucp@myserver.com and mail@myserver.com which are not regular "human" users.

I want not to receive mail for "virual" (system) users: how can I tell postfix not to deliver these messages?

Thank you for your help!

Berhanie 12-14-2006 01:24 AM

You can create a file called recipient_access (the name doesn't matter) containing:
Code:

uucp@    REJECT
mail@    REJECT

Then, postmap it:
Code:

postmap /etc/postfix/recipient_access
And, finally, in main.cf:
Code:

smtpd_recipient_restriction =
  permit_mynetworks
  check_recipient_access hash:/etc/postfix/recipient_access
  reject_unauth_destination

This will still allow anyone in $mynetworks to send mail to those addresses. If you don't want even that, put
check_recipient_access above permit_mynetworks.

clpl1980 12-14-2006 08:07 AM

Thank you, that worked great!

But is there a way not to specify each single virtual user?

I mean: how can I tell postfix to deliver mail ONLY to human users? (the users created by the system administrator)

Thanx again!

Berhanie 12-14-2006 06:17 PM

Unless you're using something like ldap or an sql database, there's no way to eliminate those users besides listing all the ones you want or all the ones you don't want. When querying ldap/sql postfix uses custom queries, which could check, for example, only against those users whose uid is greater than 100. This makes for an elegant way to exclude system users such as uucp from being valid recipients. But, by default, postfix only does a simple check against the passwd and alias databases (see postconf(5) under local_recipient_maps).

clpl1980 12-15-2006 02:31 AM

Perfect.

I told Postfix to refer only to aliases and for user names I inserted a recursive alias, for example:

user: user

to deliver mail to user@myserver.com

Thank you very much


All times are GMT -5. The time now is 03:32 PM.