elho ?Invalid command

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
vahankh
Posts: 21
Joined: 2014/08/28 16:49:17

elho ?Invalid command

Post by vahankh » 2014/08/28 18:45:01

Hi,

I'm trying to configure postfix on centos 5 following this instruction https://www.linode.com/docs/email/postf ... n-centos-5 . I'm new to Unix and can't resolve one problem.

When I'm trying to test my postfix with

Code: Select all

telnet localhost 25
ehlo localhost
 
I'm getting "?Invalid command" error. I'm not sure, but it looks like I did something wrong.

Output of postconf -n is

Code: Select all

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 30720000
mydestination = $myhostname, localhost, localhost.localdomain
myhostname = mail.mobz.ca
mynetworks = 127.0.0.0/8
newaliases_path = /usr/bin/newaliases.postfix
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem
smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000
Can you pleas help me with this problem?

Thanks in advance!

User avatar
avij
Retired Moderator
Posts: 3039
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: elho ?Invalid command

Post by avij » 2014/08/28 19:30:46

I don't know where you got the "?invalid command" message, it does not look like a Postfix message.

Sendmail says: 500 5.5.1 Command unrecognized: "fgsdfg"
Exim says: 500 unrecognized command
Postfix says: 402 4.5.2 Error: command not recognized
qmail says: 502 unimplemented (#5.5.1)

What is the process that is listening on port 25? You can find that out with a netstat -anp | grep :25 | grep LISTEN. For postfix, it should be smtpd. [edit: I forgot we're on the C5 forum; "master" is also fine]

Also, when you telnet localhost 25, do you get the mail server's own greeting? Like "220 plato.example.com ESMTP Postfix" on the web page you linked.

User avatar
avij
Retired Moderator
Posts: 3039
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: elho ?Invalid command

Post by avij » 2014/08/28 19:34:24

Oh, I figured this out, it's a telnet error message:

Code: Select all

$ telnet
telnet> localhost 25
?Invalid command
You should either run telnet localhost 25, or telnet and then open localhost 25.

vahankh
Posts: 21
Joined: 2014/08/28 16:49:17

Re: elho ?Invalid command

Post by vahankh » 2014/08/28 19:45:06

Here is my complete output:

Code: Select all

$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> elho localhost
?Invalid command
telnet>

vahankh
Posts: 21
Joined: 2014/08/28 16:49:17

Re: elho ?Invalid command

Post by vahankh » 2014/08/28 19:47:05

The output of netstat is:

Code: Select all

tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      15113/master
I dont' get local greeting, though I can connect through port 25.

Thanks

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: elho ?Invalid command

Post by gerald_clark » 2014/08/28 19:49:21

The '^]' is disconnecting you from localhost 25.
Why are you doing that?

User avatar
avij
Retired Moderator
Posts: 3039
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: elho ?Invalid command

Post by avij » 2014/08/28 19:54:21

Do not cut and paste the "ehlo localhost", just type it yourself. The cut&paste might be pasting some hidden control characters that confuse telnet.

vahankh
Posts: 21
Joined: 2014/08/28 16:49:17

Re: elho ?Invalid command

Post by vahankh » 2014/08/28 19:56:23

Without typing it I can't test elho. I didn't know it is disconnecting.

This freezes infinitely without any greeting

Code: Select all

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Anything (except '^]') I type after this is ignored.
Last edited by vahankh on 2014/08/28 19:59:57, edited 1 time in total.

vahankh
Posts: 21
Joined: 2014/08/28 16:49:17

Re: elho ?Invalid command

Post by vahankh » 2014/08/28 19:57:32

avij wrote:Do not cut and paste the "ehlo localhost", just type it yourself. The cut&paste might be pasting some hidden control characters that confuse telnet.
I've tried that, but it doesn't work.

User avatar
avij
Retired Moderator
Posts: 3039
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: elho ?Invalid command

Post by avij » 2014/08/28 20:03:18

OK, I tried telnetting to your mail server. There's something wrong, because your mail server does not output the greeting, and it does not respond to "ehlo <myhostname>" at all. Please check the logs to see if they have any clues about this. I don't have a C5 Postfix installation handy, but see /var/log/maillog and /var/log/messages.

Also, please don't top post on the forums.

Post Reply

Return to “CentOS 5 - Server Support”