Please upgrade here. These earlier versions are no longer being updated and have security issues.

SMTP problem - how to generate an error log

Hi,

I am trying to use the SMTP settings to send mail on our internal servers and even though all the configuration options are correct (and various versions have been tried), we always get either 'could not connect to the SMTP host' or 'could not authenticate'. However, our mail servers show that no attempts to authenticate have been made.

Naturally, I don't expect anyone to be able to help with the SMTP side of our system (and a search of the community tells me not to continue looking for an answer her). HOwever, we can see no way of getting an error log that will give us some idea of what is happening and how we can fix the problem.

This email issue is preventing us from using the forum at the moment, so we are keen to discover where the issue is in order to troubleshoot. Looking through the community, I can only seem to find references to error logging of specific applications/plugins.

Any help would be greatly appreciated.

«1

Comments

  • did you try this

    https://www.google.com/search?q=SMTP+error+logging

    it looked like there a bunch of discussions on how to set it up on your particular server os.

    send mail on our internal servers

    SMTP host internally to an address within the company? so it doesn't pass thru a firewall at any time.

    get yourself a sniffer or tcpdump and see if you can locate the problem looking for smtp packets.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thanks for the response. I don't think I explained myself clearly!

    The point is our SMTP server is not showing any errors - it's as if it is never getting out of Vanilla in the first place. The error is in Vanilla but I cannot seem to find anyway of it producing a log file. If it helps, I can send a screenshot of where I am getting the error message?

    To explain:

    VM hosted on internal server running Vanilla trying to send email via the SMTP server. Firewalls turned on/off makes no difference. As far as the SMTP server is concerned, Vanilla is not even trying to communicate with it, hence no error log on the SMTP end.

  • have you tried connecting to SMTP manually on that port?

    grep is your friend.

  • aslo have you check you php version is compiled and compatable with SMTP?

    grep is your friend.

  • Connecting on Port 25 which is otherwise fine and using PHP 5.4. I'm using Web Matrix to drive the back end. As I understand it, PHP 5.4 is compatible?

  • Vanilla uses PHPMailer which uses fsockopen to send mail.

    allow_url_fopen need to be On and not disabled as a function in php.ini.

    grep is your friend.

  • At the risk of asking a very stupid question, where is the php.ini file to be found? I can't see it anywhere!

  • Ah, I've found a php.ini file in my IIS Express folder but this seems to indicate that allow_url_fopen is already on.

    Unless this is the wrong php.ini file?

  • peregrineperegrine MVP
    edited November 2013

    put some debug statements in the php mailer program which is in

    http://vanillaforums.org/discussion/comment/167434#Comment_167434

    you also might try

    <br />in phpmailer ...
    
    changing to true in library/vendors/phpmailer/class.phpmailer.php
    
     public $SMTPDebug     = false;
    
    to
    
    public $SMTPDebug     = TRUE;
    
    
    in vanilla....
    
    you might also add some logging messages here
    
    public function Send($EventName = '') {
    
    in 
    
    library/core/class.email.php
    
    
    

    to see if its sending mail.

    then you need to mail to port 25.

    you may be able to telnet to port 25 and enter the info it expects and debug your SMTP port,

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • what does it have under disable_functions

    grep is your friend.

  • hbfhbf wiki guy? MVP

    VM hosted on internal server running Vanilla trying to send email via the SMTP server. Firewalls >turned on/off makes no difference. As far as the SMTP server is concerned, Vanilla is not even >trying to communicate with it, hence no error log on the SMTP end.

    can you use a mail client installed don the Vanilla VM to connect to your SMTP server? Can you send mail without downloading the mailbox headers first? What mail server is the SMTP server running - who is the admin? Is the SMTP server running a firewall or config that blocks requests outside of an IP range / subnet / hostname / domain / etc.

  • @x00 said:
    what does it have under disable_functions

    http://php.net/disable-functions
    disable_functions =

    I've noticed in the php.ini file that:

    [mail function]
    ; For Win32 only.
    ; http://php.net/smtp
    SMTP = localhost
    ; http://php.net/smtp-port
    smtp_port = 25

    Excuse my ignorance here, but should the SMTP = [i]name of smtp server[/i] (e.g. exchangesrv01.domain.generic.com) instead of = localhost?

  • @toweliechaos said:
    Excuse my ignorance here, but should the SMTP = [i]name of smtp server[/i] (e.g. exchangesrv01.domain.generic.com) instead of = localhost?

    that depends if it can be reached by loopback on the same server. however vanilla uses fsockets anyway to connect.

    grep is your friend.

  • Apologies for the delay in responding further.

    I'm sorry to say I'm no nearer getting this to work.

    To recap:

    VM running Vanilla 2.0.18.10 via ISS and WebMatrix with MySQL 6 and PHP 5.5

    Everything fine. Go to create a user, creates user fine but errors on email:

    1. if using local mail server (exchange in this instance), get 'could not instantiate mail'
    2. if using smtp server, get 'SMTP error: could not authenticate'

    User account on VM is admin and is also the domain account for the mailbox etc.

    The SMTP credentials are correct. If I click on the Vanilla admin account's email address, it opens Outlook and sends the mail happily.

    In looking at class.phpmailer.php, I seem to have conflicting information (I'm no php expert btw).

    It seems to suggest:

      • Sets the From email address for the message.
    1. */
    2. public $From = '[email protected]';
    3. /**
      • Sets the From name of the message.
    4. */
    5. public $FromName = 'Root User';

    which are not the details of the SMTP user or the user account. Is this an issue or am I barking up entirely the wrong tree?

    Also:

    1. /**
      • Method to send mail: ("mail", "sendmail", or "smtp").
    2. */
    3. public $Mailer = 'mail';
    4. /**
      • Sets the path of the sendmail program.
    5. */
    6. public $Sendmail = '/usr/sbin/sendmail';

    doesn't seem to change whether I set to 'mail' or 'smtp' in vanilla.

    Again, I may be in completely the wrong area but I just cannot understand the root of this problem!

  • yes you are barking up the wrong tree.

    First suggest try to connect to stmp sever outside of the application. If you can't do that then that is the like problem.

    grep is your friend.

    hgtonight
  • Thanks, I've just telnet checked the smtp connection and get back the 'mail is queued for delivery' message, so I assume all is OK on the connection, unless you were meaning a different kind of check?

    hgtonight
  • vanilla uses PHPMailer so you might try testing out standalone

    https://github.com/Synchro/PHPMailer

    see their example.

    grep is your friend.

    hgtonight
  • This is driving me nuts!

    I cannot even manage to find any error logs that might give me something to work from. The connection to the SMTP host outside of Vanilla is fine. The exchange server is receiving absolutely no trace of any attempt to communicate with it. Firewalls and AV have been turned off.

    Yet always the same result: could not instantiate/could not authenticate (local mail server/smtp).

    Someone must have come across this sort of problem before? I'm happy to take this offline with a kind helpful soul and provide any information requested...?

  • look for

       if(!$rt) {
          throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL);
        }
        return true;
      }
    
    add a var_dump
    
    
       if(!$rt) {
         var_dump($rt);
          throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL);
        }
        return true;
      }
    
    you may be missinf a to  or from, etc.
    
    
    var_dump variables in  protected function MailSend($header, $body) {
    
    
    also check your name and password in config file if you get authentication error
    
    see line 814 - you put a log there.
    

    what suggestions have you actually tried in this thread? and what further info did you get.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • test fsockopen that is what used to connect.

    grep is your friend.

«1
Sign In or Register to comment.