Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

MULTIPLE DOMAINS – how block outgoing mail from local domain

Reply to Post Add a New Topic
UserPost

3:50 am
May 10, 2010


dacky

Guest

Hi,

I follow your instruction in http://www.linuxmail.info/mult…..-centos-5/  to create multiple domains in postfixadmin.

It's working OK!

But, I have three public domains and one local domain.

My local domain sends outgoing mail, but can not receive mail from the Internet.

 

How to restrict users from local domain email sent only to the local domain, not on the internet.

 

Thanks

8:57 am
May 17, 2010


consultant

Admin

posts 341

Hi dacky,

 

See the Postfix Restrict Senders or Recipients article.

5:09 am
May 18, 2010


dacky

Guest

dacky said:

Hi,

I follow your instruction in http://www.linuxmail.info/mult…..-centos-5/  to create multiple domains in postfixadmin.

It's working OK!

But, I have three public domains and one local domain.

My local domain sends outgoing mail, but can not receive mail from the Internet.

 

How to restrict users from local domain email sent only to the local domain, not on the internet.

 

Thanks


 Hi Admin

Thanks for the reply.

I've made the settings, but the situation is as follows: my user to the local domain can send email to internet but can not send another user on the local domain.

I am want to set the user from the local domain sends only your domain, without the possibility of sending mail to the public domain on the Internet.

The situation is the opposite of the one I wanted ….

7:15 am
May 18, 2010


consultant

Admin

posts 341

Please double check your settings because that's exactly what I showed as an example.

 

In main.cf

smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access, reject_unauth_destinations smtpd_restriction_classes = local_only local_only = check_recipient_access hash:/etc/postfix/local_domains, reject
The first line says check the sender access, if mail is from acme.local, use the local_only restriction class The second line declares a local_only restriction class The third lines says local_only is set to accept mails to acme.local only, reject all others In sender_access

acme.local local_only
In local_domains

acme.local OK

9:06 am
May 18, 2010


dacky

Guest

Hi, Admin

everything is set according to instructions, but still not working ….

I have three virtual domain, which is administered through PostfixAdmin. My relay domain is the local domain, which is set in the hostname (mail.local.domain)

main.cf configuration is as follows:

smtpd_recipient_restrictions =  permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

when you change this line to:

smtpd_recipient_restrictions =
  check_sender_access hash:/etc/postfix/sender_access,
  reject_unauth_destinations

and add next lines:

smtpd_restriction_classes = local_only

local_only = check_recipient_access hash:/etc/postfix/local_domains, reject

My file local_domains is 

local.domain OK

My file sender_access

local.domain local_only

[root@mail postfix]#ls -lrth

-rw-r–r– 1 root    root      23 May 18 13:43 sender_access
-rw-r–r– 1 root    root      15 May 18 13:44 local_domains
-rw-r–r– 1 root    root     12K May 18 13:44 local_domains.db
-rw-r–r– 1 root    root     12K May 18 13:44 sender_access.db
When everything is set up by your guide, users with local domain can send mail outside your domain, and the user from the public domain can not send or receive mail.

 

 

Help me !!!LaughLaughLaughLaugh

 

9:24 am
May 18, 2010


consultant

Admin

posts 341

Use the line below for your smtpd_recipient_restrictions

smtpd_recipient_restrictions =
    permit_mynetworks,
    check_sender_access hash:/etc/postfix/sender_access,
    permit_sasl_authenticated,
    reject_unauth_destination

8:05 am
May 19, 2010


dacky

Guest

Hi Admin,

I'm all set, but still does not work.

The result is as follows:

The local virtual user still send outgoing e-mails to the public domain on the Internet, but other users with local domain does not receive e-mails from him.

 

Postfix configuration is:

[root@mail postfix]# postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
header_checks = regexp:/etc/postfix/header_checks
home_mailbox = Maildir/
html_directory = /usr/share/doc/postfix-2.5.1-documentation/html
inet_interfaces = all
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 20480000
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks = 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.5.1-documentation/readme
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks,    check_sender_access hash:/etc/postfix/sender_access,    permit_sasl_authenticated,    reject_unauth_destination
smtpd_restriction_classes = local_only
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql-aliases.cf
virtual_gid_maps = static:1000
virtual_mailbox_base = /home/vmail/
virtual_mailbox_domains = mysql:/etc/postfix/mysql-domains.cf
virtual_mailbox_limit_maps = hash:/etc/postfix/vquota
virtual_mailbox_limit_override = yes
virtual_mailbox_maps = mysql:/etc/postfix/mysql-users.cf
virtual_uid_maps = static:1000

 

In this case by test1@local.domain sent the email to test2@local.domain and user@public.domain. users in the public domain is received email, but users on local domain is not.

My log file at the time of sending mail to the following:

 

May 19 13:35:13 mail dovecot: imap-login: Login: user=<test1>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
May 19 13:35:13 mail dovecot: IMAP(test1): Disconnected: Logged out bytes=71/791
May 19 13:35:21 mail MailScanner[1324]: Requeue: C1C7E570344.A49C3 to E78B9570340
May 19 13:35:21 mail MailScanner[1324]: Uninfected: Delivered 1 messages
May 19 13:35:21 mail postfix/qmgr[19977]: E78B9570340: from=<test1@local.domain>, size=798, nrcpt=4 (queue active)
May 19 13:35:21 mail MailScanner[1324]: Deleted 1 messages from processing-database
May 19 13:35:21 mail MailScanner[1324]: MailScanner child dying of old age
0.44, dsn=2.6.0, status=sent (250 2.6.0 <1811.10.29.35.32.1274268900.squirrel@mail.local.domain> Queued mail for delivery)
r domain name not found. Name service error for name=local.domain type=A: Host not found)
=2.0.0, status=sent (250 ok 1274269170 qp 31020)
=sent (delivered to maildir)
May 19 13:35:22 mail postfix/cleanup[21158]: AC312570345: message-id=<20100519113522.AC312570345@mail.local.domain>
May 19 13:35:23 mail postfix/qmgr[19977]: AC312570345: from=<>, size=3116, nrcpt=1 (queue active)
May 19 13:35:23 mail postfix/bounce[21195]: E78B9570340: sender non-delivery notification: AC312570345
May 19 13:35:23 mail postfix/qmgr[19977]: E78B9570340: removed
May 19 13:35:23 mail MailScanner[21192]: MailScanner E-Mail Virus Scanner version 4.79.11 starting…
or domain name not found. Name service error for name=carina.corp type=A: Host not found)
May 19 13:35:23 mail postfix/qmgr[19977]: AC312570345: removed

 

I apologize on the great message !

Thanks
 

 

 

8:27 am
May 19, 2010


dacky

Guest

May 19 14:17:34 mail dovecot: imap-login: Login: user=<test1>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
May 19 14:17:35 mail MailScanner[21192]: Requeue: E2D2A570344.A4692 to 1EA0C570340
May 19 14:17:35 mail MailScanner[21192]: Uninfected: Delivered 1 messages
May 19 14:17:35 mail postfix/qmgr[22280]: 1EA0C570340: from=<test1@local.domain>, size=685, nrcpt=2 (queue active)
May 19 14:17:35 mail MailScanner[21192]: Deleted 1 messages from processing-database
May 19 14:17:35 mail postfix/smtp[22795]: 1EA0C570340: to=<test2@local.domain>, relay=none, delay=1.5, delays=1.4/0.1/0.02/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=carilocal.domain type=A: Host not found)
May 19 14:17:35 mail postfix/smtp[22794]: 1EA0C570340: to=<dacky@public.domain>, relay=smtp2.gov.me[195.66.167.7]:25, delay=2, delays=1.4/0.1/0.06/0.44, dsn=2.6.0, status=sent (250 2.6.0 1233.10.29.35.32.1274271453.squirrel@mail.loca.domain Queued mail for delivery)
May 19 14:17:35 mail postfix/cleanup[22782]: D1016570345: message-id=20100519121735.D1016570345@mail.local.domain

 

CryCryCryCryCryCryCryCry

9:53 am
May 19, 2010


consultant

Admin

posts 341

Please try the command below

postmap -q local.domain hash:/etc/postfix/sender_access

You should get local_only

 

Next try

postmap -q gmail.com hash:/etc/postfix/sender_access

There should be no output

Next, remove permit_mynetworks in smtpd_recipient_restrictions and restart MailScanner.

Now test sending out email. If you are using SquirrelMail to test, note that it is sending mail using mail.local.domain so you have to correct it first.

4:19 am
January 12, 2012


chengli

Guest

 Now test sending out email. If you are using SquirrelMail to test, note that it is sending mail using mail.local.domain so you have to correct it first.

how to correct it ?

7:32 am
January 13, 2012


consultant

Admin

posts 341

You have to configure SquirrelMail first. From that point onwards, new accounts will use the configured domain name. But accounts already existing in SquirrelMail should be corrected manually by the user themselves since it saved the old domain name.

Reply to Post

Reply to Topic:
MULTIPLE DOMAINS – how block outgoing mail from local domain

Guest Name (Required):

Guest Email (Required):

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
5 + 8
   


About the Linux Mail Server Setup and Howto Guide Forum

Forum Timezone: America/New_York

Most Users Ever Online: 60

Currently Online:
13 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 5
Topics: 326
Posts: 1012

Membership:

There are 928 Members
There have been 84 Guests

There is 1 Admin

Top Posters:

shanmugasundaram s – 45
Kendermin – 15
Ginger – 14
bighorn – 14
iron_michael86 – 12
Raminda – 11

Recent New Members: RaHuL, bikesh, pappy_says, geos, boudi7, dara.hr

Administrators: consultant (341 Posts)