Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Each time someone in my LAN sents a mail via postfix, postfix checks if theres a responsible local user. IF NOT, the mail is forwarded to an external smtp. (atm I get Unknown User: ...)
What exactly do you want to happen? If the mail is NOT sent from a known local user, or from a known alias, then you want the mail dropped, or simply sent from the 'unknown' user (such as a Spam sender would want)?
It should be sent from 'unknown' user to external mail server. The people in my LAN are trusted anyway and the local mail server is not open for external usage.
You'll wanna look at the 'mynetworks' parameter, and specify the subnet (or class or other as noted in the main.cf) you want to allow mail from, this should be outlined in your main.cf but here's the exerpt to note:
Quote:
# By default, Postfix relays mail
# - from "trusted" clients (IP address matches $mynetworks) to any destination,
# - from "untrusted" clients to destinations that match $relay_domains or
# subdomains thereof, except addresses with sender-specified routing.
# The default relay_domains value is $mydestination.
Which pertains to:
Quote:
# TRUST AND RELAY CONTROL
# The mynetworks parameter specifies the list of "trusted" SMTP
# clients that have more privileges than "strangers".
#
# In particular, "trusted" SMTP clients are allowed to relay mail
# through Postfix. See the smtpd_recipient_restrictions parameter
# in file sample-smtpd.cf.
#
# You can specify the list of "trusted" network addresses by hand
# or you can let Postfix do it for you (which is the default).
#
# By default (mynetworks_style = subnet), Postfix "trusts" SMTP
# clients in the same IP subnetworks as the local machine.
# On Linux, this does works correctly only with interfaces specified
# with the "ifconfig" command.
# Specify "mynetworks_style = class" when Postfix should "trust" SMTP
# clients in the same IP class A/B/C networks as the local machine.
# Don't do this with a dialup site - it would cause Postfix to "trust"
# your entire provider's network. Instead, specify an explicit
# mynetworks list by hand, as described below.
#
# Specify "mynetworks_style = host" when Postfix should "trust"
# only the local machine.
#
#mynetworks_style = class
#mynetworks_style = subnet
#mynetworks_style = host
# Alternatively, you can specify the mynetworks list by hand, in
# which case Postfix ignores the mynetworks_style setting.
#
# Specify an explicit list of network/netmask patterns, where the
# mask specifies the number of bits in the network part of a host
# address.
#
This User doesn't exit locally, right. But because of that I want this mail to be forwarded to external mail server, on which this user actually _exists_
It should be like: If <domain> is trusted and User doesn't exist locally, sent mail to external mail server. I DON'T GET IT!
If you've defined mynetworks it will override mynetworks_style. Either way, be sure to restart postfix after making changes to the main.cf:
postfix reload
After that you **should** be able to relay, the above error shouldn't exist on **outgoing** email.
Just read over the FAQ and documentation, and I still think this is true, however, can you post up your full /etc/postfix/main.cf so we can see what's setup? If you feel it necessary, go ahead and use "example.net" instead of your actual domain where all references exist.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.