Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed and configured postfix on our server.

Postfix config file has relay_domain parameter which contains the list of domain names which postfix will support.

Is there a way by which we can support all domain names in postfix without creating relay_domain database list?Edit

share|improve this question
    
That will be creating an Open relay –  topdog Dec 6 '10 at 12:18
    
How can we create open relay ? Please give details .. –  Champion Dec 6 '10 at 12:43
    
with postfix you can't. try sendmail, some older version :) –  sysfault Dec 6 '10 at 13:34
    
We have saas model service hireplug.com for companies social recruitment. We send a lot of emails to them using postfix smtp server. Now every time a recruiter belonging to a company joins , his company domain name has to be added to postfix relay-domain list which is kind of painful . Cron job is one solution which will modify relay-domain list. Is there a better solution, postfix provides out of the box? –  Champion Dec 6 '10 at 14:13
add comment

1 Answer 1

explicitly specifying the domains you want to relay mail for is a security measure against spam and other types of misuse of smtp systems.

if you are only interested in automatically enabling relaying for subdomains, you can set parent_domain_matches_subdomains variable.

postfix doesn't support blind relaying ... at least to some extent. in some scenarios, you may use permit_mx_backup to relay for domains that your mail server is listed as a backup (secondary, higher dns mx rr priority) mx. but do carefully read permit_mx_backup specification and related documents like permit_mx_backup_networks. but this is very dangerous and I already see ways of exploiting it via dns. don't doit.

share|improve this answer
    
We have saas model service hireplug.com for companies social recruitment. We send a lot of emails to them using postfix smtp server. Now every time a recruiter belonging to a company joins , his company domain name has to be added to postfix relay-domain list which is kind of painful . Cron job is one solution which will modify relay-domain list. Is there a better solution, postfix provides out of the box? –  Champion Dec 6 '10 at 14:10
    
you don't need to add a domain to relay_domains table to be able to send emails to users from that domain. to do that, configure smtpd_recipient_restrictions to trust email from authed users and trusted networks. for example: smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_recipient, reject_non_fqdn_sender –  sysfault Dec 6 '10 at 14:39
    
... and configure your $my_networks parameter and sasl authentication mechanisms (if needed) –  sysfault Dec 6 '10 at 14:41
    
Configurations main.cf file. myhostname = srv_name alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = hireplug.com mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_recipient, reject_non_fqdn_sender relayhost = mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all home_mailbox = Maildir/ mailbox_command = –  Champion Dec 7 '10 at 6:14
    
It's sending mail from postfix server using telnet but not forwarding mail when using a email client . Anything missing ? A quick reply will be appreciated ? –  Champion Dec 7 '10 at 6:17
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.