PDA

View Full Version : Postfix doesn't connect to telnet


Vic Steele
18th July 2008, 16:17
Hi all. First of all, thanks to Falko for his tutorials.
I have a system prepared for run as a generic Web Server. I use Debian Etch as OS and I've already installed all things necessaries (Apache Webserver, Php, MySQL, etc...).
All works so good, except Postfix, I don't be succesful to start it.
I follow these two tutorials:
1) The Perfect Setup; (http://www.howtoforge.com/perfect_setup_debian_etch_p5)
2) Virtual Users And Domains With Postfix, Courier and MySQL. (http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch )

Following this tutorials, all is ok and I'm able to get all the services started. For example, if I launch /etc/init.d/postfix start, it starts and looks ok.
So it doesn't work, and if I launch "telnet localhost 25", this is the response:
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
And nothing else matters.
All the other things in the 2nd tutorial are good and work fine.
I don't know what's wrong. Maybe I failed to write "server1.example.com", I wrote in all "hostname.dyndns.org", where hostname is my real hostname, obviously.
So, what is my wrongs? If necessary, I can post other, for example a configuration file, if you want to take a look.
I repeat: all the processes start good, following the 2nd tutorial I've problems only in the final command, when I must to launch telnet for testing the correct status.

I want to say thanks in advance for your support, and say sorry if my English is not perfect, cause I come from Italy.

falko
19th July 2008, 23:14
Are there any errors in your mail log?

Vic Steele
20th July 2008, 23:45
On /var/log/mail.log there are many rows like these:

Jul 20 22:37:22 fitpc postfix/proxymap[17257]: warning: request for unapproved table: "unix:passwd.byname"
Jul 20 22:37:22 fitpc postfix/proxymap[17257]: warning: to approve this table for proxymap access, list proxy:unix:passwd.byname in main.cf:proxy_read_maps
Jul 20 22:37:22 fitpc postfix/smtpd[17255]: fatal: proxymap service is not configured for table "unix:passwd.byname"
Jul 20 22:37:22 fitpc postfix/proxymap[17257]: warning: request for unapproved table: "mysql:/etc/postfix/mysql-virtual_forwardings.cf"
Jul 20 22:37:22 fitpc postfix/proxymap[17257]: warning: to approve this table for proxymap access, list proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf in main.cf:proxy_read_maps
Jul 20 22:37:22 fitpc postfix/cleanup[17256]: fatal: proxymap service is not configured for table "mysql:/etc/postfix/mysql-virtual_forwardings.cf"
Jul 20 22:37:23 fitpc postfix/master[2487]: warning: process /usr/lib/postfix/smtpd pid 17255 exit status 1
Jul 20 22:37:23 fitpc postfix/master[2487]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
Jul 20 22:37:23 fitpc postfix/master[2487]: warning: process /usr/lib/postfix/cleanup pid 17256 exit status 1
Jul 20 22:37:23 fitpc postfix/master[2487]: warning: /usr/lib/postfix/cleanup: bad command startup -- throttling

falko
21st July 2008, 18:29
Can you post your /etc/postfix/main.cf?

Vic Steele
27th July 2008, 22:44
Of course:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# 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

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_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 = "domain.dyndns".org
mydomain = "domain.dyndns".org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = "domain.dyndns".org, localhost."domain.dyndns".org, localhost
relayhost = mail.tin.it
mynetworks = 127.0.0.0/8
mailbox_command =
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_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, 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_logevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/
content_filter = amavis:[127.0.0.1]:10024
mailbox_command = /usr/bin/spamc | procmail -a "$EXTENSION"
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains = lists.vicsteele.org
mailman_destination_recipient_limit = 1
virtual_maps = hash:/etc/postfix/virtual
mynetworks_style = host
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps =

In "domain.dyndns" there is my real domain name selected on dyndns.org.

falko
28th July 2008, 15:55
Please run
postconf -e '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'
and restart Postfix.

Vic Steele
29th July 2008, 01:54
You're the boss! Now it seems to work (it responds to telnet, I must try enough the rest, but that's all I need for now).
Thank you so much.

Mariusz_S
24th November 2009, 23:55
You're the boss!! :)

Now it seems to work

Thank you so much.

jonasgreatguide
26th November 2009, 14:31
Thanks a lot.
This is very helpful.

jetfix
16th November 2010, 15:24
Can you please help me Falko? I'm playing around this postfix-game along one month ... and can't get it to work correctly!

I can send and receive emails to the world from real linux accounts ... but can't use squirrelmail or use virtual accounts


/var/log/mail.log says:

Nov 16 08:10:54 mail authdaemond: SQL query: SELECT email, password, "", 5000, 5000, "/home/vmail", CONCAT(SUBSTRING_INDEX(email,'@',1),'/',SUBSTRING_INDEX(email,'@',1),'/'), "", "", "" FROM users WHERE email = 'ghost@mail.helpdesk.in.ua'
Nov 16 08:10:54 mail authdaemond: zero rows returned
Nov 16 08:10:54 mail authdaemond: no password available to compare
Nov 16 08:10:54 mail authdaemond: authmysql: REJECT - try next module



and my configuration files are these:

/etc/postfix/main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = /usr/share/doc/postfix

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/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


myhostname = mail.helpdesk.in.ua
mydomain = helpdesk.in.ua

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost, localhost.helpdesk.in.ua, helpdesk.in.ua, mail.helpdesk.in.ua
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

tml_directory = /usr/share/doc/postfix/html

virtual_alias_domains =
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

smtpd_sasl_authenable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $vir$
smtpd_sasl_auth_enable = yes

P.S. I'm not using forwarding or quotas ...



/etc/courier/audaemondrc

authmodulelist="authmysql"
daemons=5
authdaemonvar=/var/run/courier/authdaemon
DEBUG_LOGIN=2



/etc/courier/authmysqlrc

MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD :))))))))))
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',1),'/',SUBSTRING_INDEX(email,'@',1),'/')


what else? any ideas? I really don't understand why authdaemond does such a strange SQL query as I posted in the beginning of my reply...


Please help if you will.

falko
18th November 2010, 14:47
/etc/courier/authmysqlrc must look as follows:

MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD mail_admin_password
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
#MYSQL_NAME_FIELD
MYSQL_QUOTA_FIELD quota

giannileggio
5th December 2010, 12:48
Hello, i have the same problem of the first post of this thread.
Postfix is running, my tail /var/log/maillog in empty

telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.


netstat -anp | grep 'LISTEN ' | grep :25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 3734/master
tcp 0 0 :::25 :::* LISTEN 3734/master

nmap localhost

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2010-12-05 07:51 EST
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1670 closed ports
PORT STATE SERVICE
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop3
143/tcp open imap
783/tcp open spamassassin
953/tcp open rndc
993/tcp open imaps
995/tcp open pop3s
3306/tcp open mysql


Can you help me, please? Thank you

jetfix
5th December 2010, 12:52
Postfix doesn't use /var/log/maillog .. instead take a look at these:

/var/log/mail.log
/var/log/mail.info
/var/log/mail.err

giannileggio
5th December 2010, 12:57
I don't have these files on my server
(i searched in /var/log and with 'locate' command)

jetfix
5th December 2010, 13:02
???? I don't know why.... authdaemonrc file find and set next parametr value:

DEBUG_LOGIN=2

... this will give you detailed repost .. may be nothing hapends and that's why no files are being created ... also after making this setting take a look at /var/log/syslog .. it may also hold some information... go&conquer)))

jetfix
5th December 2010, 13:03
and another one..that I'm thinking of ...you may have a mistake in your mysql_virtual ... files .. check if everything (especialy username for mysql) correct in these files.

giannileggio
5th December 2010, 13:08
Thanks for your help
My log files are still empty, all of them (i setted the debug_login = 2)

Now i'll go to check mysql configurations files

giannileggio
5th December 2010, 18:12
I checked mysql configurations and are right.

jetfix
5th December 2010, 18:13
So .. is it working now ?

giannileggio
5th December 2010, 18:16
No, I'm still at the same point.

I can telnet pop3 and imap but i can't reach postfix on port 25 :(

jetfix
5th December 2010, 18:18
Are you wokring from outside of your network? Check if your 25 port is not filtered somehow ... if you running Linux on your client machine .. do this: nmap "yourserveripgoeshere" ...it will show you if your 25 port blocked or not.

giannileggio
5th December 2010, 18:23
As you can in my previous posts the port seems to be opened

I can try to telnet on localhost or from outside, the result is the same

telnet localhost 25

telnet serverip 25

jetfix
5th December 2010, 18:26
I just don't know how you sure in this information ... if I see (without your IP) ... the result of nmap command ... than we can continue our conversation .. otherwise .. I can't locate an issue.

giannileggio
5th December 2010, 18:30
This is the ip 94.141.20.33 (the mail server will be mail.giannileggio.com)

Thank you for your help

jetfix
5th December 2010, 18:33
ok ... everything is ok with ports ..here is result of nmap

Not shown: 991 filtered ports
PORT STATE SERVICE
21/tcp closed ftp
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop3
143/tcp open imap
443/tcp closed https
8080/tcp closed http-proxy
10000/tcp closed snet-sensor-mgmt

giannileggio
5th December 2010, 22:46
At the moment I solved using iRedmail, postfix si working now.
Tomorrow I'll check all the other services

jetfix
6th December 2010, 00:00
I'll be glad to go along your issue solving process .. because I have my postfix not functioning completely right))) need few more things to have full-featured mail server.