LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 09-09-2003, 07:49 AM   #1
solkan
LQ Newbie
 
Registered: Sep 2003
Posts: 3

Rep: Reputation: 0
Unhappy Postfix Problem (Unknown User)


Hello,

I want to the following to work:

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: ...)

How do achieve this?

Thanks and kind regards, Solkan
 
Old 09-09-2003, 07:20 PM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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)?

Cool
 
Old 09-10-2003, 02:35 AM   #3
solkan
LQ Newbie
 
Registered: Sep 2003
Posts: 3

Original Poster
Rep: Reputation: 0
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.

Main reason is to reduce traffic...
 
Old 09-10-2003, 02:52 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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.
#
HTH

Cool
 
Old 09-12-2003, 05:56 AM   #5
solkan
LQ Newbie
 
Registered: Sep 2003
Posts: 3

Original Poster
Rep: Reputation: 0
I have:

#
#mynetworks_style = class
mynetworks_style = subnet
#mynetworks_style = host

still (mailq):

6D9141DC100 536 Fri Sep 12 12:53:06 root@<hostname>.net
(unknown user: "a.user")
a.user@<hostname>.net

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!

Thanks for all answers!

Solkan

Last edited by solkan; 09-12-2003 at 06:04 AM.
 
Old 09-12-2003, 07:35 PM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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.

Cool
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sendmail problem stat=User unknown singying304 Linux - Networking 1 10-07-2005 06:59 PM
Postfix/Unknown Users ]SK[ Linux - Software 1 07-05-2005 05:24 PM
postfix and php : recipient unknown jodaog Linux - Software 1 03-13-2005 09:25 AM
Problem with Sendmail unknown user relaying (LUSER_RELAY)... A08 Linux - Networking 5 07-04-2003 07:34 AM
Postfix "unknown user" bounce kphinney Linux - Networking 0 06-29-2003 01:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration