Hi all,
i would just like to share with you how i solved the Problem running a
MailServer with a dynamic IP-Adress. I spend a lot of time to figure this
things out, so i hope some of you can use this to save some time.
Problem :
Some MailServer (for example gmx.net) do not accept Mails from Mail Server with a dynamic IP Adresse.
Resoultion in my case :
I made the following entrys in main.cf :
1 Step
*relayhost = mail.myexternalhostingprovider.ch # replace with your external Mail provider
*smtp_sasl_auth_enable = yes
*smtp_sasl_security_options = noanonymous
*smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
2 Step
*create /etc/postfix/sasl_passwd or just add the following informations to the sasl_passwd. :
mail.myexternalhostingprovider.ch emailadres@myexternalhostingprovider.ch:PASSWORD
*launch
postmap /etc/postfix/sasl_passwd
*restart or reload postfix
After this modifications your Mails will be send allways to
mail.myexternalhostingprovider.ch and will be authenticated with your user emailadres@myexternalhostingprovider.ch and your password PASSWORD.
If it works you will find a message like this in your logfiles (/var/log/syslog or /var/log/mail.info) :
Quote: Jun 01 16:31:04 yourhostname postfix/smtp[15931]: 9637D2F805E: to=<my-mother@gmx.ch>, relay=mail.myexternalhostingprovider.ch[*.*.*.*]:25, delay=0.43, delays=0.05/0.01/0.14/0.24, dsn=2.0.0, status=sent (250 2.0.0 m5HEVhvN020286 Message accepted for delivery)
Second Problem :
May the following Problem only exists on my server, because i just crashed a little bit my postfix configuration, but after this modifications i had the Problem that my server didn't accept any Mails. He always tried to find a local User an tryed to deliver the Mails localy and not to my virtiual Mailboxes. The following Error Message appered in the Logfile :
Quote:Jun 17 13:22:37 yourhostname postfix/qmgr[24444]: D79AB2F805C: from=<christian@mycompanyprovider.com>, size=8904, nrcpt=1 (queue active)
Jun 17 13:22:37 yourhostname postfix/local[24449]: D79AB2F805C: to=<christian@yourhostname.ch>, relay=local, delay=6.8, delays=6.8/0/0/0.01, dsn=5.1.1, status=bounced (unknown user: "christian")
or by sending to a viritual domain :
Quote: Jun 17 15:55:44 yourhostname postfix/smtpd[15251]: connect from mail108.mycompanyprovider.ch[*.*.*.*]
Jun 17 15:55:44 yourhostname postfix/smtpd[15251]: NOQUEUE: reject: RCPT from mail108.mycompanyprovider.ch[*.*.*.*]: 554 5.7.1 <viritual-user@viritual-domain.com>: Relay access denied; from=<christian@mycompanyprovider.com> to=<viritual-user@viritual-domain.com> proto=ESMTP helo=<mail108.mycompanyprovider.ch>
after hours of searching trough the internet and reading the postfix handbook, i found a hint that if you enter a relay_host you have to add your domains to the /etc/postfix/domains (or under ispcp /etc/postfix/ispcp/domains).
Resoultion in my case :
*i add my 3 domains into the domains file with the following Syntax :
Quote: mydomain1.com OK
mydomain2.net OK
mydomain3.net OK
*bulding the .db file with
postmap /etc/postfix/ispcp/domains
*restartet postfix again
... and after all this i could send Mails to any Mailserver an Receivend any Mails for mydomains on my webserver :)
hope this helps anybody with a equal Problem, hope this makes sens to you if not, let me hear your Feedback
thx minja