Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 13th December 2011, 18:35
Bushytea Bushytea is offline
Junior Member
 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't Send Mail from Smart Phone or Outlook

Hi,

I am running a server with Centos 5.2, Postfix 2.3.3 and Dovecot. The server is not on my local network so it is not behind my router.

I can send mail to/from the email account on the server. (Ex: Send mail from server account to aol account then send mail from aol account back to server account)

I can even see the mail that is in the users mailbox from my phone but I am not able to send. When I try to setup the account in Outlook or try to send mail from my phone they both say they are unable to connect to the smtp server. When I test the settings in Outlook it says that it logs in successfully but cannot connect to the smtp server.I have searched and found tons of how-tos but just can not get it to work.

Here are a few different results I get when I telnet smtp.domain.com 25 and try to send an email.

Of Course the way I did it below does not work. I do receive the "Relay access denied" message.

Quote:
# telnet smtp.domain.com 25
Trying IP...
Connected to smtp.domain.com (IP).
Escape character is '^]'.
220 smtp.domain.com ESMTP Postfix
ehlo smtp.domain.com
250-smtp.domain.com
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: user@domain.com
250 2.1.0 Ok
rcpt to: user@aol.com
554 5.7.1 <user@aol.com>: Relay access denied
Here is what I see in /var/log/maillog:

Quote:
Dec 13 11:25:31 postfix/smtpd[31014]: warning: IP: address not listed for hostname domain.com
Dec 13 11:25:31 postfix/smtpd[31014]: connect from unknown[IP]
Dec 13 11:25:47 postfix/smtpd[31014]: NOQUEUE: reject: RCPT from unknown[IP]: 554 5.7.1 <user@aol.com>: Relay access denied; from=<user@domain.com> to=<user@aol.com> proto=ESMTP helo=<smtp.domain.com>
Dec 13 11:25:50 postfix/smtpd[31014]: disconnect from unknown[IP]

Here is part of my main.cf from posfix:

Quote:
myhostname = mail.domain.com
mydomain = domain.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain
mynetworks = 127.0.0.0/8 168.100.189.2/32
alias_maps = hash:/etc/aliases
#
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_invalid_hostname reject_non_fqdn_hostname reject_non_fqdn_sender reject_non_fqdn_recipient reject_unknown_sender_domain reject_unknown_recipient_domain reject_rbl_client zen.spamhaus.org permit
smtpd_helo_required = yes
disable_vrfy_command = yes
smtpd_delay_reject = no

# SASL Authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/run/dovecot/auth-client
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
Then here is my dovecot.conf

Quote:
protocols = imap pop3
listen = *
disable_plaintext_auth = no
pop3_uidl_format = %08Xu%08Xv
mechanisms = plain login
passdb pam {
args = /etc/pam.d/dovecot
}

client {
path = /var/run/dovecot/auth-client
mode = 0660
user = postfix
group = postfix
}
Thanks in advance
Reply With Quote
Sponsored Links
  #2  
Old 14th December 2011, 18:58
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 392
Thanks: 29
Thanked 58 Times in 50 Posts
Default

Is the server in question running ISPConfig? I'll assume that it is until you state otherwise.

The problem is most likely with the following line in main.cf:

Code:
mydestination = $myhostname, localhost.$mydomain, $mydomain
You might try changing it to:

Code:
mydestination = localhost, localhost.localdomain
Do you have the following error in your logs?

Code:
postfix/trivial-rewrite[XXXX]: warning: do not list domain mydomain.com in BOTH mydestination and virtual_mailbox_domains
See my post here for details:

http://www.linuxquestions.org/questi...nknown-844118/

Also, if ISPConfig is installed, what value are you using (in main.cf) for

Code:
virtual_mailbox_domains
Finally, is this value accurate? Are you really using the "mail" subdomain?

Code:
myhostname = mail.domain.com
Reply With Quote
  #3  
Old 19th December 2011, 16:56
Bushytea Bushytea is offline
Junior Member
 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by cbj4074 View Post
Is the server in question running ISPConfig? I'll assume that it is until you state otherwise.

The problem is most likely with the following line in main.cf:

Code:
mydestination = $myhostname, localhost.$mydomain, $mydomain
You might try changing it to:

Code:
mydestination = localhost, localhost.localdomain
Do you have the following error in your logs?

Code:
postfix/trivial-rewrite[XXXX]: warning: do not list domain mydomain.com in BOTH mydestination and virtual_mailbox_domains
See my post here for details:

http://www.linuxquestions.org/questi...nknown-844118/

Also, if ISPConfig is installed, what value are you using (in main.cf) for

Code:
virtual_mailbox_domains
Finally, is this value accurate? Are you really using the "mail" subdomain?

Code:
myhostname = mail.domain.com
Thanks for the info.

However, I did try changing the mydestination configuration and that did not change anything and I currently do not have that error message in my maillog.

I do not have ISPConfig installed. From what I understand that is a control panel. I currently use Webmin to config the server.

As for the myhostname I do not use mail as a subdomain. After looking it seems it should be domain.com instead but that did not change anything either. Below is what I have in my maillog now.

Quote:
Dec 19 09:43:49 postfix/postfix-script: starting the Postfix mail system
Dec 19 09:43:49 postfix/master[26154]: daemon started -- version 2.3.3, configuration /etc/postfix
Dec 19 09:43:59 postfix/smtpd[26159]: warning: IP: address not listed for hostname domain.com
Dec 19 09:43:59 postfix/smtpd[26159]: connect from unknown[IP]
Dec 19 09:44:17 postfix/smtpd[26159]: NOQUEUE: reject: RCPT from unknown[IP]: 554 5.7.1 <user@aol.com>: Relay access denied; from=<user@domain.com> to=<user@aol.com> proto=ESMTP helo=<mail.domain.com>
Dec 19 09:44:19 postfix/smtpd[26159]: disconnect from unknown[IP]
Thanks,
Mike
Reply With Quote
  #4  
Old 30th December 2011, 20:16
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 392
Thanks: 29
Thanked 58 Times in 50 Posts
Default

I understand the need to protect your privacy and scrub personal information from your posts, so we'll need to be clear as to when you're using "domain.com" literally and when you're using it as a generic placeholder.

In your most recent post, does the log literally say

Code:
postfix/smtpd[31014]: warning: IP: address not listed for hostname domain.com
or is your real domain name present (instead of domain.com)?

My setup works perfectly well, and while I use ISPConfig, I would think that your Postfix settings should not be all that different.

Here are my equivalent settings for the items that seem relevant:

Code:
myhostname = example.com
myorigin = /etc/mailname
mydestination = localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8 [::1]/128
Naturally, the following line will be different because I am using virtual mailboxes with MySQL, but it's worth posting (because yours looks unusually restrictive):

Code:
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
At this point, my questions are:

1.) Is your main.cf untouched? In other words, did you make any changes to it between the time Postfix was installed and this problem occurred?

2.) Did you insert the IP address 168.100.189.2/32, or was that done automatically during Postfix setup?

3.) What Linux distro are you using? Do you have the file /etc/mailname?

Last edited by cbj4074; 30th December 2011 at 20:23.
Reply With Quote
  #5  
Old 30th December 2011, 20:32
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 392
Thanks: 29
Thanked 58 Times in 50 Posts
Default

Before you spend too much time fiddling, try commenting-out

Code:
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_invalid_hostname reject_non_fqdn_hostname reject_non_fqdn_sender reject_non_fqdn_recipient reject_unknown_sender_domain reject_unknown_recipient_domain reject_rbl_client zen.spamhaus.org permit
and using the following it its place

Code:
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
Does the problem persist? If not, the issue is clearly with one or more of the recipient restrictions. I'm not suggesting that you should remove all of them, but you may need to remove some of them.

How did the zen.spamhaus.org entry make its way into your configuration file? It's not necessarily a problem, but it seems that you (or something you installed) must have modified this line.

I noticed also that a) you lack commas between each directive on that line, and b) you seem to have an orphaned "permit" at the end of the line.

If the problem still is not resolved, what values do you have for these two directives?

Code:
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf

Last edited by cbj4074; 30th December 2011 at 20:37.
Reply With Quote
  #6  
Old 2nd January 2012, 18:25
Bushytea Bushytea is offline
Junior Member
 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by cbj4074 View Post
I understand the need to protect your privacy and scrub personal information from your posts, so we'll need to be clear as to when you're using "domain.com" literally and when you're using it as a generic placeholder.

In your most recent post, does the log literally say

Code:
postfix/smtpd[31014]: warning: IP: address not listed for hostname domain.com
or is your real domain name present (instead of domain.com)?

My setup works perfectly well, and while I use ISPConfig, I would think that your Postfix settings should not be all that different.

Here are my equivalent settings for the items that seem relevant:

Code:
myhostname = example.com
myorigin = /etc/mailname
mydestination = localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8 [::1]/128
Naturally, the following line will be different because I am using virtual mailboxes with MySQL, but it's worth posting (because yours looks unusually restrictive):

Code:
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
At this point, my questions are:

1.) Is your main.cf untouched? In other words, did you make any changes to it between the time Postfix was installed and this problem occurred?

2.) Did you insert the IP address 168.100.189.2/32, or was that done automatically during Postfix setup?

3.) What Linux distro are you using? Do you have the file /etc/mailname?
Yes, domain.com is just a placeholder for my real domain name.

1.) My main.cf has been edited but the problem was there before I ever made any changes and I had a huge amount of spam being sent from my server. That sense stopped once I added all the restrictions. I also did a blacklist search which my server is not on.

2.) The IP 168.100.189.2/32 was done automatically during the setup. However, it seemed to have helped when I stopped using mynetworks and used mysetworks_style = subnet.

3.) I am using CentOS 5.2. I do not have a file called mailname in my etc directory.




Quote:
Originally Posted by cbj4074 View Post
Before you spend too much time fiddling, try commenting-out

Code:
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_invalid_hostname reject_non_fqdn_hostname reject_non_fqdn_sender reject_non_fqdn_recipient reject_unknown_sender_domain reject_unknown_recipient_domain reject_rbl_client zen.spamhaus.org permit
and using the following it its place

Code:
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
Does the problem persist? If not, the issue is clearly with one or more of the recipient restrictions. I'm not suggesting that you should remove all of them, but you may need to remove some of them.

How did the zen.spamhaus.org entry make its way into your configuration file? It's not necessarily a problem, but it seems that you (or something you installed) must have modified this line.

I noticed also that a) you lack commas between each directive on that line, and b) you seem to have an orphaned "permit" at the end of the line.

If the problem still is not resolved, what values do you have for these two directives?

Code:
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
When I switched my smtpd_recipient_restrictions to the shorter list that you gave me, I am now able to get a successful test through outlook now.

A lot of the restrictions I had I put in due to all the spam using my server.


I may have to make a new thread but thought I would ask here. My reverse DNS keeps showing up as www1communicqationsgalores.com which is not correct. When I run host or nslookup my IP shows to be reversed to my domain so I am unsure why that other domain keeps showing up.


Thanks

Last edited by Bushytea; 2nd January 2012 at 18:35.
Reply With Quote
  #7  
Old 2nd January 2012, 19:44
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 392
Thanks: 29
Thanked 58 Times in 50 Posts
 
Default

First things first. Given that you are not using ISPConfig and appear not to be using virtual mailboxes, you should change this line

Code:
mydestination = localhost, localhost.localdomain
back to

Code:
mydestination = $myhostname, localhost.$mydomain, $mydomain
Quote:
1.) My main.cf has been edited but the problem was there before I ever made any changes and I had a huge amount of spam being sent from my server. That sense stopped once I added all the restrictions. I also did a blacklist search which my server is not on.
The spam was being sent from your server? Not to it? If the spam stopped when you modified the recipient_restrictions, that indicates that you were receiving spam, not sending it out unknowingly. (If your machine was sending spam, it would indicate an open-replay problem.)

Quote:
2.) The IP 168.100.189.2/32 was done automatically during the setup. However, it seemed to have helped when I stopped using mynetworks and used mysetworks_style = subnet.
Okay, that sounds like a change worth making.

Quote:
3.) I am using CentOS 5.2. I do not have a file called mailname in my etc directory.
Okay, then you can ignore my related comments, as they do not apply to your system.

Quote:
When I switched my smtpd_recipient_restrictions to the shorter list that you gave me, I am now able to get a successful test through outlook now.
It's hard to say whether this is because you had syntax errors in the smtpd_recipient_restrictions directive value (namely, missing commas and an orphaned "permit" at the end) or because the rules were, in fact, too restrictive.

You might try fixing the syntax errors and see if your test-case works. If not, then go back to the shorter list that I provided.

Quote:
I may have to make a new thread but thought I would ask here. My reverse DNS keeps showing up as www1communicqationsgalores.com which is not correct. When I run host or nslookup my IP shows to be reversed to my domain so I am unsure why that other domain keeps showing up.
Where, exactly, is this domain name showing-up?

Do you even recognize the domain name, communicqationsgalores.com? Could this belong to your ISP (or whomever is hosting the VPS)? It looks as though this domain was transferred to name-services.com ( http://www.dailychanges.com/communic...om/2011-03-04/ ) and has some 3.5 million domains with which it is associated. So, perhaps it belongs to the hosting company that you're using.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendig mail Error fisherofer Installation/Configuration 12 30th November 2011 07:56
ISPconfig 3.0.3.2 postfix not relaying outgoing attachments mychoice2009 Installation/Configuration 3 13th April 2011 17:42
Why did Squirrelmail, Dovecot/IMAP & Outbound mail break? websissy Technical 4 29th October 2009 22:39
Postfix problem and few questions Gimly Installation/Configuration 12 7th July 2009 16:27
Postfix reject connections gabrix Server Operation 27 25th January 2007 08:37


All times are GMT +2. The time now is 14:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.