LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix Mail server to relay mail for dynamic IP clients (https://www.linuxquestions.org/questions/linux-server-73/postfix-mail-server-to-relay-mail-for-dynamic-ip-clients-700093/)

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 = tokyo.outtalimits.com.au
mydomain = outtalimits.com.au
myorigin = $mydomain
mynetworks = 127.0.0.0/8
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 = outtalimits.com.au

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

mydestination = $mydomain,
$myhostname,
localhost.$mydomain,
localhost

# 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 = outtalimits.com.au
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
reject_rbl_client sbl-xbl.spamhaus.org,
permit
#smtpd_client_restrictions =
# permit_sasl_authenticated
# reject_rbl_client sbl-xbl.spamhaus.org
# 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:

outtalimits.com.au OK

--------------------------------------------------------

and my relay domains file

outtalimits.com.au OK
mail.outtalimits.com.au OK
localhost.localdomain OK

auximini 01-27-2009 09:46 PM

Hi,

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:

Code:

smtpd_recipient_restrictions =
        permit_mynetworks
        permit_sasl_authenticated
        reject_unauth_destination

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

See here for references:
http://www.postfix.org/SASL_README.html
http://adminspotting.net/articles/me...Part-Four.html

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.