Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 01-26-2009, 10:06 PM   #1
LQ Newbie
Registered: Aug 2008
Posts: 10

Rep: Reputation: 1
Postfix Mail server to relay mail for dynamic IP clients

Hi all,
Having a bit of probs configuring postfix to accept/relay mail for my domain when sending through an email client. I can send through mail no problems through my webmail interface. My home network is on a dynamic IP, so i cannot lock the mynetworks to a specific IP. My mail server is located off site. I would like to restrict relay of mail to the sender domain only and also only with authentication. My current config is:

smtpd_banner = $mydoman SMTP $mail_name
biff = no

command_directory = /usr/sbin

myhostname =
mydomain =
myorigin = $mydomain
mynetworks =
relay_domains = hash:/etc/postfix/relay_domains
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
message_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

append_dot_mydomain = yes
masquerade_domains =

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

mydestination = $mydomain,

# Relay Host
relayhost =

empty_address_recipient = MAILER-DAEMON
queue_minfree = 16000000

notify_classes = protocol,resource,software

#enable SMTP auth for relaying
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous

# helo restrictions
smtpd_delay_reject = yes
smtpd_helo_required = yes
#smtpd_helo_restrictions =
# permit_mynetworks,
# permit

smtpd_sender_restrictions =
# reject_unknown_address
check_sender_access hash:/etc/postfix/access
#smtpd_client_restrictions =
# permit_sasl_authenticated
# reject_rbl_client
# reject_unauth_destination
# permit

#smtpd_recipient_restrictions =
# permit

# Uncomment the next line to generate "delayed mail" warnings
delay_warning_time = 4h

# TLS parameters
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# deliver with dovecot
dovecot_destination_recipient_limit = 1
mailbox_transport = dovecot
local_recipient_maps =


and my access file: OK


and my relay domains file OK OK
localhost.localdomain OK
Old 01-27-2009, 09:46 PM   #2
Registered: Dec 2003
Location: Calgary, AB
Distribution: Any!
Posts: 146

Rep: Reputation: 18

It looks like you almost have everything in place. I think the last thing you need to do is enable smtpd_recipient_restrictions to look like this:

smtpd_recipient_restrictions = 
That should be it. The only other issue might be if Dovecot is not configured correctly.

See here for references:

I hope that helps.
Old 01-28-2009, 02:59 AM   #3
LQ Newbie
Registered: Aug 2008
Posts: 10

Original Poster
Rep: Reputation: 1
Yep, that sorted it.. cheers.
Also make sure the email client is set to authenticate with the outgoing server.


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
How to setup Mail Relay server on SUSE Linux ES9 using Postfix 2.1.2 su-se Linux - Newbie 10 09-12-2008 04:54 AM
Postfix reject relay for Squirrelmail/mail clients! tpe Linux - Server 14 06-09-2008 11:07 PM
Postfix as a mail relay (getting relay access denied) hypexr Linux - Software 3 09-13-2005 07:15 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration