LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-16-2009, 07:42 AM   #1
kalinic
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Rep: Reputation: 0
postfix - relayhost configuration problem


I've got postfix installed with smtpd on a server thats also a web server.
I am also trying to use this server as a mail server so the php mail() function can be used on the web pages.

So far no emails have come trough so I ploughed trough log files, and in /var/log/mail.warn I'm getting:

Feb 13 13:54:01 STINTR01 postfix/smtp[22155]: warning: relayhost configuration problem

Postfix is set to:
General type of mail configuration: 'Internet site'
System mail name: 'Localhost'
Local networks: <my server's IP>/32 [fe80::221:9bff:fefb:2847%eth0]/128
Use procmail for local delivery? No

I've been trying to get this thing to work for 5 days now, any help appreciated!
 
Old 02-16-2009, 03:48 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
can we see the actual configuration files please?
 
Old 02-17-2009, 04:15 AM   #3
kalinic
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Postfix config file (/etc/postfix/main.cf)

# 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 (Ubuntu)
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 = 1h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination =
relayhost =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
mynetworks_style = host
inet_protocols = all
myorigin = /etc/mailname
mailbox_command =
mynetworks = 172.0.0.0/8

I would also get this in the Log file (/var/log/mail.warn)
Feb 13 13:54:01 STINTR01 postfix/smtp[22155]: warning: relayhost configuration problem

I've had the relayhost set both as it is now, and localhost. None apparently worked. I've since tried to telnet via port 25 to and from the ubuntu server, and it connected both ways.

Thanks for your help!
 
Old 02-17-2009, 05:22 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Comment relayhost out. It's only used if you want to relay via a specific server, which apparently you don't.
Code:
relayhost (default: empty)

    The next-hop destination of non-local mail; overrides non-local domains in recipient addresses. This information is overruled with relay_transport, default_transport, sender_dependent_relayhost_maps and with the transport(5) table.

    On an intranet, specify the organizational domain name. If your internal DNS uses no MX records, specify the name of the intranet gateway host instead.

    In the case of SMTP, specify a domain name, hostname, hostname:port, [hostname]:port, [hostaddress] or [hostaddress]:port. The form [hostname] turns off MX lookups.

    If you're connected via UUCP, see the UUCP_README file for useful information.

    Examples:

    relayhost = $mydomain
    relayhost = [gateway.my.domain]
    relayhost = uucphost
    relayhost = [an.ip.add.ress]
 
Old 02-18-2009, 05:08 AM   #5
kalinic
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
I commented the relayhost out.

Now I get this in /var/log/mail.info:

Feb 18 09:07:31 STINTR01 postfix/smtp[31166]: 677D41A83AA: to=<webmaster@domainame.com>, relay=none, delay=0.03, delays=0.03/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=domainame.com type=AAAA: Host found but no data record of requested type)
Feb 18 09:07:31 STINTR01 postfix/qmgr[31126]: 677D41A83AA: removed

(I've changed the bits in red as I didn't want everyone on the forum to see them. They are from a valid email address.)

Any idea what this log means?
i.e. what could be at fault for the status=bounced (Host or domain name not found.?

Thanks a lot for your help by the way!
 
Old 02-18-2009, 05:08 AM   #6
kalinic
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
I commented the relayhost out.

Now I get this in /var/log/mail.info:

Feb 18 09:07:31 STINTR01 postfix/smtp[31166]: 677D41A83AA: to=<webmaster@domainame.com>, relay=none, delay=0.03, delays=0.03/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=domainame.com type=AAAA: Host found but no data record of requested type)
Feb 18 09:07:31 STINTR01 postfix/qmgr[31126]: 677D41A83AA: removed

(I've changed the bits in red as I didn't want everyone on the forum to see them. They are from a valid email address.)

Any idea what this log means?
i.e. what could be at fault for the status=bounced (Host or domain name not found.?

Thanks a lot for your help by the way!
 
Old 02-18-2009, 03:03 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I take it domainname.com is your domain.

Set "mydestination = domainname.com, localhost.domainname.com, localhost"

and see how you go
 
Old 02-19-2009, 10:16 AM   #8
kalinic
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
It seems that at this point whatever I do, in /var/log/mail.info I get:

status=bounced (Host or domain name not found. Name service error for name=<domain.com> type=AAAA: Host found but no data record of requested type)
 
Old 02-19-2009, 04:39 PM   #9
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I suspect that this is a DNS issue, but not absolutely sure.

Start by looking at you /etc/hosts file. If there is no reference to domain.com in there, add a line at the end (don't change anything else) along the lines of:

127.0.0.1 domain.com

if that doesn't fix it, can you post a few more lines around the error from the log, and the output of "postconf -n"
 
Old 02-20-2009, 12:17 PM   #10
kalinic
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
These are the contents of my /etc/hosts file:

127.0.0.1 localhost
127.0.1.1 STINTR01

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

This is the output of "postconf -n":

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = all
mailbox_command =
mailbox_size_limit = 0
mydestination = $myhostname localhost.$mydomain $mydomain
myhostname = localhost
mynetworks = 172.0.0.0/8
mynetworks_style = host
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
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

You guys r great, thanks for the help!
 
Old 02-20-2009, 02:45 PM   #11
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
So is it working now?

Edit - if not, try adding that line to hosts

Last edited by billymayday; 02-20-2009 at 03:27 PM.
 
Old 02-23-2009, 04:16 AM   #12
kalinic
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Added 2 lines to /etc/hosts
127.0.0.1 intradev.<domain.com>
127.0.0.1 intranet.<domain.com>

Which are the domains as specified as virtualhosts.

Still getting this in /var/logs/mail.info:
status=bounced (Host or domain name not found. Name service error for name=<domain.com> type=AAAA: Host found but no data record of requested type)

This is becoming rather annoying!

Thanks for your help!

Last edited by kalinic; 02-24-2009 at 04:23 AM.
 
Old 02-23-2009, 04:52 AM   #13
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Are you sending to that address rather than receiving? Sounds like a DNS problem rather than anything to do with Postfix.

What does "nslookup <domain.com>" return?

What's in /etc/resolv.conf?

Last edited by billymayday; 02-24-2009 at 05:26 AM.
 
Old 02-23-2009, 05:07 AM   #14
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
records for that domain look fine for me.
 
Old 02-23-2009, 02:20 PM   #15
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Deleted post

Last edited by billymayday; 02-24-2009 at 05:37 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix relayhost configuration (SMTPS) rutgerw Linux - Server 3 02-19-2011 03:02 AM
Postfix relayhost or direct deliver john.dixon Linux - Server 2 10-30-2008 09:44 AM
postfix relayhost gabsik Linux - Networking 1 02-08-2007 03:51 AM
postfix configuration problem kryptonite0110 Linux - Software 0 12-11-2005 11:29 PM
Postfix configuration problem ricky_ds Linux - Software 2 04-14-2005 07:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration