Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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?
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??
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.