Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postfix smtp: relay access denied, local mail works
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Thu Jun 07, 2007 5:09 pm    Post subject: postfix smtp: relay access denied, local mail works Reply with quote

Hi,

I have a final problem with my postfix mailserver setup. I followed the virtual mailhosting howto and got it running so far. Local email is working, so is squirrelmail webmail frontend. I can send Emails to other Email servers on the internet (tested with web.de address and address at work) using squirrelmail and mail or mutt on the mailserver.

I can access virtual mail accounts via imap and pop3 with thunderbird or mutt. I also can send emails to virtual email accounts on the mailserver using smtp auth and tls using remote mail clients.

What I cannot do, is send Emails to non-mailserver addresses using thunderbird or mutt on remote computers.
Code:

Webserver answered: 5.7.1 <destination>: Relay access denied.


Help, I am stuck.

I can provide configuration if necessary, but as local mailing works, I think it is a more basic problem than just a typo. :roll:

If anybody could help, I would appreciate it.

fangorn
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Thu Jun 07, 2007 8:55 pm    Post subject: Reply with quote

Sounds like a typo :-)

It's your smtpd_x_restrictions that are lacking. Post just that bit of main.cf and no comments.
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Fri Jun 08, 2007 6:04 am    Post subject: Reply with quote

Code:

smtpd_sasl_auth_enable = yes
smtpd_sasl2_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain = $myhostname

smtpd_sender_restrictions =
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        reject_unauth_destination

smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_use_tls = yes
smtpd_tls_auth_only = yes
smtpd_tls_key_file = /etc/postfix/newreq.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Sat Jun 09, 2007 8:27 am    Post subject: Reply with quote

Config looks ok although I'm not sure what this bit is achieving - smtpd_sender_restrictions =

I'd say you are not authenticating. This is why remote clients can only send to (virtual) users on the server. Check the logs and turn up the verb if need be.
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Sun Jun 10, 2007 2:30 pm    Post subject: Reply with quote

Thanks for checking.

Code:
Jun 10 16:06:04 servername postfix/smtpd[19538]: NOQUEUE: reject: RCPT from <dynamic_adress_t-online.de>: 554 5.7.1 <username@web.de>: R
elay access denied; from=<sender_adress> to=<username@web.de> proto=ESMTP helo=<[192.168.0.9]>
Jun 10 16:06:04 servername postfix/smtpd[19539]: generic_checks: name=reject_unauth_destination status=2
Jun 10 16:06:04 servername postfix/smtpd[19539]: > <dynamic_adress_t-online.de>: 554 5.7.1 <username@web.de>: Relay access denied


I think this
Code:
helo=<[192.168.0.9]>

is the problem. The machine I am writing this mail on is not connected directly to the internet, it connects over a router. Its real (internal) IP adress gets submitted.

Is there a possibilty to avoid this?

Thanks again,
fangorn
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Mon Jun 11, 2007 5:00 am    Post subject: Reply with quote

No, it's not that. Here are the restrictions you have -

Code:
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        reject_unauth_destination


First one to 'pass' skips the rest. So once a person is sasl auth then they miss the next 2. However, the snippet from the log shows an unauth destination being rejected, which is the final rule. Therefore SASL auth is not happening.
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Mon Jun 11, 2007 6:44 pm    Post subject: Reply with quote

So I have to look in to authentication settings on server and client. Thank you, that is a starting point.
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Mon Jun 11, 2007 7:11 pm    Post subject: Reply with quote

Telnet to port 25 on the mailserver and shoot it an EHLO.

Look for the auth bits

[/code]
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
>> 250-AUTH PLAIN LOGIN
>> [/code]250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
QUIT
[code]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum