Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
05-27-2004, 11:13 PM
|
#1
|
LQ Newbie
Registered: May 2004
Posts: 10
Rep:
|
Postfix - cannot send e-mail
Hi Gurus,
Background: Mandrake 10.0 Community
I have setup DNS, a webserver and postfix on my Linux box, no local network just yet. I have 2 static IPs: aa.bb.cc.01 and aa.bb.cc.02.
Using this very Linux box where the servers are I CAN receive e-mail from the internet and I CAN send e-mail to any other alias inside my domain. However, I CAN NOT send e-mail to the internet. Here are the relevant details:
hostname: mydomain.com
/etc/hosts
aa.bb.cc.01 mydomain.com mydomain
aa.bb.cc.02 mydomain.com mydomain
127.0.0.1 localhost
DNS entries: (db.mydomain.com)
mydomain.com IN MX 10 mail.mydomain.com
www_mydomain.com IN A aa.bb.cc.01
mail.mydomain.com IN A aa.bb.cc.02
/etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mydomain.com
mydomain = mydomain.com
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www_$mydomain, ftp.$mydomain
mynetworks_style = host
mynetworks = 192.168.1.0/24, 127.0.0.0/8, 10.0.0.0/8
relay_domains =
relayhost = mail.isp.net
The error message from my log file:
postfix/smtpd[2722]: connect from mydomain.com[aa.bb.cc.02]
postfix/smtpd[2722]: NOQUEUE: reject: RCPT from mydomain.com[aa.bb.cc.02]: 554 <test@domain.com>: Relay access denied; from=<from@mydomain.com> to=<test@domain.com> proto=ESMTP helo=<mydomain.com>
postfix/smtpd[2722]: disconnect from mydomain.com[aa.bb.cc.02]
What am I doing wrong here? Under relayhost I tried mail.mydomain.com as well, no luck.
Any help would be much appreciated!
abapdr
|
|
|
05-28-2004, 02:01 AM
|
#2
|
Member
Registered: Sep 2003
Location: In the network closet
Distribution: Gentoo
Posts: 37
Rep:
|
Is the hostname on you machine set correct like <mail.mydomain.com>?
Is you $mydomain var actually set to you domain? maybe try setting it to you actual domain name?
and since you have the networks set maybe set mynetworks_style = host to mynetworks_style = subnet
not that i really see anything wrong with the config...just comparing it to mine and pointing out differrences...:]
Last edited by Jonasx; 05-28-2004 at 02:11 AM.
|
|
|
05-28-2004, 01:51 PM
|
#3
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
You will probably need to set a relay host. A lot of ISP's are blocking outgoing traffic on port 25 now and mail can only be sent through their mailserver. A lot of mailservers on the internet are not relaying email from most ISP's blocks of ip addresses as well, so you would be blocked from a lot of people's mailserver without it.
relayhost=
smtp.myispsserver.com
Don't forget to check your log file.
/var/log/maillog
Last edited by DavidPhillips; 05-28-2004 at 01:56 PM.
|
|
|
05-28-2004, 11:43 PM
|
#4
|
LQ Newbie
Registered: May 2004
Posts: 10
Original Poster
Rep:
|
Postfix - cannot send e-mail
Jonasx, David,
Thanks for your input.
- In the /etc/postfix/main.cf file I set myhostname=example.com, because that's the hostname I get back when I type the <hostname> command.
- The actual domain name is the same as the myhostname variable (example.com), so $mydomain=example.com
- Since I explicitly specify the mynetworks entries I believe the mynetworks_style variable is ignored anyway
- My ISP does not block port 25
- I set relayhost=mail.speakeasy.net (I got this from them), still no luck.
This is getting frustrating...
abapdr
|
|
|
05-29-2004, 01:40 AM
|
#5
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
We need to verify the connection.
Try to connect to a mailserver using telnet like this.
First get the MX record for the mailserver, if your trying to send mail to username@hotmail.com you would do this..
Code:
[david@slacker david]$ dig MX hotmail.com
; <<>> DiG 9.2.2-P3 <<>> MX hotmail.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32888
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 4, ADDITIONAL: 20
;; QUESTION SECTION:
;hotmail.com. IN MX
;; ANSWER SECTION:
hotmail.com. 3506 IN MX 5 mx2.hotmail.com.
hotmail.com. 3506 IN MX 5 mx3.hotmail.com.
hotmail.com. 3506 IN MX 5 mx4.hotmail.com.
hotmail.com. 3506 IN MX 5 mx1.hotmail.com.
The answer section shows the mailservers.
Now telnet into one of the mailservers..
Code:
[david@slacker david]$ telnet mx2.hotmail.com 25
Here is what you should see..
Code:
Trying 65.54.252.230...
Connected to mx2.hotmail.com.
Escape character is '^]'.
220 mc6-f34.hotmail.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.6713 ready at Fri, 28 May 2004 23:27:56 -0700
You need to send an ehlo..
Code:
ehlo mail.dcphillips.net
Now you should get a greeting..
Code:
250-mc6-f34.hotmail.com (02.04.01.0013) Hello [68.63.76.175]
250-SIZE 29696000
250-PIPELINING
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-AUTH LOGIN
250-AUTH=LOGIN
250-X-HMAUTH
250 OK
enter your mail from info like this..
The server will reply..
Then the recipient info..
Now enter the data command..
You should get a response..
Code:
354 Start mail input; end with <CRLF>.<CRLF>
Enter your message, end with a period on a line by itself..
Code:
Hello, this is only a test.
.
You should get something like this..
Code:
250 <MC6-F34A5zz0OWlZr0Q00093a81@mc6-f34.hotmail.com> Queued mail for delivery
Type quit to exit server..
Code:
quit
221 mc6-f34.hotmail.com Service closing transmission channel
Connection closed by foreign host.
If that works your connection should be ok. You should then try to relay mail through your isp's server by the same method.
|
|
|
05-29-2004, 02:47 AM
|
#6
|
LQ Newbie
Registered: May 2004
Posts: 10
Original Poster
Rep:
|
Postfix - cannot send e-mail
David,
Thank you very much for your reply!
I assume when I do ehlo I provide my mail server, right? mail.example.com is my MX 10 entry in my DNS server config.
I was trying to follow your instructions, everything is OK. (I hope doodlebuggerr@hotmail.com is not going to be too angry...)
I tried the same with my ISP (where I have an account) and I could successfully send an email from abapdr@example.com to abapdr@myisp.com, no problem.
Now I tried with yahoo where most of my buddies are, but I got stuck.
Here is how far I've got:
[abapdr@example abapdr]# dig mx yahoo.com
; <<>> DiG 9.2.3 <<>> mx yahoo.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6940
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;yahoo.com. IN MX
;; ANSWER SECTION:
yahoo.com. 7169 IN MX 1 mx1.mail.yahoo.com.
yahoo.com. 7169 IN MX 1 mx2.mail.yahoo.com.
yahoo.com. 7169 IN MX 5 mx4.mail.yahoo.com.
;; Query time: 28 msec
;; SERVER: 64.81.79.2#53(64.81.79.2)
;; WHEN: Sat May 29 00:08:26 2004
;; MSG SIZE rcvd: 92
[abapdr@example abapdr]# telnet mx1.mail.yahoo.com 25
Trying 64.157.4.78...
telnet: connect to address 64.157.4.78: Connection refused
Trying 64.156.215.5...
Connected to mx1.mail.yahoo.com (64.156.215.5).
Escape character is '^]'.
220 YSmtp mta108.mail.scd.yahoo.com ESMTP service ready
ehlo mail.example.com
250-mta108.mail.scd.yahoo.com
250-8BITMIME
250-SIZE 10485760
250 PIPELINING
mail from: abapdr@example.com
501 Syntax error in parameters or arguments
This is it. After a short while it times out.
451 Timeout
Connection closed by foreign host.
So what does this mean? I can send e-mail to certain people but not to others?
abapdr
|
|
|
05-29-2004, 10:47 AM
|
#7
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
That's correct. If you login to yahoo's mail server it disconnects as soon as it sends the 250.
If you hit enter you will be out of the login. You can send mail to a yahoo user through the relay host for your isp. You should probably test it. Everything is the same as if you were on yahoo's server except you connect to your relay server. AOL will probably not work either.
[david@slacker david]$ telnet mailin-01.mx.aol.com 25
Trying 205.188.159.57...
Connected to mailin-01.mx.aol.com.
Escape character is '^]'.
554- (RTR:BB) The IP address you are using to connect to AOL is a dynamic
554- (residential) IP address. AOL will not accept future e-mail transactions
554- from this IP address until your ISP removes this IP address from its list
554- of dynamic (residential) IP addresses. For additional information,
554- please visit http://postmaster.info.aol.com.
I think if you can relay mail to yahoo or aol through your isp mailserver you should be ok.
You should probably test that using telnet to see if it works.
Last edited by DavidPhillips; 05-29-2004 at 10:50 AM.
|
|
|
05-29-2004, 10:52 AM
|
#8
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
When you are trying to send mail through your mailserver that gets relay denied are you on that machine or on another machine on your network?
relay domains are who you are relaying for..
Code:
relay_domains =
$mydestination
also you may want some restrictions..
Code:
smtpd_client_restrictions =
permit_mynetworks,
reject_unknown_client,
reject_invalid_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
reject_unauth_pipelining,
reject_unauth_destination,
reject_maps_rbl,
permit
which would also require my_networks to be defined..
Code:
mynetworks =
192.168.0.0/24,
192.168.1.0/24,
127.0.0.0/8
Last edited by DavidPhillips; 05-29-2004 at 10:57 AM.
|
|
|
05-29-2004, 01:54 PM
|
#9
|
LQ Newbie
Registered: May 2004
Posts: 10
Original Poster
Rep:
|
Postfix - cannot send e-mail - SOLVED
David,
Thank you so much for following up on this issue. You would not believe what the problem was!
I started to get suspicious of the fact that using my mail client wherever I tried to send an e-mail (except for within my own domain) I got the very same "Relay access denied" message. Checked the log, and as I showed it in my original e-mail I saw the following:
postfix/smtpd[2722]: connect from example.com[aa.bb.cc.02]
postfix/smtpd[2722]: NOQUEUE: reject: RCPT from example.com[aa.bb.cc.02]: 554 <buddy@domain.com>: Relay access denied; from=<abapdr@example.com> to=<buddy@domain.com> proto=ESMTP helo=<example.com>
postfix/smtpd[2722]: disconnect from example.com[aa.bb.cc.02]
At the same time the mynetworks setting is
mynetworks = 192.168.1.0/24, 127.0.0.0/8, 10.0.0.0/8
I'm trying to send an e-mail from the server where my mailserver is running but the log does not show the localhost as the sender, it shows the IP address of my mailserver (aa.bb.cc.02). My own mailserver denied relay access from me!!!??? Sounds strange? I thought so!
I changed the mynetworks setting to
mynetworks = 192.168.1.0/24, 127.0.0.0/8, 10.0.0.0/8, aa.bb.cc.02
and now it works, I can send e-mail to anybody even to my yahoo buddies. I do not even have to relay through my isp's mail server, I have the relay_host commented out in my config file:
#relayhost =
Thanks so much for your time and contribution! Now I can attend to my other problems! 
abapdr
Last edited by abapdr; 05-29-2004 at 01:56 PM.
|
|
|
05-29-2004, 03:38 PM
|
#10
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
Cool,
AOL is one of the main ones that are blocking dynamic addresses. If you never use them you might be ok for most mail. You should get an email if any letter is denied.
|
|
|
04-17-2006, 01:31 PM
|
#11
|
Member
Registered: Feb 2006
Distribution: CentOS
Posts: 114
Rep:
|
i would like to re-open this post lol..i have followed everything on here and still no luck with postfix sending to anywhere except my own domain. i have used telnet and i connect and everything works but i still have no luck sending...my domain is 3gxlive.com
|
|
|
04-17-2006, 02:39 PM
|
#12
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep: 
|
postconf -n is always a good way to start a "I need help with my Postfix Mail Server" type post Might have been a good idea to start a new thread for your problem as well so as not to confuse people..
postconf -n will print out all the items that are NOT default in your postfix configuration. makes it easy to see all the changes you have made. (this is also the first thing that is asked for on the Postfix mail list)
Also did you test using a relayhost as mentioned above ? a LOT of ISP's block mail servers on dynamic or residential service.
Last edited by farslayer; 04-17-2006 at 02:40 PM.
|
|
|
04-17-2006, 05:04 PM
|
#13
|
Member
Registered: Feb 2006
Distribution: CentOS
Posts: 114
Rep:
|
sorry..i just thought i would get critisized if i started a new one..other forums usually have problems with starting a new topic when there is one already made... postconf -n gave this results (NOTE: i am using vhcs which may change settings http://vhcs.net)
Code:
alias_database = hash:/etc/aliases
append_at_myorigin = yes
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
inet_interfaces = all
local_destination_recipient_limit = 1
local_recipient_maps = unix:passwd.byname $alias_database
local_transport = local
mail_spool_directory = /var/spool/mail
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = $myhostname, $mydomain
mydomain = 3gxlive.com
myhostname = ns.3gxlive.com
mynetworks = 68.118.210.0/24, 127.0.0.0/8
mynetworks_style = host
myorigin = $mydomain
setgid_group = postdrop
smtpd_banner = $myhostname VHCS2 2.4 (Spartacus) Managed ESMTP 2.4.7.1
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = vhcs.net
smtpd_sasl_security_options = noanonymous
transport_maps = hash:/etc/postfix/vhcs2/transport
virtual_alias_maps = hash:/etc/postfix/vhcs2/aliases
virtual_gid_maps = static:8
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_domains = hash:/etc/postfix/vhcs2/domains
virtual_mailbox_limit = 0
virtual_mailbox_maps = hash:/etc/postfix/vhcs2/mailboxes
virtual_minimum_uid = 107
virtual_transport = virtual
virtual_uid_maps = static:107
and also in master.cf i attempted to change the following line from:
Code:
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd
to
Code:
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
as it was posted in the vhcs forums..and it did not work
i did notice that while i did: telnet mail.3gxlive.com 25 and sent an email to user@hotmail.com it went successfuly
also, if u need think dns problems could be apparent my dns is setup correctly as well
http://www.dnsreport.com/tools/dnsre...in=3gxlive.com
Last edited by ballistic509; 04-17-2006 at 08:57 PM.
|
|
|
08-13-2013, 05:47 AM
|
#14
|
LQ Newbie
Registered: Aug 2013
Posts: 1
Rep: 
|
Postfix sending mails to mailbox but mails are not received
I am facing an issue with postfix. I have configured Postfix SMTP, saslauthd and dovecot. I also have a smtp replay which is lets say a.b.c.d over port 25. Now when I use telnet to send email using postfix can see no errors in log file (dsn=2.0.0, status=sent (delivered to mailbox)). However, I dont get the mail in the inbox. I have also added the relay server as well but still no mails. When do telnet on the relay box I am able to get the mail in my Inbox. Please can you help me with this issue?
|
|
|
All times are GMT -5. The time now is 09:07 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|