Ubuntu This forum is for the discussion of Ubuntu Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
02-16-2009, 07:42 AM
|
#1
|
LQ Newbie
Registered: Feb 2009
Posts: 10
Rep:
|
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!
|
|
|
02-16-2009, 03:48 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
can we see the actual configuration files please?
|
|
|
02-17-2009, 04:15 AM
|
#3
|
LQ Newbie
Registered: Feb 2009
Posts: 10
Original Poster
Rep:
|
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!
|
|
|
02-17-2009, 05:22 AM
|
#4
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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]
|
|
|
02-18-2009, 05:08 AM
|
#5
|
LQ Newbie
Registered: Feb 2009
Posts: 10
Original Poster
Rep:
|
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!
|
|
|
02-18-2009, 05:08 AM
|
#6
|
LQ Newbie
Registered: Feb 2009
Posts: 10
Original Poster
Rep:
|
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!
|
|
|
02-18-2009, 03:03 PM
|
#7
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
I take it domainname.com is your domain.
Set "mydestination = domainname.com, localhost.domainname.com, localhost"
and see how you go
|
|
|
02-19-2009, 10:16 AM
|
#8
|
LQ Newbie
Registered: Feb 2009
Posts: 10
Original Poster
Rep:
|
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)
|
|
|
02-19-2009, 04:39 PM
|
#9
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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"
|
|
|
02-20-2009, 12:17 PM
|
#10
|
LQ Newbie
Registered: Feb 2009
Posts: 10
Original Poster
Rep:
|
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!
|
|
|
02-20-2009, 02:45 PM
|
#11
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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.
|
|
|
02-23-2009, 04:16 AM
|
#12
|
LQ Newbie
Registered: Feb 2009
Posts: 10
Original Poster
Rep:
|
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.
|
|
|
02-23-2009, 04:52 AM
|
#13
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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.
|
|
|
02-23-2009, 05:07 AM
|
#14
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
records for that domain look fine for me.
|
|
|
02-23-2009, 02:20 PM
|
#15
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
Deleted post
Last edited by billymayday; 02-24-2009 at 05:37 AM.
|
|
|
All times are GMT -5. The time now is 09:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|