4

We have a roundcube instance on our ubuntu server.

Since yesterday, we are not able to send emails anymore. After hitting the send-button in roundcube, the "Nachricht wird gesendet..."-Message (E-Mail is being sent) loads endlessly.

After searching the logs, I found the error message:

[30-Jun-2015 10:33:50 UTC] PHP Warning:  Missing argument 1 for Mail_mimePart::Mail_mimePart(), called in [***]/roundcube/vendor/pear/mail_mime/Mail/mime.php on line 1288 and defined in [***]/roundcube/vendor/pear/mail_mime-decode/Mail/mimePart.php on line 127
[30-Jun-2015 10:33:50 UTC] PHP Fatal error:  Call to undefined method Mail_mimePart::encodeHeader() in [***]/roundcube/vendor/pear/mail_mime/Mail/mime.php on line 1289

It it still possible to sent E-Mails directly via SMTP / Dovecot, so everything should be fine on this side.

My first thought was to install the pear packages, but they seem to be correctly installed inside roundcube.

Stacktrace is:

[30-Jun-2015 11:52:26 UTC] Backtrace from warning 'Missing argument 1 for Mail_mimePart::Mail_mimePart(),
 called in [...]/roundcube/vendor/pear/mail_mime/Mail/mime.php on line 1334 and 
defined' at [...]/roundcube/vendor/pear/mail_mime-decode/Mail/mimePart.php 127: [...]/roundcube/index.php 290 calling include_once() |
 [...]/roundcube/program/steps/mail/sendmail.inc 509 calling headers() |
 [...]/roundcube/vendor/pear/mail_mime/Mail/mime.php 1101 calling encodeHeaders() |
 [...]/roundcube/vendor/pear/mail_mime/Mail/mime.php 1314 calling encodeHeader() |
 [...]/roundcube/vendor/pear/mail_mime/Mail/mime.php 1334 calling Mail_mimePart()
[30-Jun-2015 11:52:26 UTC] PHP Fatal error:  Call to undefined method Mail_mimePart::encodeHeader() in [...]roundcube/vendor/pear/mail_mime/Mail/mime.php on line 1335

Notes:

  • Server is up-to-date.
  • Composer was updated
Roman Holzner
  • 5,738
  • 2
  • 21
  • 32
  • Seems like yout pear 'mail_mime' package has been updated, and its version is not backwards compatible. Either revert to older version (if you know which one), or update your php code. – Alex Chorry Jul 01 '15 at 16:28
  • I already solved it earlier, but this is not incorrect, see my answer! Thank you! – Roman Holzner Jul 01 '15 at 20:54

4 Answers4

1

Unsure where to report but for the moment you can solve this by changing the line 75 in /vendor/pear/mail_mime/Mail/mime.php from require_once 'Mail/mimePart.php'; to require_once 'mimePart.php';

André
  • 11
  • 1
1

I had the same situation as the poster. I had been (unsuccessfully) messing about with plugins and then I could no longer send mail. roundcube/logs/error had the same message from when I tried to send.

The Roundcube Community Forum has a solution that worked for me.

I removed the roundcube/vendor dir (actually, I did mv vendor vendor_bak just in case) and did composer install from the roundcube dir.

Suddenly I could send again.

Mark Kasson
  • 1,600
  • 1
  • 15
  • 28
0

I just completely reinstalled roudcube (User data was either in MySQL or Dovecot, so no data loss).

It was a similar problem as @Alex Chorry already pointed out in the comments. It was caused by composer updating the mail_mime package while installing a plugin (in my case it was globaladdressbook, but I've seen this problem also on other plugin). Also reverting the php wasn't working, as it resulted in a plugin error.

So to solve this problem, I completely ignored composer, and never installed it. I manually installed all the plugins as pointed out her on github:

  • Place this plugin folder into plugins directory of Roundcube
  • Add globaladdressbook to $config['plugins'] in your Roundcube config
Roman Holzner
  • 5,738
  • 2
  • 21
  • 32
0

I removed these 3 lines from composer.json

    "pear/mail_mime": ">=1.8.9",
    "pear/mail_mime-decode": "~1.5.5",
    "pear/net_smtp": "dev-master",

I then ran php composer.phar update

Then I put the lines back, ran the update: incc:/var/lib/roundcube# php composer.phar update Loading composer repositories with package information Initializing PEAR repository http://pear.php.net Updating dependencies (including require-dev) - Installing pear/pear_exception (dev-master 8c18719) Cloning 8c18719fdae000b690e3912be401c76e406dd13b

  • Installing pear/console_getopt (v1.4.1) Loading from cache

  • Installing pear/pear-core-minimal (dev-master 0457483) Cloning 0457483add2e037a5e00eb186b9dce7ea3b49da2

  • Installing pear/net_socket (dev-trunk bbe6a12) Cloning bbe6a12bb4f7059dba161f6ddd43f369c0ec8d09

  • Installing pear/net_smtp (dev-master 3ef8150) Cloning 3ef8150ef230314f2a70e803e13a9926e432f7af

  • Installing pear/mail_mime (dev-master 66b2a01) Cloning 66b2a01acabe0b8d0ce606833d5cefc1a49a8887

  • Installing pear/mail_mime-decode (1.5.5.2) Downloading: 100%

And logged back into roundcube and I could send again.

I didn't really understand the author's answer but as I saw it could be to a rogue plugin (I have installed and removed a few) I thought I would try this out that worked.

JrRockeTer
  • 35
  • 5