Results 1 to 10 of 11
Hi,
I set up a mail server behind NAT router using dyndns. All necessary ports have been forwarded.
Sending mails from my network using the servers IP as SMTP Server ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-09-2011 #1Just Joined!
- Join Date
- Jun 2011
- Posts
- 3
Postfix and sending Mail from "outside" of my LAN doenst work
Hi,
I set up a mail server behind NAT router using dyndns. All necessary ports have been forwarded.
Sending mails from my network using the servers IP as SMTP Server 192.168.16.11 works fine and mail will be send out. But how can I send mails from the outside over my dyndnsserver?
In main.cf "mynetworks" I define, what belongs to me and from whom the server should accept SMTP tasks. I set "mynetworks = all" without any luck.
See my /etc/postfix/main.cf below
I hope somebody knows what I am doing wrongCode:# See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h readme_directory = no # TLS parameters smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = server alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = server, localhost.localdomain, localhost relayhost = localhost mynetworks = 127.0.0.0/8, 192.168.16.0/24 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = 127.0.0.1, 192.168.16.11 inet_protocols = ipv4 sender_dependent_relayhost_maps = hash:/etc/postfix/relaymap smtp_sender_dependent_authentication = yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/passes smtp_sasl_security_options = noanonymous mailbox_transport = lmtp:unix:/var/run/cyrus/socket/lmtp
- 06-10-2011 #2
I'm a sendmail guy, so I'll leave remarks on your postfix config to others. But what happens if you
telnet dyndnsname 25
from outside? Substituting your actual DNS name, of course. And does anything get logged on the server?
- 06-10-2011 #3Just Joined!
- Join Date
- Apr 2007
- Posts
- 1
Hi Thomas,
You will have to set relayhost = IP address of your DYnDNS,
So it will relay all the mails thru it and your mail won't get in spam of receivers mailbox.
Thanks
Meghraj
- 06-10-2011 #4Just Joined!
- Join Date
- Jun 2011
- Posts
- 3
telnet myadress.dyndns.org 25 works and opens
so does telnet 192.168.16.11 25. Loggin is on in /var/log/mail.log. All mail being send over servers IP 192.168.16.11 are logged here, but no error is logged when trying do send over dyndns.Code:220 Server ESMTP Postfix <Ubuntu>
@meghraj
I would be glad if my mails would end in users spam folder. At the moment I can not even send them there
I cant set the IP adress of dyndns to "relayhost = " because is is dynamic. Changes every day.
- 06-10-2011 #5
Do you have an mx record setup for your mail server and is it working correctly?
- 06-10-2011 #6Just Joined!
- Join Date
- Feb 2006
- Posts
- 5
I was trying to help you by posting link to a blog and then my config file, but linuxquestions says I can't post URLs before making 15 posts. I am not posting URLs I was posting references to help you... well I use dnsexit and not dyndns to update A record for my dynamic IP. Other than that you will need to set up SMTP AUTH if you want to relay mail from anywhere in the world. Alternatively, you can use certs.
- 06-10-2011 #7Just Joined!
- Join Date
- Jun 2011
- Posts
- 3
Dont have an mx record and no doamin for my mailserver set. Will look into SMTP AUTH next week. I am on vacation for some days now - thanks for you help so far.
- 06-11-2011 #8
thomas1977,
"mynetworks = 127.0.0.0/8, 192.168.16.0/24" will keep all systems except localhost and your local 192.168.16.0/24 subnet from relaying mail through your setup. You will need to add an entry for any other networks or hosts you want to allow. If you are adding one host, then the addition will be the IP of the host you want to add with "/32" at the end. For instance...
mynetworks = 127.0.0.0/8, 192.168.16.0/24, 1.1.1.1/32
By the way, great job for choosing Postfix. I love it!
N++
- 06-11-2011 #9
You are going to need an MX record in order for internet mail to reach your domain.
- 06-11-2011 #10


Reply With Quote

