Author Topic: unable to send mail - smtp protocol violation  (Read 4031 times)

Offline rinnes

  • Newbie
  • *
  • Posts: 3
unable to send mail - smtp protocol violation
« on: February 21, 2008, 09:07:25 AM »
Unable to send mail through roundcube when SSL is enabled over Exim4. Exim is working correctly as I have manually connected and authorised with it and also connected using 3rd party client software and can authenticate and send mail fine.

When sending mail through Roundcube the following error is reported in Exim's 'rejectlog'

---

2008-02-20 22:13:48 SMTP protocol violation: synchronization error (input sent without waiting for greeting): rejected connection from H=rubix.xxx.com [xx.xxx.xx.x]

---

Basically, Exim will deny the message if the session sends data before the SMTP banner or if remote client sends data out of sync.

This is caused by Exim being more compliant to the SMTP RFC, it will drop the connection if this results.

This issue has been addressed and patched by the AtMail? Webmail client. Knowledge base article here: http://kb.atmail.com/?p=220

I'm guessing that this can be fixed by ensuring Exim has sent its response to the smtp greeting before continuing with the authentication process.

Offline 7charlie

  • Newbie
  • *
  • Posts: 1
Re: unable to send mail - smtp protocol violation
« Reply #1 on: February 23, 2008, 07:41:46 AM »
I had this problem as well. An alternative solution was found in the Exim FAQ:

http://www.exim.org/exim-html-4.30/doc/html/FAQ.html#TOC308

Basically it suggests that roundcube is using SMTPS rather than STMP/TLS, and is trying to establish the encryption prior to receving the HELO from exim. The solution is to start another exim instance configured to respond to port 465 and which starts TLS negotiation immediately.

running:

  exim -bd -oX '[0.0.0.0]:465' -tls-on-connect

  [I think the Exim FAQ has a typo as it uses two colons (::)]

Will start this instance, then in main.inc.php:

// use this host for sending mails. // to use SSL connection, set ssl://smtp.host.com // if left blank, the PHP mail() function is used $rcmail_configsmtp_server? = 'ssl://your.host.here';

// SMTP port (default is 25; 465 for SSL) $rcmail_configsmtp_port? = 465;

// SMTP username (if required) if you use %u as the username RoundCube // will use the current username for login $rcmail_configsmtp_user? = '%u';

// SMTP password (if required) if you use %p as the password RoundCube // will use the current user's password for login $rcmail_configsmtp_pass? = '%p';

// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use // best server supported one) $rcmail_configsmtp_auth_type? = 'LOGIN';

I didn't have any luck leaving the smtp_auth_type empty, but PLAIN and LOGIN appear to work.

All appears to work properly.

Offline rinnes

  • Newbie
  • *
  • Posts: 3
Re: unable to send mail - smtp protocol violation
« Reply #2 on: February 24, 2008, 02:15:07 PM »
Excellent. That fixed the problem that was having.

Thanks again and if anyone else has this problem then this is the solution!

Offline rinnes

  • Newbie
  • *
  • Posts: 3
Re: unable to send mail - smtp protocol violation
« Reply #3 on: February 24, 2008, 03:53:13 PM »
One final thing... I'm guessing this Exim command will need to be run on boot to ensure the 2nd daemon listening on 465 is running. How do I do that?

Do I add this command somewhere in the /etc/init.d/exim4 file? or somewhere else?

Thanks.