LinuxQuestions.org
Visit Jeremy's Blog.
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 03-13-2008, 07:06 PM   #1
ellion0815
LQ Newbie
 
Registered: Mar 2008
Location: Cologne
Distribution: ArchLinux, Debian Etch
Posts: 5

Rep: Reputation: 0
"Relay acces denied" when trying to send an email to the host (postfix)


Hi there,

I found a lot of sites regarding "relay access denied", but nothing for this particular problem. Which is as follows:

Im using postfix and dovecot with virtual users and domains stored in a mysql-db. Reading mails via imap and pop3 aswell as sending mails to other hosts works like a charm with my mail client. What doesnt is sending mails to my host from another smtp server. Then I get "relay access denied". Using telnet on localhost and using anything for "mail from" and an existing virtual user as rcpt to works. I just cant figure out why. mail.log doesnt say anything about this, clearing it and then sending a mail doesnt append any line


My postfix config looks like this:
Code:
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 = ipv4
mailbox_size_limit = 0
mydestination = lvps87-230-92-40.dedicated.hosteurope.de, localhost
myhostname = lvps87-230-94-105.dedicated.hosteurope.de
mynetworks = 127.0.0.0/8, 87.230.94.105/32
myorigin = /etc/mailname
recipient_delimiter = +
relayhost = localhost
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem
smtpd_tls_key_file = /etc/ssl/private/postfix.pem
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000
I thought reject_unauth_destination in smtpd_recipient_restrictions should allow any mails for any exisiting virtual user. The user definetly exists and using telnet on localhost does this job fine, just with a mail client from outside it doesnt

Im tired as hell so I guess Im missing something here, hope you can point me to the right direction


Thanks in advance,
daniel

Last edited by ellion0815; 03-13-2008 at 07:09 PM.
 
Old 03-13-2008, 07:37 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I'm not sure if this is part of the problem, but why did you set relayhost=localhost? I'd comment that line out.
 
Old 03-14-2008, 03:56 AM   #3
ellion0815
LQ Newbie
 
Registered: Mar 2008
Location: Cologne
Distribution: ArchLinux, Debian Etch
Posts: 5

Original Poster
Rep: Reputation: 0
ah no, that was just one of my desperate tries yesterday Disregard that
 
Old 03-14-2008, 04:08 AM   #4
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
OK, so what's with virtual transport = dovecot?

Dovecot is an imap/pop server, not a transfer agent
 
Old 03-14-2008, 04:10 AM   #5
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
While you're at it, have a good read of http://www.postfix.org/VIRTUAL_README.html
 
Old 03-14-2008, 04:14 AM   #6
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
Am guessing the domains are not being pulled from the sql database.
 
Old 03-14-2008, 04:21 AM   #7
ellion0815
LQ Newbie
 
Registered: Mar 2008
Location: Cologne
Distribution: ArchLinux, Debian Etch
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by billymayday View Post
OK, so what's with virtual transport = dovecot?

Dovecot is an imap/pop server, not a transfer agent
No, you can use dovecot for delivering. I put this into my master.cf
"dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}"


As I said, sending and receiving works, sending mails to my host jsut works locally, so it has to be something about virtual_domains I guess. Im currently making a hashfile out of it to check.

My mysql-virtual-mailbox-domains.cf:
Code:
# mysql connection stuff
query = SELECT 1 FROM virtual_domains WHERE name='%s'
and mysql-virtual-alias-domains.cf:

Code:
query = SELECT 1 FROM virtual_domains WHERE name='%s'
It seems like postfix thinks it isnt responsible for this domain, however, querying these with postmap -q works

Last edited by ellion0815; 03-14-2008 at 04:26 AM.
 
Old 03-14-2008, 04:57 AM   #8
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Fair cop on the dovecot - you learn something every day
 
Old 03-14-2008, 06:31 AM   #9
ellion0815
LQ Newbie
 
Registered: Mar 2008
Location: Cologne
Distribution: ArchLinux, Debian Etch
Posts: 5

Original Poster
Rep: Reputation: 0
aargh - okay, forget it. I was definetly too tired yesterday. Wasnt a postfix or dovecot issue, I forgt the mx entries for my domains

sorry for the inconvenience :/
 
Old 03-14-2008, 07:23 AM   #10
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by ellion0815 View Post
aargh - okay, forget it. I was definetly too tired yesterday. Wasnt a postfix or dovecot issue, I forgt the mx entries for my domains

sorry for the inconvenience :/
Doh! That should always be the first step. Setup Mailserver, dig domain.com MX to verify the MX records, then proceed with testing..
 
Old 03-14-2008, 07:27 AM   #11
ellion0815
LQ Newbie
 
Registered: Mar 2008
Location: Cologne
Distribution: ArchLinux, Debian Etch
Posts: 5

Original Poster
Rep: Reputation: 0
The stupidest part about this is: I have about 100 mailer daemon mails in my inbox which say in the last line:

Quote:
Remote-MTA: dns; mx00.udag.de
well, that isnt my host ......


At least you people have a good laugh
 
  


Reply

Tags
daemon, dovecot, postfix, relay, smtp


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" cant send to other domain Proxx Linux - Server 6 01-11-2008 09:10 AM
Postfix "554 Relay access denied" alexpopescu Linux - Software 1 10-17-2005 03:22 AM
Postfix - "Relay Access Denied" clickster Linux - Software 1 09-12-2005 04:28 PM
Unable to send email "Relaying denied" ejain Linux - Software 3 05-30-2005 09:31 AM
Email Error - "Recipient address rejected: Relay access denied" ripcord Linux - Newbie 1 10-31-2002 03:00 PM


All times are GMT -5. The time now is 01:45 AM.

Main Menu
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