LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix Relay access denied outgoing mail (https://www.linuxquestions.org/questions/linux-server-73/postfix-relay-access-denied-outgoing-mail-649306/)

alitrix 06-14-2008 02:49 PM

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

alitrix 06-14-2008 03:10 PM

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 :p). 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?

alitrix 06-14-2008 03:38 PM

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


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