Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 26th April 2007, 13:11
Reptile Reptile is offline
Member
 
Join Date: Apr 2007
Posts: 62
Thanks: 6
Thanked 1 Time in 1 Post
Default stop users receiving mail with no domain

Using, Debian 4 and Postfix.

I have set up virtual domains which is working nicely, however, I have been receiving spam because people have been sending email to generic names like reptile@atmydomain.com when the email is not set up in the /etc/postfix/virtual/addresses file.

because the user reptile exists the mail is sent to this inbox. how do i stop mail going to this inbox and only going to the inbox of the mail specified in the virtual addresses list?

I am aware I could obviously change my login to something less generic or send that specific email to a catch account but i'd rather have it rejected.
Reply With Quote
Sponsored Links
  #2  
Old 26th April 2007, 13:25
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,034
Thanks: 265
Thanked 152 Times in 132 Posts
Default

I'm not sure how I stopped this on my server, but it was something I added to main.cf in /etc/postfix

I think it was one of the following lines:
Code:
unknown_address_reject_code = 554
unknown_local_recipient_reject_code = 554
unknown_virtual_alias_reject_code = 554
unknown_virtual_mailbox_reject_code = 554
Make sure you restart postfix after adding the lines.
Code:
/etc/init.d/postfix restart
__________________
Never execute code written on a Friday or a Monday.
Reply With Quote
  #3  
Old 26th April 2007, 13:32
Reptile Reptile is offline
Member
 
Join Date: Apr 2007
Posts: 62
Thanks: 6
Thanked 1 Time in 1 Post
Default

nah , that didn't work
Reply With Quote
  #4  
Old 27th April 2007, 14:30
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

What's in your /etc/postfix/main.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 27th April 2007, 14:49
Reptile Reptile is offline
Member
 
Join Date: Apr 2007
Posts: 62
Thanks: 6
Thanked 1 Time in 1 Post
Default

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

append_dot_mydomain = no

smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

myhostname = server.xxxx.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

mydomain = $myhostname
myorigin = $mydomain
mydestination = $myhostname, /etc/postfix/virtual/domains, localhost, localhost.$mydomain
virtual_maps = hash:/etc/postfix/virtual/addresses
virtual_transport = virtual
local_transport = local
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
#smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_error_sleep_time = 2
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/
unknown_address_reject_code = 554
unknown_local_recipient_reject_code = 554
unknown_virtual_alias_reject_code = 554
unknown_virtual_mailbox_reject_code = 554
Reply With Quote
  #6  
Old 28th April 2007, 18:55
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

What's in /etc/postfix/virtual/addresses and /etc/postfix/virtual/domains?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 30th April 2007, 09:04
Reptile Reptile is offline
Member
 
Join Date: Apr 2007
Posts: 62
Thanks: 6
Thanked 1 Time in 1 Post
Default

in the domains file is just a domain name like

www.xxxxx.com

and in the the addresses file

user1@xxxxx.com reptile
user2@xxxxx.com another_user

thats all.
Reply With Quote
  #8  
Old 1st May 2007, 20:15
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by Reptile
in the domains file is just a domain name like

www.xxxxx.com

and in the the addresses file

user1@xxxxx.com reptile
user2@xxxxx.com another_user

thats all.
If you want to send emails to user1@xxxxx.com, you should have xxxxx.com in the domains file, not www.xxxxx.com.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 2nd May 2007, 08:30
Reptile Reptile is offline
Member
 
Join Date: Apr 2007
Posts: 62
Thanks: 6
Thanked 1 Time in 1 Post
Default

i think we are off the point now. The problem is not that the users are not receiving email, the problem is that a user created with the useradd command will receive email when there is no matching domain name if the name before the @ is the same.

i.e. i only want users setup in the virtual/addresses file to receive email on those specific addresses.

Please refer to the original post for the original question.

For reference, I didn't have www. in the domain file, that was a mistake i made when typing it out.
Reply With Quote
  #10  
Old 2nd May 2007, 12:12
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,034
Thanks: 265
Thanked 152 Times in 132 Posts
 
Default

Try adding the following to your main.cf
Code:
local_recipient_maps = $alias_maps
and see if this does the trick. (make sure you restart postfix)
__________________
Never execute code written on a Friday or a Monday.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not receiving any incoming mail. Jcorrea920 General 11 3rd April 2010 13:08
Virtual Users And Domains With Postfix, Courier And MySQL Radukn HOWTO-Related Questions 14 12th October 2008 17:10
Postfix reject connections gabrix Server Operation 27 25th January 2007 08:37
Junk mail and spamassassin... sthompson Installation/Configuration 4 27th December 2006 16:11
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 12:16


All times are GMT +2. The time now is 06:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.