Good morning.  I am trying to configure Postfix to behave in a certain way, and 
after a couple of days of not being successful, here I am.

The use-case I am configuring for is:
*       the host's name and domain are not internet-resolvable 
("labbox.localdomain", literally true)
*       Postfix should only accept email from the local system (easily and 
already done)
*       Postfix should accept, but log & drop email destined for a specific 
list of (internal, internet-invalid) domains (transport_maps, "localdomain 
DISCARD").
*       In general, Postfix on the host is more-or-less a simple relay - it 
accepts email from local applications and forwards everything to a central, 
smarter relay.  The host is not intended to receive email at all.

The one that's annoying me: 
*       Intent: Postfix should reject any mail submitted where the "From" is: 
either "not blacklisted" or "is whitelisted".  Basically I want to force my 
users to configure their apps so that they send mail with something other than 
the OS default "username@labbox.localdomain".  I don't mind using either a 
blacklist approach (just list "localdomain"), or a whitelist approach (list 
their individual "From" addresses).
+       If I try to send mail from a shell, for example: # echo "test" | mail 
-s "test" my.addr...@realdomain.com should be rejected since the From is going 
to take the OS default of "root@labbox.localdomain"

I've tried a variety of things in Postfix, so far no luck.

My current line of thought is using smtpd_sender_restrictions, but still 
haven't made that work the way I want it.
> (blacklist method)
> main.cf:
>       smtpd_sender_restrictions = check_sender_access 
> hash:/etc/postfix/sender_access, permit
>
> sender_access:
>       localdomain     REJECT
>       .localdomain    REJECT

It seems simple enough but it still lets my test emails go through and they 
show up in my inbox as "From root@labbox.localdomain"

I've tinkered around with most of the other options for 
smtpd_sender_restrictions, but I'm defeated at this point.


Thanks in advance,
Jeremy Collins, CGI

Reply via email to