Major Problem with email

Status
Not open for further replies.

baggyn

Verified User
Joined
Jul 22, 2008
Messages
21
hi
i recently used custombuild to update to php 5.2.6 and apache 2.2 on my server. Everything is running ok apart from emails.

If i log into squirrel mail and try to send an email i get this message
'Message not sent. Server replied:

Connection refused
111 Can't open SMTP stream'

as i cant send emails through squirrelmail,UebiMiau or thunderbird im assuming something is not configured correct on the server

also if i log in as root through SSH and try
'telnet localhost'
i get the following error
'telnet: connect to address 127.0.0.1: Connection refused'

i'm really at a loss here, i don't fully understand how emails work on a server.
Could someone possibly clarify the difference between IMAP, SMTP, Exim and Dovecot?

If anyone can help me solve this problem i'd really appreciate it as i can't send or recieve any emails at the moment.

thanks in advance
nathan
 
thanks for your reply but at the top of the page it says
'NOTE: If you're running dovecot, this guide will not apply to you. These checks are for the wu-imap/vm-popd setup with customapache. If you're using custombuild and dovecot, this doesn't apply.'

as i used custombuild im assuming that this wont apply to me
 
i can connect to localhost 25 through telnet
so does this mean there is a problem with dovecot?
 
can you post your dovecot.conf file?

also check if exim works :

telnet localhost 25
HELO servname
MAIL FROM: admin@yourservername (server.domain.com)
RCPT TO: admin@yourservername
DATA
test
.

(the dot above means end of message)
See if it replies ok..
 
telnet localhost 25
HELO servname
MAIL FROM: admin@yourservername (server.domain.com)
RCPT TO: admin@yourservername
DATA
test

that doesnt seem to return any errors

im sorry for asking but where abouts is the dovecot.conf file located?
 
Did you get an email ? it's better to try from your home pc.
this command sends you an email.
Dont forget to end with a . (a dot)
This is my server's queries:

-----------------------------------------------------------------
C:\Users\user>telnet server.domain.com 25
Trying server.domain.com...
Connected to server.domain.com.
Escape character is '^]'.
220 server.domain.com ESMTP Exim 4.69 Fri, 25 Jul 2008 16:54:14 +0300
HELO server
250 server.domain.com Hello ppp-adsl.test.com [222.222.222.222]
MAIL FROM: [email protected]
250 OK
RCPT TO: [email protected]
250 Accepted
DATA
354 Enter message, ending with "." on a line by itself
test 123
.
250 OK id=1KMNlR-000M1k-Dm
-----------------------------------------------------------------------
the last line says that the message was queued for delivery.

Now check your emails. if a mail came to user email account exim is ok.
It must be something in dovecot. you can see where your dovecot.conf is by
running a :
locate dovecot.conf
 
ok im getting this
220 mercury.bluewave-network.com ESMTP Exim 4.50 Fri, 25 Jul 2008 18:33:48 +0100
helo server.domain.com
250 server.domain.com Hello localhost [127.0.0.1]
mail from: [email protected]
250 OK
rcpt to: [email protected]
250 Accepted
data
354 Enter message, ending with "." on a line by itself
test .
.
250 OK id=1KMRBV-00033e-LL

but if i check [email protected] with squiirel mail i havnt recieved the email

i really hate to be a pain but when i type
locate dovecot.conf
i get

/etc/dovecot.conf
/usr/local/directadmin/custombuild/configure/dovecot/dovecot.conf
/usr/local/directadmin/custombuild/custombuild/configure/dovecot/dovecot.conf
/usr/local/directadmin/custombuild/dovecot.conf
/usr/local/directadmin/customapache/custombuild/configure/dovecot/dovecot.conf

does it matter which one of these i post?
 
This one is the working one:
/etc/dovecot.conf

The others are DA's templates

It would be helpful if you also post your logs.
Open 3 ssh terminal.
do:
tail -f /var/log/mailog (1st terminal and press 10 times enter to clear the screen)
tail -f /var/log/exim/mainlog (2nd terminal and press 10 times enter to clear the screen)
tail -f /var/log/exim/paniclog (3 terminal and press 10 times enter to clear the screen)

do one more time that thing with the telnet server.domain.com 25 and all of the commands above
A bit after the 250 OK id=1KMRBV-00033e-LL message you'll get some records in the above terminals (maybe not in all of them)

Press control+c to the 3 terminals and paste what you get.
 
Last edited:
i entered this

tail -f /var/log/mailog

and it returned this

tail: cannot open `/var/log/mailog' for reading: No such file or directory
tail: no files remaining

i entered this
tail -f /var/log/exim/mainlog

and it returned this
2008-07-29 12:06:16 1KNn1w-0002JO-6Q <= [email protected] H=localhost (server.domain.com) [127.0.0.1] P=smtp S=212 from <[email protected]> for [email protected]
2008-07-29 12:06:16 1KNn1w-0002JO-6Q => mailme <[email protected]> F=<[email protected]> R=virtual_user T=virtual_localdelivery S=368
2008-07-29 12:06:16 1KNn1w-0002JO-6Q Completed

and when i entered this
tail -f /var/log/exim/paniclog

i got nothing new



my dovecot.conf file is
## Dovecot 1.1 configuration file protocols = imap imaps pop3 pop3s #ssl_cert_file = /etc/exim.cert #ssl_key_file = /etc/exim.key ssl_cert_file = /etc/httpd/conf/ssl.crt/server.crt ssl_key_file = /etc/httpd/conf/ssl.key/server.key disable_plaintext_auth = no ## ## Login processes ## #login_chroot = yes login_user = dovecot login_processes_count = 16 login_greeting = Dovecot DA ready. ## ## Mail processes ## verbose_proctitle = yes first_valid_uid = 500 last_valid_uid = 0 mail_access_groups = mail #mail_debug = no #mail_location = maildir:~/Maildir mail_location = maildir:~/Maildir # Like mailbox_check_interval, but used for IDLE command. #mailbox_idle_check_interval = 30 # Copy mail to another folders using hard links. This is much faster than # actually copying the file. This is problematic only if something modifies # the mail in one folder but doesn't want it modified in the others. I don't # know any MUA which would modify mail files directly. IMAP protocol also # requires that the mails don't change, so it would be problematic in any case. # If you care about performance, enable it. #maildir_copy_with_hardlinks = no # umask to use for mail files and directories umask = 0007 # Set max. process size in megabytes. Most of the memory goes to mmap()ing # files, so it shouldn't harm much even if this limit is set pretty high. #mail_process_size = 256 # Log prefix for mail processes. See doc/variables.txt for list of possible # variables you can use. #mail_log_prefix = "%Us(%u): " ## ## IMAP specific settings ## protocol imap { # Maximum IMAP command line length in bytes. Some clients generate very long # command lines with huge mailboxes, so you may need to raise this if you get # "Too long argument" or "IMAP command line too large" errors often. #imap_max_line_length = 65536 # Send IMAP capabilities in greeting message. This makes it unnecessary for # clients to request it with CAPABILITY command, so it saves one round-trip. # Many clients however don't understand it and ask the CAPABILITY anyway. #login_greeting_capability = no # Workarounds for various client bugs: # delay-newmail: # Send EXISTS/RECENT new mail notifications only when replying to NOOP # and CHECK commands. Some clients ignore them otherwise, for example # OSX Mail. Outlook Express breaks more badly though, without this it # may show user "Message no longer in server" errors. Note that OE6 still # breaks even with this workaround if synchronization is set to # "Headers Only". # outlook-idle: # Outlook and Outlook Express never abort IDLE command, so if no mail # arrives in half a hour, Dovecot closes the connection. This is still # fine, except Outlook doesn't connect back so you don't see if new mail # arrives. # netscape-eoh: # Netscape 4.x breaks if message headers don't end with the empty "end of # headers" line. Normally all messages have this, but setting this # workaround makes sure that Netscape never breaks by adding the line if # it doesn't exist. This is done only for FETCH BODY[HEADER.FIELDS..] # commands. Note that RFC says this shouldn't be done. # tb-extra-mailbox-sep: # With mbox storage a mailbox can contain either mails or submailboxes, # but not both. Thunderbird separates these two by forcing server to # accept '/' suffix in mailbox names in subscriptions list. #imap_client_workarounds = outlook-idle } ## ## POP3 specific settings ## protocol pop3 { # Don't try to set mails non-recent or seen with POP3 sessions. This is # mostly intended to reduce disk I/O. With maildir it doesn't move files # from new/ to cur/, with mbox it doesn't write Status-header. #pop3_no_flag_updates = no # Support LAST command which exists in old POP3 specs, but has been removed # from new ones. Some clients still wish to use this though. Enabling this # makes RSET command clear all \Seen flags from messages. #pop3_enable_last = no # POP3 UIDL format to use. You can use following variables: # # %v - Mailbox UIDVALIDITY # %u - Mail UID # %m - MD5 sum of the mailbox headers in hex (mbox only) # %f - filename (maildir only) # # If you want UIDL compatibility with other POP3 servers, use: # UW's ipop3d : %08Xv%08Xu # Courier version 0 : %f # Courier version 1 : %u # Courier version 2 : %v-%u # Cyrus (<= 2.1.3) : %u # Cyrus (>= 2.1.4) : %v.%u # # Note that Outlook 2003 seems to have problems with %v.%u format which is # Dovecot's default, so if you're building a new server it would be a good # idea to change this. %08Xu%08Xv should be pretty fail-safe. #pop3_uidl_format = %v.%u pop3_uidl_format = %08Xu%08Xv # POP3 logout format string: # %t - number of TOP commands # %T - number of bytes sent to client as a result of TOP command # %r - number of RETR commands # %R - number of bytes sent to client as a result of RETR command # %d - number of deleted messages # %m - number of messages (before deletion) # %s - mailbox size in bytes (before deletion) #pop3_logout_format = top=%t/%T, retr=%r/%R, del=%d/%m, size=%s # Support for dynamically loadable modules. #mail_use_modules = no #mail_modules = /usr/lib/dovecot/pop3 # Workarounds for various client bugs: # outlook-no-nuls: # Outlook and Outlook Express hang if mails contain NUL characters. # This setting replaces them with 0x80 character. # oe-ns-eoh: # Outlook Express and Netscape Mail breaks if end of headers-line is # missing. This option simply sends it if it's missing. #pop3_client_workarounds = } ## ## Authentication processes ## # Set max. process size in megabytes. #auth_process_size = 256 # Authentication cache size in kilobytes. auth_cache_size = 0 # Time to live in seconds for cached data. After this many seconds a cached # record is forced out of cache. #auth_cache_ttl = 3600 # List of allowed characters in username. If the user-given username contains # a character not listed in here, the login automatically fails. This is just # an extra check to make sure user can't exploit any potential quote escaping # vulnerabilities with SQL/LDAP databases. If you want to allow all characters, # set this value to empty. auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@& # More verbose logging. Useful for figuring out why authentication isn't # working. auth_verbose = yes # Even more verbose logging for debugging purposes. Shows for example SQL # queries. #auth_debug = no # Maximum number of dovecot-auth worker processes. They're used to execute # blocking passdb and userdb queries (eg. MySQL and PAM). They're # automatically created and destroyed as needed. #auth_worker_max_count = 30 auth default { mechanisms = plain #FreeBSD may require this instead of 'passdb shadow' #passdb passwd { #} passdb shadow { } passdb passwd-file { args = username_format=%n /etc/virtual/%d/passwd } userdb passwd { } userdb passwd-file { args = username_format=%n /etc/virtual/%d/passwd } # User to use for the process. This user needs access to only user and # password databases, nothing else. Only shadow and pam authentication # requires roots, so use something else if possible. Note that passwd # authentication with BSDs internally accesses shadow files, which also # requires roots. Note that this user is NOT used to access mails. # That user is specified by userdb above. user = root # Number of authentication processes to create #count = 1 }
 
It seems that exim is working but i can't read your dovecot.conf
please edit your post and paste it with newlines...
 
sorry about that

## Dovecot 1.1 configuration file

protocols = imap imaps pop3 pop3s

#ssl_cert_file = /etc/exim.cert
#ssl_key_file = /etc/exim.key
ssl_cert_file = /etc/httpd/conf/ssl.crt/server.crt
ssl_key_file = /etc/httpd/conf/ssl.key/server.key


disable_plaintext_auth = no

##
## Login processes
##

#login_chroot = yes

login_user = dovecot
login_processes_count = 16

login_greeting = Dovecot DA ready.


##
## Mail processes
##

verbose_proctitle = yes

first_valid_uid = 500
last_valid_uid = 0


mail_access_groups = mail

#mail_debug = no

#mail_location = maildir:~/Maildir
mail_location = maildir:~/Maildir

# Like mailbox_check_interval, but used for IDLE command.
#mailbox_idle_check_interval = 30

# Copy mail to another folders using hard links. This is much faster than
# actually copying the file. This is problematic only if something modifies
# the mail in one folder but doesn't want it modified in the others. I don't
# know any MUA which would modify mail files directly. IMAP protocol also
# requires that the mails don't change, so it would be problematic in any case.
# If you care about performance, enable it.
#maildir_copy_with_hardlinks = no

# umask to use for mail files and directories
umask = 0007

# Set max. process size in megabytes. Most of the memory goes to mmap()ing
# files, so it shouldn't harm much even if this limit is set pretty high.
#mail_process_size = 256

# Log prefix for mail processes. See doc/variables.txt for list of possible
# variables you can use.
#mail_log_prefix = "%Us(%u): "

##
## IMAP specific settings
##

protocol imap {


# Maximum IMAP command line length in bytes. Some clients generate very long
# command lines with huge mailboxes, so you may need to raise this if you get
# "Too long argument" or "IMAP command line too large" errors often.
#imap_max_line_length = 65536

# Send IMAP capabilities in greeting message. This makes it unnecessary for
# clients to request it with CAPABILITY command, so it saves one round-trip.
# Many clients however don't understand it and ask the CAPABILITY anyway.
#login_greeting_capability = no

# Workarounds for various client bugs:
# delay-newmail:
# Send EXISTS/RECENT new mail notifications only when replying to NOOP
# and CHECK commands. Some clients ignore them otherwise, for example
# OSX Mail. Outlook Express breaks more badly though, without this it
# may show user "Message no longer in server" errors. Note that OE6 still
# breaks even with this workaround if synchronization is set to
# "Headers Only".
# outlook-idle:
# Outlook and Outlook Express never abort IDLE command, so if no mail
# arrives in half a hour, Dovecot closes the connection. This is still
# fine, except Outlook doesn't connect back so you don't see if new mail
# arrives.
# netscape-eoh:
# Netscape 4.x breaks if message headers don't end with the empty "end of
# headers" line. Normally all messages have this, but setting this
# workaround makes sure that Netscape never breaks by adding the line if
# it doesn't exist. This is done only for FETCH BODY[HEADER.FIELDS..]
# commands. Note that RFC says this shouldn't be done.
# tb-extra-mailbox-sep:
# With mbox storage a mailbox can contain either mails or submailboxes,
# but not both. Thunderbird separates these two by forcing server to
# accept '/' suffix in mailbox names in subscriptions list.
#imap_client_workarounds = outlook-idle
}

##
## POP3 specific settings
##

protocol pop3 {

# Don't try to set mails non-recent or seen with POP3 sessions. This is
# mostly intended to reduce disk I/O. With maildir it doesn't move files
# from new/ to cur/, with mbox it doesn't write Status-header.
#pop3_no_flag_updates = no

# Support LAST command which exists in old POP3 specs, but has been removed
# from new ones. Some clients still wish to use this though. Enabling this
# makes RSET command clear all \Seen flags from messages.
#pop3_enable_last = no

# POP3 UIDL format to use. You can use following variables:
#
# %v - Mailbox UIDVALIDITY
# %u - Mail UID
# %m - MD5 sum of the mailbox headers in hex (mbox only)
# %f - filename (maildir only)
#
# If you want UIDL compatibility with other POP3 servers, use:
# UW's ipop3d : %08Xv%08Xu
# Courier version 0 : %f
# Courier version 1 : %u
# Courier version 2 : %v-%u
# Cyrus (<= 2.1.3) : %u
# Cyrus (>= 2.1.4) : %v.%u
#
# Note that Outlook 2003 seems to have problems with %v.%u format which is
# Dovecot's default, so if you're building a new server it would be a good
# idea to change this. %08Xu%08Xv should be pretty fail-safe.

#pop3_uidl_format = %v.%u
pop3_uidl_format = %08Xu%08Xv

# POP3 logout format string:
# %t - number of TOP commands
# %T - number of bytes sent to client as a result of TOP command
# %r - number of RETR commands
# %R - number of bytes sent to client as a result of RETR command
# %d - number of deleted messages
# %m - number of messages (before deletion)
# %s - mailbox size in bytes (before deletion)
#pop3_logout_format = top=%t/%T, retr=%r/%R, del=%d/%m, size=%s

# Support for dynamically loadable modules.
#mail_use_modules = no
#mail_modules = /usr/lib/dovecot/pop3

# Workarounds for various client bugs:
# outlook-no-nuls:
# Outlook and Outlook Express hang if mails contain NUL characters.
# This setting replaces them with 0x80 character.
# oe-ns-eoh:
# Outlook Express and Netscape Mail breaks if end of headers-line is
# missing. This option simply sends it if it's missing.
#pop3_client_workarounds =
}

##
## Authentication processes
##

# Set max. process size in megabytes.
#auth_process_size = 256

# Authentication cache size in kilobytes.
auth_cache_size = 0
# Time to live in seconds for cached data. After this many seconds a cached
# record is forced out of cache.
#auth_cache_ttl = 3600

# List of allowed characters in username. If the user-given username contains
# a character not listed in here, the login automatically fails. This is just
# an extra check to make sure user can't exploit any potential quote escaping
# vulnerabilities with SQL/LDAP databases. If you want to allow all characters,
# set this value to empty.
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@&

# More verbose logging. Useful for figuring out why authentication isn't
# working.
auth_verbose = yes

# Even more verbose logging for debugging purposes. Shows for example SQL
# queries.
#auth_debug = no

# Maximum number of dovecot-auth worker processes. They're used to execute
# blocking passdb and userdb queries (eg. MySQL and PAM). They're
# automatically created and destroyed as needed.
#auth_worker_max_count = 30

auth default {
mechanisms = plain

#FreeBSD may require this instead of 'passdb shadow'
#passdb passwd {
#}

passdb shadow {
}

passdb passwd-file {
args = username_format=%n /etc/virtual/%d/passwd
}
userdb passwd {
}

userdb passwd-file {
args = username_format=%n /etc/virtual/%d/passwd
}


# User to use for the process. This user needs access to only user and
# password databases, nothing else. Only shadow and pam authentication
# requires roots, so use something else if possible. Note that passwd
# authentication with BSDs internally accesses shadow files, which also
# requires roots. Note that this user is NOT used to access mails.
# That user is specified by userdb above.
user = root

# Number of authentication processes to create
#count = 1
}
 
looks good...
Try this :

let's say that the user that you send the test email is the main account (the username that you login

cd ~user/Maildir
ls -la cur

are there any files in there? do a
more cur/filename

do you recognize some email?

if the user is a virtual mail account the files are in :
cd ~user/imap/domain.com/user/Maildir
 
ok my username is nbaggs
and my email account is [email protected]

cd ~nbaggs/Maildir
ls -la cur

returns
total 8
drwxrwx--- 2 nbaggs mail 4096 Jul 19 12:11 .
drwxrwx--- 9 nbaggs mail 4096 Jul 22 13:20 ..

and
cd ~nbaggs/imap/domain.com/mailme/Maildir
ls -la cur

returns
total 8
drwxrwx--- 2 nbaggs mail 4096 Jul 21 16:48 .
drwxrwx--- 9 nbaggs mail 4096 Jul 22 14:11 ..
 
is there a dovecot=1 in your /usr/local/directadmin/conf/directadmin.conf file?
maybe you have to run custombuild for the mail system again...
 
It looks like I have the same problem, I did a new fresh install of Directadmin becouse my server crashed. I restored all the backups, everything is working again only mail (exim) doesn't work.

When I telnet from a computer to port 25 everytime I enter rcpt to: [email protected] the connection to the mailserver is lost.

When i login to the server and on the cli i type: exim -bhc <ip address> I do the same as on the computer, and after rcpt to: [email protected] I get this error:

exim: symbol lookup error: exim: undefined symbol: Perl_Tstack_sp_ptr

I search for anyother user with the same problem, but I cannot find them.

Ps: before rcpt to: i entered first helo and mail from:
 
yes there is a dovecot = 1 in my /usr/local/directadmin/conf/directadmin.conf
 
It looks like I have the same problem, I did a new fresh install of Directadmin becouse my server crashed. I restored all the backups, everything is working again only mail (exim) doesn't work.

exim: symbol lookup error: exim: undefined symbol: Perl_Tstack_sp_ptr

Your problem should have to do with problematic perl install....
Maybe in your previous install perl was biuld multithreaded and now not or vice versa.
Or you're just missing Term::ReadKey
To see if it's the one or another do a:
perl -MCPAN -e shell
install Term::ReadKey

if all works then it's ok and you should check for other perl modules missing too.
If that module was installed try to rebuild perl as it was (threaded or not)
 
Status
Not open for further replies.
Back
Top