LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 06-14-2008, 03:49 PM   #1
alitrix
Member
 
Registered: Jun 2003
Location: Netherlands, The
Distribution: Ubuntu, Kernel 2.6.7
Posts: 169

Rep: Reputation: 30
Postfix Relay access denied outgoing mail


Hi ppl,

I'm having a little problem with postfix. For some reason it doesn't work correct (or Outlook is just stupid).

Here is what I have.

/etc/postfix/main.cf
Code:
# 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 (Debian/GNU)
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 = 4h

# 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:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_auth_destination,
        reject_unauth_destination

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = LGG001.server.server
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = LGG001.server.server, localhost.server.server, localhost, telefoomwebsites.nl
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
local_recipient_maps =

relay_recipient_maps = hash:/etc/postfix/relay_recipients

virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains
/etc/postfix/virtual_mailbox_domains
Code:
@telefoomwebsites.nl            OK
/etc/postfix/relay_recipients
Code:
@telefoomwebsites.nl            OK
All looks oke, I can receive mail if someone sends to alitrix@telefoomwebsites.nl (alitrix = local user)

But when I try to mail from Outlook (through IMAP, dovecot) with alitrix@telefoomwebsites.nl to alitrix@gmail.com, they annoying part starts. It gives me a relay access denied all the time.

Log:
Code:
==> mail.log <==
Jun 14 21:46:44 LGG001 postfix/smtpd[14940]: connect from h892203016.dsl.speedlinq.nl[89.220.3.16]
Jun 14 21:46:44 LGG001 postfix/smtpd[14940]: NOQUEUE: reject: RCPT from h892203016.dsl.speedlinq.nl[89.220.3.16]: 554 5.7.1 <alitrix@gmail.com>: Relay access denied; from=<alitrix@telefoomwebsites.nl> to=<alitrix@gmail.com> proto=ESMTP helo=<AliPC>

==> mail.info <==
Jun 14 21:46:44 LGG001 postfix/smtpd[14940]: connect from h892203016.dsl.speedlinq.nl[89.220.3.16]
Jun 14 21:46:44 LGG001 postfix/smtpd[14940]: NOQUEUE: reject: RCPT from h892203016.dsl.speedlinq.nl[89.220.3.16]: 554 5.7.1 <alitrix@gmail.com>: Relay access denied; from=<alitrix@telefoomwebsites.nl> to=<alitrix@gmail.com> proto=ESMTP helo=<AliPC>
What could be the reason?
telefoomwebsites.nl is listed in mydestination, in 2 hash-tables. I did that too be sure it's I'm not missing any table.

Btw, if I add gmail.com into mydestination, it works fine.



Strange part
If I telnet myself and build up a email, it works fine?

Console
Code:
alitrix@LGG001:~$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 LGG001.server.server ESMTP Postfix (Debian/GNU)
EHLO test.linuxquestions.org
250-LGG001.server.server
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: alitrix@telefoomwebsites.nl
250 2.1.0 Ok
RCPT TO: alitrix@gmail.com
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Testing
.
250 2.0.0 Ok: queued as 2B5A2200FA
It's like Outlook is doing a RCPT FROM and postfix doesn't like that?

I'm using Outlook 2007
 
Old 06-14-2008, 04:10 PM   #2
alitrix
Member
 
Registered: Jun 2003
Location: Netherlands, The
Distribution: Ubuntu, Kernel 2.6.7
Posts: 169

Original Poster
Rep: Reputation: 30
Oke, I've found out why telnet was working.
Because that was localhost :$

I'm telnetting from another host, I get this:
Code:
alitrix@xx:~$ telnet telefoomwebsites.nl 25
Trying 85.17.221.48...
Connected to telefoomwebsites.nl.
Escape character is '^]'.
220 LGG001.server.server ESMTP Postfix (Debian/GNU)
EHLO AliPC
250-LGG001.server.server
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: alitrix@telefoomwebsites.nl
250 2.1.0 Ok
RCPT TO: alitrix@gmail.com
554 5.7.1 <alitrix@gmail.com>: Relay access denied
I guess this means the IP where I'm connected from isn't added in mynetworks.
But that's rediculus (if I typed it correct ). That means I have to add all the IPs that are gonna use the mailserver :s?

Thought mydestination only relay's mail that are listed and everything else is rejected (so spammers cant use my smtp-server as a relay-box)
Am I correct?
 
Old 06-14-2008, 04:38 PM   #3
alitrix
Member
 
Registered: Jun 2003
Location: Netherlands, The
Distribution: Ubuntu, Kernel 2.6.7
Posts: 169

Original Poster
Rep: Reputation: 30
Fixed it with SASL

If you are having the same problem, try this link:
http://www.jimmy.co.at/weblog/?p=52

This will explain you how simple it is to install SASL (PAM) + postfix

Good luck
 
  


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: Relay access denied whenever sending e-mail Doug52392 Linux - Server 1 11-11-2007 05:21 AM
Postfix Relay Access Denied dwpondscum Linux - Networking 2 09-20-2007 05:37 AM
Postfix as a mail relay (getting relay access denied) hypexr Linux - Software 3 09-13-2005 08:15 PM
Postfix and Relay access denied jamiguel77 Linux - Software 3 03-12-2005 11:53 AM
postfix: Relay access denied SolidSnake Linux - Networking 4 02-20-2004 10:05 PM


All times are GMT -5. The time now is 04:06 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration