I set the following in main.cf:

smtpd_relay_restrictions = permit_mynetworks, reject

Which, if I understand correctly, should mean that any email coming from addresses specified in mynetworks will be accepted, while all others get rejected.

Mynetworks in my case only specifies loopback addresses, so my SMTP server will accept email from localhost and reject all others.

If you have different needs you should look into the links sent by Bob earlier in this thread, there's quite a number of possible policies available.

/T

On 2020-10-02 19:55, Ranjan Maitra wrote:
Hi,

Thanks, I am not very knowledgeable with regard to postfix being a simple user, so do you mind letting me/us know what you had to fix? It is kind of forbidding to me.

Thanks again and best wishes,
Ranjan

On Fri, 2 Oct 2020 15:52:34 +0200 Erik Thuning <thun...@dsv.su.se> wrote:

> Thank you! I had this exact issue and just couldn't wrap my head around
> what was wrong, this solved things quite nicely.
>
> /T
>
> On 2020-10-02 00:00, Bob Proulx wrote:
> > Ranjan Maitra wrote:
> > > > > Oct  1 14:08:00 localhost postfix/smtpd[4142479]: fatal: in
> > parameter smtpd_relay_restrictions or smtpd_recipient_restrictions,
> > specify at least one working instance of: reject_unauth_destination,
> > defer_unauth_destination, reject, defer, defer_if_permit or
> > check_relay_domains
> > >
> > > My apologies: how do I do this/what should I do here?
> >
> > Since you haven't shared your postfix configuration but just parts of
> > it in the master.cf then we can only point to the documentation.
> >
> > Start here and read these:
> >
> > http://www.postfix.org/postconf.5.html#smtpd_relay_restrictions
> >
> > http://www.postfix.org/postconf.5.html#smtpd_recipient_restrictions
> >
> > What is the value of these for you?  This will produce some output
> > which shows the current configuration.
> >
> >     postconf smtpd_recipient_restrictions smtpd_relay_restrictions
> >
> > For my use I leave smtpd_relay_restrictions set to the default value
> > and then set smtpd_recipient_restrictions.  That's one valid
> > combination.  But there are others.
> >
> > At the least I would think something like this:
> >
> > smtpd_recipient_restrictions =
> >         permit_mynetworks,
> >         reject_unauth_destination,
> >         reject_invalid_hostname,
> >         reject_non_fqdn_hostname,
> >         reject_non_fqdn_sender,
> >         reject_non_fqdn_recipient,
> >         reject_unknown_sender_domain,
> >         reject_unknown_recipient_domain
> >
> > But in real use I have a much longer list with a lot more there for
> > blocking spam and other things.  You should understand it before using
> > it and adjust it as needed for your environment.
> >
> > Bob
>
--
Important Notice: This mailbox is ignored: e-mails are set to be deleted on receipt. Please respond to the mailing list if appropriate. For those needing to send personal or professional e-mail, please use appropriate addresses.


Reply via email to