Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: dracorp on October 18, 2010, 09:01:20 AM

Title: Problem with send message while create a new identity
Post by: dracorp on October 18, 2010, 09:01:20 AM
When I create a new identity, the RC sends a confirmation from [email protected]($rcmail_config['admin_email'] = "[email protected]") address (MAIL FROM), but with the currently logged on user.
However, the postfix restrictions make it impossible to send messages as another user.
Why do not currently have a plug SendMessage? I think that in another way I can send a confirmation of a new identity?
I do not want and I can not change the configuration of postfix.
I use RC 4.2 and a collection of myroundcube plugins and others.
Fragment of postfix's log:
Oct 18 14:23:31 mailserver postfix/smtpd[4620]: Anonymous TLS connection established from localhost[127.0.0.1]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Oct 18 14:23:31 mailserver postfix/smtpd[4620]: NOQUEUE: reject: MAIL from localhost[127.0.0.1]: 553 5.7.1 <[email protected]>: Sender address rejected: not owned by user piecia; from=<[email protected]> proto=ESMTP helo=<mailserver>
Title: Problem with send message while create a new identity
Post by: rosali on October 18, 2010, 09:33:42 AM
Try in checked_identities config:

$rcmail_config['bounce_is_safe'] = TRUE;
Title: Problem with send message while create a new identity
Post by: dracorp on October 20, 2010, 04:21:04 AM
Thanks, it helped me almost. But unfortunately for me username_domain* option is not set and takes the form MAIL FROM: . Then it is blocked in the session postfix:
localhost[127.0.0.1]: 504 5.5.2 <piecia>: Sender address rejected: need fully-qualified address
Maybe this should be dependent on such $rcmail_config['mail_domain']?
I'll try to fix it but unfortunately I'm not a programmer in PHP.

*) I use shell system users not virtual (in database)
Title: Problem with send message while create a new identity
Post by: dracorp on October 20, 2010, 05:21:09 AM
Maybe this:
--- plugins/checked_identities/checked_identities.php.orig  2010-08-09 15:38:44.000000000 +0200
+++ plugins/checked_identities/checked_identities.php   2010-10-20 11:17:31.000000000 +0200
@@ -381,10 +381,21 @@
       $body = str_replace(&quot;\r&quot;,&quot;&quot;,$body);
       $body = str_replace(&quot;\n&quot;,&quot;\r\n&quot;,$body);
       if($rcmail->config->get('bounce_is_safe')){
-        $from = $_SESSION['username'] . $rcmail->config->get('username_domain');
-        if (!preg_match(&quot;/$this->EMAIL_ADDRESS_PATTERN/i&quot;, $from)){
-          $from = $rcmail->config->get('admin_email');
-        }
+       if($rcmail->config->get('username_domain') === ''){
+           if(is_array($rcmail->config->get('mail_domain'))){
+               reset($rcmail->config->get('mail_domain'));
+               $from = $_SESSION['username'] . '@' . current($rcmail->config->get('mail_domain'));
+           }//mail_domain is array
+           else{
+               $from = $_SESSION['username'] . '@' . $rcmail->config->get('mail_domain');
+           }//mail_domain is not array
+       }//username_domain===''
+       else{
+           $from = $_SESSION['username'] . $rcmail->config->get('username_domain');
+       }//username_domain!==''
+       if (!preg_match(&quot;/$this->EMAIL_ADDRESS_PATTERN/i&quot;, $from)){
+         $from = $rcmail->config->get('admin_email');
+       }
       }
       else{
         $from = $rcmail->config->get('admin_email');