HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   with ISPConfig, Postfix, and Courier, mail does not send or receive (http://www.howtoforge.com/forums/showthread.php?t=33525)

karazy-k 11th April 2009 08:40

with ISPConfig, Postfix, and Courier, mail does not send or receive
 
Hello,

Thank you in advance for your help. I have recently followed Falko's perfect setup for a Debian box running ISPConfig. The install went smoothly (a great help btw) and I am hosting several sites already! However I cannot figure out how to get mail working for the websites' users.

I have installed the roundcube package using ISPConfig's update utility. That seems to work fine. As I understand it, roundcube is only a visual interface to postfix and courier and would not be responsible for mail difficulties per se. I can login using any user name and password I create in the ISPConfig site manager. I can navigate all the menus in roundcube fine, but cannot send or receive email at all.

If I send an email, roundcube splashes a notice saying it sent successfully, but it never reaches its destination. Any email sent to the address results in an error 550, the recipient is not accepted.

Fishing around these forums I have found many threads dealing with this issue, as it appears to be a common one. I could not find a solution on my own however, so I hope someone on this forum can guide me through it.

The most indepth trouble shooting I've done is running 'tail -f /var/log/mail.log'. I see that I login and logout of the imapd server almost every minute. No other information is displayed when I try to send or receive a mail.

As an aside, I am using Putty to connect to my server and do not know how to copy information displayed in that window into another to share, e.g. to share netstat -tap results. Does anyone know a way to do this?

-K

karazy-k 12th April 2009 09:11

I began going through the perfect setup for ISPConfig 2 on Debian by Falko. I followed the instruction line for line again for Postfix installation. Then, at the end, to test it was all working, Falko says enter "telnet localhost 25". I do and I do not get results that match what I should get. Here is what I get.

Quote:

ehlo localhost
250-kyleserver1.kylekarhohs.me Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
quit
221 2.0.0 kyleserver1.kylekarhohs.me closing connection
Connection closed by foreign host.
I guess I am missing 250-STARTTLS and 250-AUTH LOGIN PLAIN

What does this mean?

falko 12th April 2009 14:25

Quote:

Originally Posted by karazy-k (Post 181187)
As an aside, I am using Putty to connect to my server and do not know how to copy information displayed in that window into another to share, e.g. to share netstat -tap results. Does anyone know a way to do this?

-K

You can simply mark text in PuTTy, and it's in your clipboard.

What's in /etc/postfix/main.cf?

karazy-k 12th April 2009 17:01

Here is what I find in /etc/postfix/main.cf

Code:


# 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 (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

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.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 = kyleserver1.kylekarhohs.me
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = kyleserver1.kylekarhohs.me, localhost.kylekarhohs.me, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
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

virtual_maps = hash:/etc/postfix/virtusertable

mydestination = kyleserver1.kylekarhohs.me, localhost.kylekarhohs.me,localhost.localdomain,localhost


Thanks. -K

falko 13th April 2009 17:05

Please run
Code:

postconf -e 'mydestination = /etc/postfix/local-host-names'
/etc/init.d/postfix restart

What does telnet show then?

karazy-k 13th April 2009 19:01

Here are the new results from telnet
Code:


ehlo localhost
250-kyleserver1.kylekarhohs.me Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
quit
221 2.0.0 kyleserver1.kylekarhohs.me closing connection
Connection closed by foreign host.


I also confirmed that the /etc/postfix/main.cf file had been edited properly, it had. Thank you for your assistance. Your advice is still helpful, for looking at /etc/postfix/local-host-names I found

Code:


###################################
#
# ISPConfig local-host-names Configuration File
#        Version 1.0
#
###################################
localhost
kyleserver1.kylekarhohs.me
localhost.kyleserver1.kylekarhohs.me
localhost.kylekarhohs.me
localhost.localdomain
www.melonquark.net
www.kylekarhohs.me
www.kaylagbmfoundation.org
melonquark.net
kylekarhohs.me
kitchenriot.net
kaylagbmfoundation.org
mail.kylekarhohs.me
#### MAKE MANUAL ENTRIES BELOW THIS LINE! ####


I recognize these as the domains I am hosting. It would appear ISPConfig writes to this file automatically. Nothing is entered below the manual entries comment. Thank you for all your help to this point, but it appears there are still issues. I hope you can assist further.

-K

falko 14th April 2009 13:31

What's the output of
Code:

netstat -tap
? I tend to think that maybe Sendmail is running instead of Postfix...

karazy-k 14th April 2009 19:23

Hey Falko,

I think your intuition is right. Here is what my 'netstat -tap' shows

Code:


Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name
tcp        0      0 localhost:10024        *:*                    LISTEN      25614/amavisd (mast
tcp        0      0 *:mysql                *:*                    LISTEN      26675/mysqld
tcp        0      0 localhost:submission    *:*                    LISTEN      23295/sendmail: MTA
tcp        0      0 *:sunrpc                *:*                    LISTEN      1630/portmap
tcp        0      0 *:81                    *:*                    LISTEN      14119/ispconfig_htt
tcp        0      0 *:52372                *:*                    LISTEN      1641/rpc.statd
tcp        0      0 kyleserver1.kyle:domain *:*                    LISTEN      14707/named
tcp        0      0 localhost:domain        *:*                    LISTEN      14707/named
tcp        0      0 *:ssh                  *:*                    LISTEN      2842/sshd
tcp        0      0 localhost:953          *:*                    LISTEN      14707/named
tcp        0      0 localhost:smtp          *:*                    LISTEN      23295/sendmail: MTA
tcp        0    52 kyleserver1.kylekar:ssh 192.168.2.24:51877      ESTABLISHED 31122/sshd: kyle [p
tcp6      0      0 [::]:imaps              [::]:*                  LISTEN      9371/couriertcpd
tcp6      0      0 [::]:pop3s              [::]:*                  LISTEN      9388/couriertcpd
tcp6      0      0 [::]:pop3              [::]:*                  LISTEN      9201/couriertcpd
tcp6      0      0 [::]:imap2              [::]:*                  LISTEN      9282/couriertcpd
tcp6      0      0 [::]:www                [::]:*                  LISTEN      10279/apache2
tcp6      0      0 [::]:ftp                [::]:*                  LISTEN      27541/proftpd: (acc
tcp6      0      0 [::]:ssh                [::]:*                  LISTEN      2842/sshd
tcp6      0      0 localhost:953          [::]:*                  LISTEN      14707/named
tcp6      0      0 [::]:https              [::]:*                  LISTEN      10279/apache2
tcp6      0    58 kyleserver1.kylekar:ftp mail.dezandis.com:51594 ESTABLISHED 31522/proftpd: (acc
tcp6      0      0 kyleserver1.kylekar:www 18925023069.user.:60928 ESTABLISHED 32733/apache2


No where does it list Postfix running, and it does list sendmail. What is the difference between Postfix and sendmail? What does this table of information list? What is 'netstat -tap' showing us? What is the difference between LISTEN and ESTABLISHED? I've never heard of mail.dezandis.com, but I'm connected to it? I went there and it just says "Apache is working". Is this an attack on my server?

Thanks for your help Falko. Would you be able to tell me how I remove sendmail and replace it with Postfix?

-K

falko 15th April 2009 18:10

Please run
Code:

/etc/init.d/sendmail stop
/etc/init.d/postfix start

Afterwards, the telnet output should be ok.

Which distribution are you using?

Postfix and Sendmail are both MTAs, but Postfix is much easier to configure.

To learn more about netstat, take a look at
Code:

man netstat

karazy-k 15th April 2009 22:07

Thank you Falko. Your advice was spot on. I shutdown sendmail and fired up postfix. My telnet results are now as expected.
Code:

220 kyleserver1.kylekarhohs.me ESMTP Postfix (Debian/GNU)
ehlo localhost
250-kyleserver1.kylekarhohs.me
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.

However, my situation is still not completely resolved. I am able to send mail from within my RoundCube interface, but whenever I send an email to the address I get a 550 error.

I looked at the log, /var/log/mail.log, and found several things.

First, ClamAV kept recording that it was out of date. I saw the new ISPConfig updated ClamAV, so I went ahead and updated ISPConfig to version 2.2.32. My linux distro is Debian 5.0.1. Looking back in the log, ClamAV now confirms it is up to date.

Second, I do not know if this is normal, but my log is full of entries like this:
Code:


Apr 15 12:52:18 kyleserver1 imapd: LOGIN, user=username, ip=[::ffff:127.0.0.1], port=[47962], protocol=IMAP
Apr 15 12:52:18 kyleserver1 imapd: LOGOUT, user=username, ip=[::ffff:127.0.0.1], headers=0, body=0, rcvd=10, sent=83, time=0
Apr 15 12:53:18 kyleserver1 imapd: Connection, ip=[::ffff:127.0.0.1]
Apr 15 12:53:18 kyleserver1 imapd: LOGIN, user=username, ip=[::ffff:127.0.0.1], port=[47963], protocol=IMAP
Apr 15 12:53:18 kyleserver1 imapd: LOGOUT, user=username, ip=[::ffff:127.0.0.1], headers=0, body=0, rcvd=31, sent=335, time=0

90% of my log seems to be filled with the LOGIN-LOGOUT statements every minute. All that changes is the port number. Should there be one specific port number assigned to the mail?

Third, when I send an email from roundcube I can find the entry in the log that documents this action. However, there is no documentation of receiving an incoming message when I try to send an email to the account. It seems that whatever I am sending never makes it to the mail server. My mail log is becoming rather lengthy, too, is there a way to keep it short?

Thanks for your continued assistance Falko. Head way is being made, but might you know the cause of my latest quandry?

-K


All times are GMT +2. The time now is 12:33.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.