LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2014, 11:33 AM   #1
ludiegu
LQ Newbie
 
Registered: Dec 2013
Posts: 3

Rep: Reputation: Disabled
Postfix access filtering doesn't work


I have installed Postfix, I can send mails between local users as expected, but I would try to limit the access of a particular user to the server. I edited the /etc/postfix/access file in this way:

Code:
diego@example.com REJECT
where example.com is $mydomain. I did also a
Code:
postmap access
to generate the validate file. Strangely, I can still send mail from the diego account using mutt. Here the maillog:

Code:
Jan 22 15:46:36 server postfix/pickup[6637]: 62117BF647: uid=500 from=<diego>
Jan 22 15:46:36 server postfix/cleanup[6737]: 62117BF647: message-id=<20140122144636.GA6732@server.example.com>
Jan 22 15:46:36 server postfix/qmgr[6638]: 62117BF647: from=<diego@example.com>, size=422, nrcpt=1 (queue active)
Jan 22 15:46:36 server postfix/local[6739]: 62117BF647: to=<localuser@server.example.com>, relay=local, delay=0.07, delays=0.06/0.02/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jan 22 15:46:36 server postfix/qmgr[6638]: 62117BF647: removed
What am I missing?
Thanks!
 
Old 01-22-2014, 05:20 PM   #2
psycroptic
Member
 
Registered: Aug 2011
Location: USA
Distribution: ArchLinux - 3.0 kernel
Posts: 349

Rep: Reputation: Disabled
dumb question, but did you restart the postfix server after you postmap'd?

also, did you add the following to the smtpd_sender_restrictions =

Code:
 check_sender_access hash:/etc/postfix/access
?

Last edited by psycroptic; 01-22-2014 at 05:38 PM.
 
1 members found this post helpful.
Old 01-23-2014, 03:02 AM   #3
ludiegu
LQ Newbie
 
Registered: Dec 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by psycroptic View Post
dumb question [cut]
Thanks for your reply. Here the full log

Code:
[root@server ~]# service postfix stop
Shutting down postfix:                                     [  OK  ]
[root@server ~]# tail /etc/postfix/access
#                                                                      
diego@example.com REJECT
[root@server ~]# postmap /etc/postfix/access
[root@server ~]# ls -larth /etc/postfix/
total 192K
-rw-r--r--.   1 root root  13K May 12  2011 virtual
-rw-r--r--.   1 root root  13K May 12  2011 transport
-rw-r--r--.   1 root root 6.7K May 12  2011 relocated
-rw-r--r--.   1 root root 5.0K May 12  2011 master.cf
-rw-r--r--.   1 root root  18K May 12  2011 header_checks
-rw-r--r--.   1 root root 9.7K May 12  2011 generic
-rw-r--r--.   1 root root  27K Jan 22 11:56 main.cf.bck
-rw-r--r--.   1 root root  12K Jan 22 12:11 canonical
drwxr-xr-x. 117 root root  12K Jan 23 11:41 ..
-rw-r--r--.   1 root root  20K Jan 23 11:42 access
-rw-r--r--.   1 root root  27K Jan 23 11:43 main.cf
drwxr-xr-x.   2 root root 4.0K Jan 23 11:43 .
-rw-r--r--.   1 root root  12K Jan 23 11:47 access.db
[root@server ~]# tail /etc/postfix/main.cf
#
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes

smtpd_recipient_restrictions = 
  check_sender_access hash:/etc/postfix/access
[root@server ~]# service postfix start
Starting postfix:                                          [  OK  ]
I try then to log in as the diego user, I use mutt to send a mail to another local user, and the mail is delivered...

Code:
Jan 23 11:49:31 server postfix/pickup[2243]: 552DEBF63C: uid=500 from=<diego>
Jan 23 11:49:31 server postfix/cleanup[2279]: 552DEBF63C: message-id=<20140123104931.GA2274@server.example.com>
Jan 23 11:49:31 server postfix/qmgr[2244]: 552DEBF63C: from=<diego@example.com>, size=422, nrcpt=1 (queue active)
Jan 23 11:49:31 server postfix/local[2281]: 552DEBF63C: to=<localuser@server.example.com>, relay=local, delay=0.09, delays=0.06/0.02/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Jan 23 11:49:31 server postfix/qmgr[2244]: 552DEBF63C: removed
I have no clue
 
Old 01-23-2014, 12:10 PM   #4
ludiegu
LQ Newbie
 
Registered: Dec 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
I will reply myself. I was using mutt as a client to test the configuration, which seems to not use the local smtp at all. While I tried to use thunderbird, the configuration indeed worked! So I have to config the main.cf like these:

Code:
smtpd_sender_restrictions =
 check_sender_access hash:/etc/postfix/access
and in the access file I have to put

Code:
diego@ REJECT
Thanks to psycroptic!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Postfix: Greylisting in smtpd_recipient_restrictions doesn't work hokascha Linux - Networking 2 06-22-2011 02:28 PM
postfix 'auth login' using saslauthd set up doesn't work. lxvor Linux - Software 1 09-10-2010 03:48 PM
I cant access my other XP drive in openSUSE 11.0, I tries mount but it doesn't work moi3333y Linux - Newbie 7 06-24-2009 08:19 AM
smtp postfix and PAM+mysql doesn't work Enrikoala Linux - Software 2 02-17-2009 02:57 AM
Xauth doesn't work at runlevel 5, and everyone can access my X server Berkut83 Red Hat 2 04-19-2006 05:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:50 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