LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 04-14-2012, 09:54 AM   #1
MarkoSan
Member
 
Registered: Jun 2006
Location: Ljubljana
Distribution: KUbuntu
Posts: 61

Rep: Reputation: 1
Question [Ubuntu Server 11.10]Problem with mail server


Dear Sirs and Madams!

I've setup mail server with Postfix+Dovecot combination. Now, from linux bash shell (logged on to server from Windows 7 Ultimate via putty) I can receive and send email without problems. Then I installed on Windows 7 machine Mozilla Thunderbird and when I try to send email to some gmail account, I get following error (from Mozilla Thunderbird):
Quote:
An error occurred while sending mail. The mail server responded: 5.7.1 <user@gmail.com>: Relay access denied. Please check the message recipient user@gmail.com and try again.
What is wrong, can someone help me please?

Sincerely,
Marko
 
Old 04-14-2012, 12:51 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You should add the IP of your windows box in mynetworks option in main.cf

Regards
 
1 members found this post helpful.
Old 04-15-2012, 06:35 AM   #3
MarkoSan
Member
 
Registered: Jun 2006
Location: Ljubljana
Distribution: KUbuntu
Posts: 61

Original Poster
Rep: Reputation: 1
Well, I did and I still get error (this one is from server log):
Quote:
Apr 15 13:29:01 kilimanjaro postfix/master[6072]: daemon started -- version 2.8.5, configuration /etc/postfix
Apr 15 13:29:32 kilimanjaro postfix/smtpd[6076]: connect from lk.xxx.xxx.xxx.xxx.dc.cable.static.lj-kabel.net[xxx.xxx.xxx.xxx]
Apr 15 13:29:32 kilimanjaro postfix/smtpd[6076]: NOQUEUE: reject: RCPT from lk.xxx.xxx.xxx.xxx.dc.cable.static.lj-kabel.net[xxx.xxx.xxx.xxx]: 554 5.7.1 <user@gmail.com>: Relay access denied; from=<user@mydomain.com> to=<user@gmail.com> proto=ESMTP helo=<[192.168.100.120]>
Apr 15 13:29:39 kilimanjaro postfix/smtpd[6076]: disconnect from lk.xxx.xxx.xxx.xxx.dc.cable.static.lj-kabel.net[xxx.xxx.xxx.xxx]
And my main.cf looks like:
Quote:
# 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 (Ubuntu)
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

readme_directory = no

# 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:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

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

myhostname = kilimanjaro.my-domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = my-domain.com, kilimanjaro.my-domain.com, localhost.my-domain.com, localhost
relayhost =
#mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetwors = 192.168.1.1/16
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
 
Old 04-15-2012, 07:21 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
What do you have in your "smtpd_recipient_restrictions"? This is the block that determines who is allowed to send. Normally it contains things like "permit_sasl_authenticated" and "permit_mynetworks", either of wich could be used to authenticate your Thunderbird client. According to the error message:
Quote:
connect from lk.xxx.xxx.xxx.xxx.dc.cable.static.lj-kabel.net[xxx.xxx.xxx.xxx]
the host is identifying itself as xxx.xxx.xxx.xxx, which appears to be a public IP address and not as a LAN address in the range of 192.168.0.0/16 as declared by "mynetwors". The alternative is SASL authentication.
 
Old 04-15-2012, 10:52 AM   #5
MarkoSan
Member
 
Registered: Jun 2006
Location: Ljubljana
Distribution: KUbuntu
Posts: 61

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Noway2 View Post
What do you have in your "smtpd_recipient_restrictions"? This is the block that determines who is allowed to send. Normally it contains things like "permit_sasl_authenticated" and "permit_mynetworks", either of wich could be used to authenticate your Thunderbird client. According to the error message: the host is identifying itself as xxx.xxx.xxx.xxx, which appears to be a public IP address and not as a LAN address in the range of 192.168.0.0/16 as declared by "mynetwors". The alternative is SASL authentication.
Thanks for your tip, but, can you please tell me the reason why host is identifying with public, not LAN address? How do I fix this?
 
Old 04-15-2012, 11:35 AM   #6
MarkoSan
Member
 
Registered: Jun 2006
Location: Ljubljana
Distribution: KUbuntu
Posts: 61

Original Poster
Rep: Reputation: 1
Ok, I've setup Mozilla account server settings from "mail.my-domain.com" to "192.168.100.101" which is LAN server's address and I can send email. But, if I return from google to newly created email, I get it on server via "mail" command, but in Thunderbird there is no new email. Why??
 
Old 04-15-2012, 12:04 PM   #7
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Quote:
Originally Posted by MarkoSan View Post
Thanks for your tip, but, can you please tell me the reason why host is identifying with public, not LAN address? How do I fix this?
This will depend on the host configuration, including it's assigned IP address, it's hostname, and how traffic is routed to the server, and (as I suspect is the cause) whether you are pointing it to your mail server's public IP or private IP.

Quote:
if I return from google to newly created email, I get it on server via "mail" command, but in Thunderbird there is no new email. Why??
There are two portions of a typical mail server, the SMTP server and the POP/IMAP server. Are you using a POP/IMAP server such as Dovecot or Courier and how do you have your mail delivery configured? The default in Postfix is local mail delivery, which puts mail in a mailbox under each user's home folder. In thunderbird, this is usually seen under the local folders (see this link for details), as compared to the normal Inbox which looks at your POP/IMAP server.
 
Old 04-16-2012, 01:15 AM   #8
MarkoSan
Member
 
Registered: Jun 2006
Location: Ljubljana
Distribution: KUbuntu
Posts: 61

Original Poster
Rep: Reputation: 1
I am using dovecot, and my /etc/dovecot.conf is:
Code:
protocols = pop3 pop3s imap imaps
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u # (for mbox)
 
Old 04-16-2012, 04:19 AM   #9
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
The configuration looks correct, meaning Dovecot should be able to find the mailboxes (see the following link). What are you using for your delivery agent in Postfix? Are you using Dovecot delivery, which would be configured in both main.cf and master.cf? The reason for using Dovecot delivery is that Dovecot creates indexes of what messages are stored where. I found this page gives a pretty good explaination of this. In particular please check the Postfix section, which will go into detail about how to configure Dovecot + Postfix with local mailboxes.
 
Old 04-16-2012, 08:24 AM   #10
MarkoSan
Member
 
Registered: Jun 2006
Location: Ljubljana
Distribution: KUbuntu
Posts: 61

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Noway2 View Post
The configuration looks correct, meaning Dovecot should be able to find the mailboxes (see the following link). What are you using for your delivery agent in Postfix? Are you using Dovecot delivery, which would be configured in both main.cf and master.cf? The reason for using Dovecot delivery is that Dovecot creates indexes of what messages are stored where. I found this page gives a pretty good explaination of this. In particular please check the Postfix section, which will go into detail about how to configure Dovecot + Postfix with local mailboxes.
Here is my /etc/postfix/master.cf file:
Code:
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
	-o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix	-	n	n	-	2	pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
Where do I check if postfix is using Dovecot delivery?
 
Old 04-16-2012, 08:51 AM   #11
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
No, your not using Dovecot for your delivery agent. If you were, master.cf would have a line like the following:
Code:
dovecot unix - n n - - pipe flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/deliver -d $(recipient)
and in main.cf: 
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
Note that this is almost identical to the maildrop entries, which is the normal local mail account delivery agent.
 
1 members found this post helpful.
Old 05-23-2012, 04:40 PM   #12
MarkoSan
Member
 
Registered: Jun 2006
Location: Ljubljana
Distribution: KUbuntu
Posts: 61

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Noway2 View Post
No, your not using Dovecot for your delivery agent. If you were, master.cf would have a line like the following:
Code:
dovecot unix - n n - - pipe flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/deliver -d $(recipient)
and in main.cf: 
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
Note that this is almost identical to the maildrop entries, which is the normal local mail account delivery agent.
So I replace your entry with maildrop entries, or I add your post into file (at the end of it)?

Sincerely,
Marko
 
Old 05-24-2012, 04:57 AM   #13
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Quote:
Originally Posted by MarkoSan View Post
So I replace your entry with maildrop entries, or I add your post into file (at the end of it)?
Just add it. It should be picked up with the following additions to your main.cf, which tell Postfix to call the dovecot line in master.
Code:
virtual_transport = dovecot
smtpd_sasl_type = dovecot
 
  


Reply



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
Problem with Thunderbird and mail server on Ubuntu server dikon123 Linux - Server 16 11-18-2011 12:38 PM
Frustration and confusion over setting up a Postfix mail server on my Ubuntu server. dag10 Linux - Server 5 04-17-2011 10:16 AM
Ubuntu mail server stopped recieving mail. will send. Ubuntu 9 ISPconfig3 Postfix 255 kejxero Linux - Server 0 02-07-2010 06:57 PM
Mail Server + Webmin on Ubuntu Server scottt20 Linux - Server 1 01-26-2010 02:49 AM
Help Setting Up Mail Server In Ubuntu Server 5.10 twaern Ubuntu 1 05-19-2006 06:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:10 PM.

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
Open Source Consulting | Domain Registration