Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
01-22-2014, 11:33 AM
|
#1
|
LQ Newbie
Registered: Dec 2013
Posts: 3
Rep:
|
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 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!
|
|
|
01-22-2014, 05:20 PM
|
#2
|
Member
Registered: Aug 2011
Location: USA
Distribution: ArchLinux - 3.0 kernel
Posts: 349
Rep:
|
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.
|
01-23-2014, 03:02 AM
|
#3
|
LQ Newbie
Registered: Dec 2013
Posts: 3
Original Poster
Rep:
|
Quote:
Originally Posted by psycroptic
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
|
|
|
01-23-2014, 12:10 PM
|
#4
|
LQ Newbie
Registered: Dec 2013
Posts: 3
Original Poster
Rep:
|
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
Thanks to psycroptic!
|
|
|
All times are GMT -5. The time now is 05:50 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|