0

I'm having trouble configuring the postfix server, currently when I issue: telnet myhost 25 outputs:

[root@******** init.d]# telnet localhost 25
Trying 127.0.0.1...
Connected to host-********* (127.0.0.1).
Escape character is '^]'.

And I'm not receiving 220 line.

This is my main.cnf

# SOFT BOUNCE
#

# LOCAL PATHNAME INFORMATION
#

queue_directory = /var/spool/postfix

# The command_directory parameter specifies the location of all
# postXXX commands.
#
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix

# QUEUE AND PROCESS OWNERSHIP
#

mail_owner = postfix

# INTERNET HOST AND DOMAIN NAMES
#
myhostname = mail.xxxxxxxxxx.com
mydomain = xxxxxxxxxx.com

# SENDING MAIL
#

# RECEIVING MAIL
#
inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

# REJECTING MAIL FOR UNKNOWN LOCAL USERS
#
#unknown_local_recipient_reject_code = 550

# TRUST AND RELAY CONTROL
#

mynetworks = 192.168.0.0/16, 127.0.0.0/8
#relay_domains = $mydestination
relay_domains = /etc/postfix/relaydomains
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf

# INTERNET OR INTRANET
#

# REJECTING UNKNOWN RELAY USERS
#

# ADDRESS REWRITING
#

# ADDRESS REDIRECTION (VIRTUAL DOMAIN)
#

# "USER HAS MOVED" BOUNCE MESSAGES
#

# TRANSPORT MAP
#

# ALIAS DATABASE
#
#alias_maps = dbm:/etc/aliases
alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases

# ADDRESS EXTENSIONS (e.g., user+foo)
#

# DELIVERY TO MAILBOX
#


# JUNK MAIL CONTROLS
# 


# FAST ETRN SERVICE
#

# SHOW SOFTWARE VERSION OR NOT
#
# PARALLEL DELIVERY TO THE SAME DESTINATION
#

# DEBUGGING CONTROL
#

debug_peer_level = 2
debug_peer_list = 127.0.0.1
#debug_peer_list = some.domain

# INSTALL-TIME CONFIGURATION INFORMATION
#
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man

sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES

virtual_alias_domains = mynaturalcure.com
#virtual_alias_maps = hash:/etc/postfix/virtual

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf,
                regexp:/etc/postfix/virtual_regexp
virtual_mailbox_base = /home/vmail
virtual_transport = virtual
virtual_uid_maps = static:89
virtual_minimum_uid = 89
#dovecot_destination_recipient_limit = 1

# authentication
#
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname

master.cf

#
# Postfix master process configuration file.  For details on the format
# of the file, see the Postfix master(5) manual page.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd -v -v -D
#  -o content_filter=smtp-amavis:127.0.0.1:10024
#  -o receive_override_options=no_address_mappings
#submission inet n      -       n       -       -       smtpd
#       -o smtpd_etrn_restrictions=reject
#       -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# smtps    inet  n       -       n       -       -       smtpd -v -v -D
#  -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission   inet    n       -       n       -       -       smtpd
#  -o smtpd_etrn_restrictions=reject
#  -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628      inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
  -o content_filter= 
  -o receive_override_options=no_header_body_checks
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       n       -       -       smtp -v -v -D
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       n       -       -       smtp
        -o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix  -       n       n       -       -       pipe
  flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
cyrus     unix  -       n       n       -       -       pipe
  user=cyrus argv=/usr/lib/cyrus-imapd/deliver -r ${sender} -m ${extension} ${user}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
#
# spam/virus section
#
smtp-amavis  unix  -    -       y       -       2       smtp
#  -o smtp_data_done_timeout=1200
#  -o disable_dns_lookups=yes
  -o smtp_send_xforward_command=yes
#127.0.0.1:10025 inet n  -       y       -       -       smtpd
#  -o content_filter=
#  -o smtpd_helo_restrictions=
#  -o smtpd_sender_restrictions=
#  -o smtpd_recipient_restrictions=permit_mynetworks,reject
#  -o mynetworks=127.0.0.0/8
#  -o smtpd_error_sleep_time=0
#  -o smtpd_soft_error_limit=1001
#  -o smtpd_hard_error_limit=1000
#  -o receive_override_options=no_header_body_checks
#  -o smtpd_bind_address=127.0.0.1
#  -o smtpd_helo_required=no
#  -o smtpd_client_restrictions=
#  -o smtpd_restriction_classes=
#  -o disable_vrfy_command=no
#  -o strict_rfc821_envelopes=yes
#
2
  • if there is a configuration problem you should see it in your maillog... what does it say there?
    – Gryphius
    Jan 15, 2013 at 16:25
  • The maillog is empty, can you tell me how to configure it ? Jan 15, 2013 at 16:32

2 Answers 2

1

You have scrambled the config quite thoroughly for a beginner; this means any number of things can go wrong.
Start by verifying that postfix is actually listening on port 25; netstat -plnt |grep master should show port 25 on either all IPs or a single IP.

If you had the bad fortune to touch master.cf too, you may have messed things up further than is visible here ;)

I suggest you undo most of that damage and follow the official documentation on how to configure TLS and SASL:

http://www.postfix.org/TLS_README.html
http://www.postfix.org/SASL_README.html

11
  • The master is listening: [root@host-xxx-xxx-xxx-xxx log]# netstat -plnt |grep master tcp 0 0 127.0.0.1:465 0.0.0.0:* LISTEN 3130/master tcp 0 0 xxx.xxx.xxx.xxx:465 0.0.0.0:* LISTEN 3130/master tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3130/master tcp 0 0 xxx.xxx.xxx.xxx:25 0.0.0.0:* LISTEN 3130/master Jan 16, 2013 at 10:08
  • You're using SMTPS; please don't, use STARTTLS instead, as documented.
    – adaptr
    Jan 16, 2013 at 10:10
  • I commented SMTPS, now it's not listening on 465. What to do next, cause using telnet I don't get response to any command still ? Jan 16, 2013 at 10:20
  • If postfix is listening on port 25 and telnet does not respond, you have a non-postfix issue. Try stopping postfix and telnetting; it should tell you the port is closed.
    – adaptr
    Jan 16, 2013 at 10:26
  • But when I connect e.g from Thunderbird it gives me timeout when sending mail. And when I stop the postfix daemon, the telnet session closes, which is normal. Jan 16, 2013 at 10:30
0

From the documentation it appears that smtpd_banner requires at least $myhostname be included.

"You MUST specify $myhostname at the start of the text. This is required by the SMTP protocol."

From: http://www.postfix.org/postconf.5.html#smtpd_banner

You don't have this in your current configuration.

1
  • 1
    I added it: smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) But I still don't see the banner, telnet just sits there. Jan 15, 2013 at 16:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .