Can't Send Mail from Smart Phone or Outlook

Discussion in 'Server Operation' started by Bushytea, Dec 13, 2011.

  1. Bushytea

    Bushytea New Member

    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.

    Here is what I see in /var/log/maillog:


    Here is part of my main.cf from posfix:

    Then here is my dovecot.conf

    Thanks in advance
     
  2. cbj4074

    cbj4074 Member

    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/quest...cipient-address-rejected-user-unknown-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
    
     
  3. Bushytea

    Bushytea New Member

    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.

    Thanks,
    Mike
     
  4. cbj4074

    cbj4074 Member

    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: Dec 30, 2011
  5. cbj4074

    cbj4074 Member

    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: Dec 30, 2011
  6. Bushytea

    Bushytea New Member

    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.




    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: Jan 2, 2012
  7. cbj4074

    cbj4074 Member

    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
    
    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.)

    Okay, that sounds like a change worth making.

    Okay, then you can ignore my related comments, as they do not apply to your system.

    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.

    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/communicqationsgalores.com/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.
     

Share This Page