LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   postfix - relayhost configuration problem (https://www.linuxquestions.org/questions/ubuntu-63/postfix-relayhost-configuration-problem-705030/)

kalinic 02-16-2009 07:42 AM

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!

acid_kewpie 02-16-2009 03:48 PM

can we see the actual configuration files please?

kalinic 02-17-2009 04:15 AM

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!

billymayday 02-17-2009 05:22 AM

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]


kalinic 02-18-2009 05:08 AM

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!

kalinic 02-18-2009 05:08 AM

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!

billymayday 02-18-2009 03:03 PM

I take it domainname.com is your domain.

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

and see how you go

kalinic 02-19-2009 10:16 AM

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)

billymayday 02-19-2009 04:39 PM

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"

kalinic 02-20-2009 12:17 PM

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!

billymayday 02-20-2009 02:45 PM

So is it working now?

Edit - if not, try adding that line to hosts

kalinic 02-23-2009 04:16 AM

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!

billymayday 02-23-2009 04:52 AM

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?

acid_kewpie 02-23-2009 05:07 AM

records for that domain look fine for me.

billymayday 02-23-2009 02:20 PM

Deleted post


All times are GMT -5. The time now is 12:30 AM.