[CentOS] postfix and mail origin checks

Wed Jul 29 14:02:11 UTC 2009
RedShift <redshift at pandora.be>

Karanbir Singh wrote:
> On 07/29/2009 01:58 PM, RedShift wrote:
>>> Emails to other destinations should remain unaffected.
> ^^
> 
>> The easiest way is probably to edit master.cf and make smtpd only listen on localhost:25.
> 
> well, no. The machine gets a few thousand other emails from all over the 
> place. Would not want to stop that :)
> 
>  > Otherwise us an access table.
> 
> how ?
> 
> 

Start by setting up recipient classes, like this:


everybody = permit
limited = check_client_access hash:/etc/postfix/tables/limited_client_access

smtpd_restriction_classes = everybody, limited

smtpd_recipient_restrictions = 
 permit_mynetworks
 reject_unauth_destination
 check_recipient_access hash:/etc/postfix/tables/recipient_access


And now for the tables:


recipient_access:
 myprecious at example.net limited
 *                      everybody

limited_client_access:
 1.2.3.4 OK
 *       REJECT


I'm quickly writing this almost all out of my head so it might not be entirely "drop into place".


Glenn