Mail not sent unless relayhost has a port number

Bug #769514 reported by Andrew Phillips
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Binary package hint: postfix

A recent release of postfix seems to have a bug where if you don't have a port number on relayhost in /etc/postfix/main.cf, it logs:
Apr 17 05:47:26 complete postfix/smtp[9666]: fatal: unknown service: smtp/tcp

Further, mail is never sent. Everything seems to work when I change main.cf from:
relayhost = smtp.xxx

to:
relayhost = smtp.xxx:25

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: postfix 2.8.2-1ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Sat Apr 23 11:21:10 2011
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_CA.UTF-8
SourcePackage: postfix
UpgradeStatus: Upgraded to natty on 2011-01-08 (104 days ago)

Revision history for this message
Andrew Phillips (theasp) wrote :
Revision history for this message
Scott Kitterman (kitterman) wrote :

That seems to be masking another problem as I just confirmed portless relayhost still works on my Natty system.

Changed in postfix (Ubuntu):
status: New → Incomplete
Revision history for this message
Scott Kitterman (kitterman) wrote :

As the error message says, smtp/tcp is not a valid service type. Find where you set that in your configuration and fix it.

Revision history for this message
windracer (windracer) wrote :

I started having the same problem with postfix after upgrading from Maverick to Natty. I tried the suggestion of adding the port to my relayhost in main.cf and that fixed it, but is that a valid fix? Or, like Scott says, there's something else wrong?

Revision history for this message
Scott Kitterman (kitterman) wrote :

It works for me without a port number, so the bug as written is incorrect. Port number is NOT required. Adding the port number is a workaround for some other issue, so my advice is to figure out what that is.

Revision history for this message
windracer (windracer) wrote :

I agree but can't seem to figure out what it is. It has to be related to postfix not being able to read the services file, but I've confirmed my chroot permissions (for /var/spool/postfix/etc/) seem to be correct and smtp/tcp is in the file. I've tried turning off the chroot jail and the same thing happens (but /etc/services looks fine too) so I'm stuck right now.

Revision history for this message
joni (joni93) wrote :

I'm also experiencing windracers problem after upgrading to natty.
But my problem is i don't use a relayhost ("relayhost = ") so i can't use this "fix".
Haven't changed anything after natty upgrade.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Would someone who has this problem please attach the output of postconf -n to the bug?

Revision history for this message
windracer (windracer) wrote :

Here's mine (some custom values removed):

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
disable_vrfy_command = yes
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = $myhostname, localhost.$mydomain, $mydomain
mydomain = [my domain, original removed]
myhostname = [my hostname, original removed]
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = [my ISP's SMTP server, original removed]:25
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $mydomain ESMTP
smtpd_recipient_limit = 20
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/virtual

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 769514] Re: Mail not sent unless relayhost has a port number

Thanks. I'd also like to see master.cf. Feel free to mail it to me directly
if you'd rather not put it in the bug.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Is anyone that suffers from this bug NOT on amd64?

Revision history for this message
Denny Daugherty (dennyd) wrote :

I am experiencing this issue also with a null client configuration as specified at http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client

myorigin = $mydomain
relayhost = $mydomain
inet_interfaces = loopback-only
local_transport = error:local delivery is disabled

I'm running an Amazon EC2 instance using the current natty AMI from alestic.com

Revision history for this message
windracer (windracer) wrote :
Download full text (5.3 KiB)

I'm on x86_64, not amd64. Here's my master.cf, nothing out of the ordinary, haven't touched it in a while.

#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd
#submission inet n - - - - smtpd
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - - - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - - 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - - - - smtp
 -o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 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 ...

Read more...

Revision history for this message
Scott Kitterman (kitterman) wrote :

amd64 is the architecture name for x86_64.

I suspect this is related to the multiarch changes introduced in 11.04 (which
is why it works for me on i386 and not for others). I've pinged the developer
who did most of the multiarch work and will ask him to investigate.

Revision history for this message
Steve Langasek (vorlon) wrote :

This is because nss_files is in a subdirectory of /lib/ rather than in /lib itself, and therefore gets missed by the script to copy support files into the postfix chroot. Same as bug #764096.

Changed in postfix (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Scott Kitterman (kitterman) wrote :

This has the same root cause as Bug 764096. Hopefully we'll have a resolution soon.

Revision history for this message
windracer (windracer) wrote :

The "patch" to /etc/init.d/postfix referred to in #764096 worked for me. I was able to remove the port from my relayhost parameter. Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.