[Vtigercrm-developers] Individual Email Outgoing Server settings (solution)

MAGGI Conrado RE-INGENIA conrado at reingenia.com.ar
Wed Nov 21 07:27:17 PST 2012


Joe,

Hi. The main issue is google apps or gmail since they override the 
sender address by the login user. So all emails arrived like: 
admin at crm.com on behalf of youruseremail at crm.com

And usually the recipient respond to admin at crm.com and not the user. We 
have faced this issue many times.

Detlef,

Thanks for the path. Maybe a better approach would be reading the user 
info setup in mail manager since all the info you need is already there. 
Or create these fields directly in user module using vtlib this way they 
are editable using UI (My Preferences). If you need an example please 
let me know.

Conrado


On 11/21/2012 12:01 PM, Joe Bordes wrote:
> Hi,
>
> vtiger_systems table is used for some other configurations. server_path
> is used for the ftp backups
>
> I do have one question: can you explain what motivates this change?  I
> mean, the application works correctly without this change in the
> majority of servers, so why bother? What am I missing?
>
> Joe
> TSolucio
>
>
> On 21/11/12 14:57, mail at dvoges.de wrote:
>> Hello Community,
>>
>> I solved the problem, that emails out of vtiger are send by one common
>> email account. With this solution it is possible to provide every user
>> an individual smtp account.
>>
>> 1) Changes in the DB (setting and values)
>>
>> Table: ?vtiger_systems? New Column: "user" with varchar(63) => here is
>> the user name of the email sender which should match with
>> ?vtiger_users?->?user_name?.
>> As ?vtiger_systems?->?Server_Type? I use the value ?usermail?.
>> The rest fields are filled with the individual outgoing mail server
>> account data.
>> Please pay attention to ?vtiger_systems_seq? and set the increases
>> index value of ?vtiger_systems?.
>>
>> There is no GUI for register new entries, it has to be done manually by sql.
>> (Question: There is a field ?vtiger_systems?->?server_path? which is
>> not shown or editable in the vtiger gui, but it is necessary for our
>> email provider, is this a bug?)
>>
>>
>> 2) Changes in the code
>>
>> I replaced the function ?getFromEmailAddress? in the file
>> "\modules\MailManager\src\models\Draft.php" with
>>
>> ##############################################
>> function getFromEmailAddress() {
>>       global $adb, $current_user;
>>       $fromEmail = false;
>>       if (Vtiger_Version::check('5.2.0', '>=')) {
>>          $smtpFromResult = $adb->pquery('SELECT from_email_field FROM
>> vtiger_systems WHERE server_type=? and
>> user="'.$current_user->column_fields['user_name'].'"',
>> array('usermail'));
>>          if ($adb->num_rows($smtpFromResult)) {
>>             $fromEmail = decode_html($adb->query_result($smtpFromResult,
>> 0, 'from_email_field'));
>>          }
>>          else {
>>             $smtpFromResult = $adb->pquery('SELECT from_email_field FROM
>> vtiger_systems WHERE server_type=?', array('email'));
>>             if ($adb->num_rows($smtpFromResult)) {
>>                $fromEmail =
>> decode_html($adb->query_result($smtpFromResult, 0, 'from_email_field'));
>>             }
>>          }
>>       }
>>       if (empty($fromEmail)) $fromEmail = $current_user->column_fields['email1'];
>>       return $fromEmail;
>> }
>> ##############################################
>>
>> The function at first tries to find an individual email by ?usermail?
>> and ?user->name?, if this has no result it uses the old method by
>> searching the ?mail? ? Data.
>>
>>
>> I would like to hear some feedback. Questions are also welcome.
>>
>> Best wishes from Munich, Germany
>>
>> Detlef Voges
>>
>>
>>
>>
>>
>> _______________________________________________
>> http://www.vtiger.com/
> _______________________________________________
> http://www.vtiger.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20121121/e1da6561/attachment.html 


More information about the vtigercrm-developers mailing list