LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 11-08-2009, 07:11 PM   #1
the big cheese
LQ Newbie
 
Registered: Jul 2007
Location: Northern Ireland
Distribution: Ubuntu 8.10 Server
Posts: 8

Rep: Reputation: 0
Postfix/Dovecot email server - can't send emails


Hi guys.

I'm running Ubuntu 8.10 server edition with postfix and dovecot handling my email duties. Currently, I can log in correctly and receive any mail/sync folder (IMAP) but I cannot send mail to any address I care to try.

The error message in the mail log is:
Quote:
postfix/smtpd[4757]: NOQUEUE: reject: RCPT from XX-XXX-XX-XXX.dynamic.dsl.as9105.com[XX.XXX.XX.XXX]: 554 5.7.1 <recipiant@xxxxxxx.co.uk>: Relay access denied; from=<me@mylinuxdomain.co.uk> to=<recipiant@xxxxxxx.co.uk> proto=ESMTP helo=<BigCheeseLaptop>
The output from postconf -n is:
Quote:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
delay_warning_time = 4h
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = mylinuxdomain.co.uk, localhost.mylinuxdomain.co.uk, localhost
mydomain = mylinuxdomain.co.uk
myhostname = mylinuxdomain.co.uk
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth-client
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
Can anyone help me shed some light on this?
 
Old 11-09-2009, 12:50 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
Is this not the remote server telling you to get stuffed, possibly because you're coming from a dynamic IP? Generally you'd be better off looking to always relay outbound mail via your ISP's smtp relay, which hopefully exists. This means that email is directly passed from an official known ISP MTA, not you, meaning it won't be blocked (or at least much less likely). That rejected relay source is tiscali... your ISP I take it? Try making it smart relay through smtp.tiscali.co.uk.

That's how I read it at least, not 100% sure it's that, if not maybe you need to clarify the topology you're using... sending to your MTA over the net instead of locally? Hard to see where the internet domains in the log come into the equation.

Last edited by acid_kewpie; 11-09-2009 at 12:52 PM.
 
Old 11-09-2009, 07:33 PM   #3
the big cheese
LQ Newbie
 
Registered: Jul 2007
Location: Northern Ireland
Distribution: Ubuntu 8.10 Server
Posts: 8

Original Poster
Rep: Reputation: 0
acid_kewpie - thanks for the reply.

What's happening is I'm attempting to send any mail from my laptop at home (Tiscali being my ISP) through my mail client, connected to my linux server.
The linux server is a hosted machine with a static IP address. The IP address in the error message above is of my laptop, not the mail server.
The sending fails in my mail client and I get the error message above in my mail log.

Is it possible it's rejecting my laptop's IP, and not the actual server IP? and therefore that the relay source in my mails is incorrect?
 
Old 11-09-2009, 07:52 PM   #4
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
I don't see any indication that you are authenticating. Is the email program on your laptop configured to send a username/password for SMTP access?
 
Old 11-09-2009, 09:25 PM   #5
the big cheese
LQ Newbie
 
Registered: Jul 2007
Location: Northern Ireland
Distribution: Ubuntu 8.10 Server
Posts: 8

Original Poster
Rep: Reputation: 0
sleddog - yes, it does send a username/password, but I think you may be correct.

I actually think I might have found the issue (potentially). When searching about after acid_kewpie's suggestions, I came across this:
http://ubuntuforums.org/archive/inde...t-1061230.html

Which leads me to believe that my postfix setting:
Quote:
mynetworks = 127.0.0.0/8
may be the cause of my issue.

mynetworks apparently "lists all networks that this machine somehow trusts. This information can be used by the anti-UCE features to recognize trusted SMTP clients that are allowed to relay mail through Postfix."

It's almost 03:30 here though, so I shall try that in the morning...
 
Old 11-09-2009, 11:21 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
well mynetworks will stop anything other than the machine itself sending, depending on how it's used, and normally that would be 127.0.0.1/8,192.168.1.0/24 or something similar to permit local clients. I'm still a bit confused then as to why the logs are reporting inet hostnames as opposed to local data though. If this is all on a home LAN, then mynetworks would want to change, otherwise with authentication (and where does auth come into this... unclear again) then I think you'd want to define smtpd_client_restrictions to cover permit_mynetworks and permit_sasl_authenticated to allow you to send remotely with a username and password and locally without.
 
Old 11-10-2009, 08:18 AM   #7
the big cheese
LQ Newbie
 
Registered: Jul 2007
Location: Northern Ireland
Distribution: Ubuntu 8.10 Server
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Nov 10 12:53:36 servername postfix/smtpd[3869]: connect from xx-xxx-xx-xxx.dynamic.dsl.as9105.com[xx.xxx.xx.xxx]
Nov 10 12:53:36 servername postfix/smtpd[3869]: setting up TLS connection from xx-xxx-xx-xxx.dynamic.dsl.as9105.com[xx.xxx.xx.xxx]
Nov 10 12:53:36 servername postfix/smtpd[3869]: Anonymous TLS connection established from xx-xxx-xx-xxx.dynamic.dsl.as9105.com[xx.xxx.xx.xxx]: TLSv1 with cipher AES128-SHA (128/128 bits)
Nov 10 12:53:36 servername postfix/smtpd[3869]: NOQUEUE: reject: RCPT from xx-xxx-xx-xxx.dynamic.dsl.as9105.com[xx.xxx.xx.xxx]: 554 5.7.1 <recipient@domain.co.uk>: Relay access denied; from=<localname@postfixserver.co.uk> to=<recipent@domain.co.uk> proto=ESMTP helo=<BigCheeseLaptop>
That is the complete log. If that helps at all.
Changing mynetworks to allow all 88.x.x.x addresses didn't seem to change anything.
 
Old 11-10-2009, 08:30 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
It's still vague where you are doing what... don't permit internet ranges in mynetworks, instead you need to authenticate really. Note that the act of authenticating doesn't mean anything in itself, you still need to attach a significance of it having been successful, e.g. the smtpd_client_restrictions directive (as I read the docs at least)
 
Old 11-10-2009, 09:36 AM   #9
the big cheese
LQ Newbie
 
Registered: Jul 2007
Location: Northern Ireland
Distribution: Ubuntu 8.10 Server
Posts: 8

Original Poster
Rep: Reputation: 0
I added the smptd_client_restrictions option as you suggested, but no luck.
There is no sign of authentication in the mail log (when sending a mail) - just an anonymous connection and a relay denial.
My email client is definitely set to send user/pass info, so I'm not sure why there isn't some sort of authentication in the log
 
Old 11-10-2009, 10:33 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
Well are you requesting authentication to take place on the server side?
 
Old 11-10-2009, 11:44 AM   #11
the big cheese
LQ Newbie
 
Registered: Jul 2007
Location: Northern Ireland
Distribution: Ubuntu 8.10 Server
Posts: 8

Original Poster
Rep: Reputation: 0
acid - I finally solved my problem.
The sasl daemon was not running, and therefore failing to authenticate connections.
A little trick with the sasldb2 file and it's now accepting and sending my mail.

Thankyou very much for your help!
 
  


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
using postfix able to send out emails to yahoo accounts but not our own company email jshi99 Linux - Newbie 2 11-12-2008 11:54 AM
how to restrict a user to send mails only to 3 email IDs in postfix mail server sharath41 Linux - Server 1 07-04-2008 03:40 PM
EMail server setup: FC6+Postfix+Dovecot+Squirrelmail rdnewman Linux - Networking 5 08-04-2007 06:59 PM
Send email to internet from 2nd SuSE via internal postfix server joadoor Linux - Networking 2 12-25-2006 10:40 AM
Using Postfix the send email via another smtp server - to anyone. scarstens Linux - Newbie 1 01-27-2004 03:31 PM


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

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