PDA

View Full Version : Can not receive e-mail - Postfix


Hans
1st April 2006, 19:40
I only can send e-mail using my postfix server.

When i send an email to one of my domains on the server, there is an error in the emailclient:

Remote-MTA: DNS; server1.mydomain.tld
Diagnostic-Code: SMTP; 554 : Relay access denied

I checked the Postfix configuration file by comparing it with the version mentioned here:

http://www.howtoforge.com/perfect_setup_debian_sarge_p4

Everything seems to be ok in my configuration file, so why this problem?

I do not understand!

What could be wrong?

Hans

till
1st April 2006, 21:11
Have you set "server needs authentication" in the smtp settings of your email client?

If you use ISPConfig, do you have this line in your postfix main.cf file:

mydestination = /etc/postfix/local-host-names

Hans
1st April 2006, 22:22
There was a line in /etc/postfix/main.cf :

mydestination = server1.mydomain.tld, localhost.mydomain.tld, localhost

I changed it in:

#mydestination = server1.mydomain.tld, localhost.mydomain.tld, localhost

I added your suggested line instead:

mydestination = /etc/postfix/local-host-names

My Postfix main.cf file looks now like:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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
myhostname = server1.mydomain.tld
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = server1.mydomain.tld, localhost.mydomain.tld, localhost
mydestination = /etc/postfix/local-host-names
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

---
After this modification i restarted Postfix with:
/etc/init.d/postfix restart


When i use my e-mailclient, the mailserver does not recognise my username/password.
"server needs authentication" is on (of course).

When i send an e-mail from the outside world to an e-mailaddress which belongs to one of the domains on my server, it wil NOT reach the mailbox and it is not bounced back to me!

The output of command grep -i smtp /etc/services :
smtp 25/tcp mail
ssmtp 465/tcp smtps # SMTP over SSL

I have also discovered that saslauthd is not always running.
When i do an /etc/init.d/saslauthd start
it results into:
Starting SASL Authentication Daemon: (failed).
The output of ps aux|grep saslauthd:

root 4225 0.0 0.2 34900 2396 ? Ss 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
root 4226 0.0 0.2 34900 2392 ? S 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
root 4227 0.0 0.2 34900 2396 ? S 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
root 4228 0.0 0.2 34900 2396 ? S 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
root 4229 0.0 0.2 34900 2396 ? S 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
root 9059 0.0 0.0 2908 620 pts/1 S+ 22:12 0:00 grep saslauthd

I could start saslauthd again after killing the processes according:

kill -9 4225
kill -9 4226
kill -9 4227
kill -9 4228
kill -9 4229

/etc/init.d/saslauthd start

saslauthd was started, but it did not solve my problem with receiving/sending emails.


For me this is a serious problem, how can it be solved?

I hope someone can help me.


Hans

till
2nd April 2006, 18:13
Please rerun the configuration steps for post“fix and courier as described here:

http://www.howtoforge.com/perfect_setup_debian_sarge_p4

Do you have ISPConfig installed?

Hans
2nd April 2006, 20:25
Yes, Till i have ISPConfig (last stable version) installed.

Can i just rerun the setup for Postfix?

Or do i have to remove the existing Postfix files first with apt-get remove --purge ..., before is start again?

I also have checked my /var/log/mail.log file.
When i have send an e-mail to an e-mailaddress on the server it does not reach it.
In every line of the logfile: nmsgs=0 ndele=0

Hans

falko
2nd April 2006, 23:07
Yes, Till i have ISPConfig (last stable version) installed.

Can i just rerun the setup for Postfix?Yes.

Or do i have to remove the existing Postfix files first with apt-get remove --purge ..., before is start again?
No, you don't need this. But after apt-get install postfix ... you should run dpkg-reconfigure postfix

Hans
3rd April 2006, 13:46
Thanks for your reply!

Everything is up and running again.