-   Linux - Server (
-   -   Postfix Mail server to relay mail for dynamic IP clients (

seventy-7 01-26-2009 10:06 PM

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

auximini 01-27-2009 09:46 PM


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.

seventy-7 01-28-2009 02:59 AM

Yep, that sorted it.. cheers.
Also make sure the email client is set to authenticate with the outgoing server.

All times are GMT -5. The time now is 08:21 AM.