View Issue Details

IDProjectCategoryView StatusLast Update
0000471SOGoWeb Mailpublic2010-04-08 11:29
Reportersteeeeeveee Assigned Toludovic  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.2.1 
Target Version1.2.2Fixed in Version1.2.2 
Summary0000471: Double FROM address when sending mail
Description

I have SOGo (MTN trunk) installed and am using MySQL for the authentication. The view holding the user information looks as follow:
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| c_uid | varchar(255) | NO | | NULL | |
| c_name | varchar(255) | NO | | NULL | |
| c_password | varchar(255) | NO | | NULL | |
| c_cn | varchar(255) | NO | | NULL | |
| mail | varchar(255) | NO | | NULL | |
+------------+--------------+------+-----+---------+-------+

c_uid, c_name, c_cn and mail are all having the same value: the users email address (aka: foo@bar.tld)

c_password has the password in plain text.

Now when I send a mail from SOGo I always get a double entry in the from header:

from: foo@bar.tld,
foo@bar.tld

Why is that? How can I avoid this issue?

My Defaults file contains:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//GNUstep//DTD plist 0.9//EN" "http://www.gnustep.org/plist-0_9.xml&quot;>
<plist version="0.9">
<dict>
<key>NSGlobalDomain</key>
<dict>
</dict>
<key>gdnc</key>
<dict>
</dict>
<key>sogod</key>
<dict>
<key>GCSFolderDebugEnabled</key>
<string>NO</string>
<key>GCSFolderStoreDebugEnabled</key>
<string>NO</string>
<key>NGUseUTF8AsURLEncoding</key>
<string>YES</string>
<key>OCSFolderInfoURL</key>
<string>mysql://mysql_user:mysql_password:3306/sysdb_sogo/sogo_folder_info</string>
<key>OCSFolderManagerSQLDebugEnabled</key>
<string>NO</string>
<key>SOGoACLsSendEMailNotifications</key>
<string>YES</string>
<key>SOGoAppointmentSendEMailNotifications</key>
<string>YES</string>
<key>SOGoAuthenticationMethod</key>
<string>LDAP</string>
<key>SOGoDayEndTime</key>
<string>18</string>
<key>SOGoDayStartTime</key>
<string>8</string>
<key>SOGoDraftsFolderName</key>
<string>Drafts</string>
<key>SOGoFirstDayOfWeek</key>
<string>1</string>
<key>SOGoFoldersSendEMailNotifications</key>
<string>YES</string>
<key>SOGoForceIMAPLoginWithEmail</key>
<string>YES</string>
<key>SOGoIMAPServer</key>
<string>localhost</string>
<key>SOGoLanguage</key>
<string>German</string>
<key>SOGoLoginModule</key>
<string>Mail</string>
<key>SOGoMailDomain</key>
<string>foo.tld</string>
<key>SOGoMailListViewColumnsOrder</key>
<array>
<string>Flagged</string>
<string>Unread</string>
<string>Attachment</string>
<string>Priority</string>
<string>Date</string>
<string>Subject</string>
<string>From</string>
<string>Size</string>
</array>
<key>SOGoMailMessageCheck</key>
<string>Every 2 minutes</string>
<key>SOGoMailSpoolPath</key>
<string>/var/tmp</string>
<key>SOGoMailingMechanism</key>
<string>smtp</string>
<key>SOGoProfileURL</key>
<string>mysql://mysql_user:mysql_password:3306/sysdb_sogo/sogo_user_profile</string>
<key>SOGoSMTPServer</key>
<string>127.0.0.1:30025</string>
<key>SOGoSentFolderName</key>
<string>Sent</string>
<key>SOGoTimeFormat</key>
<string>%H:%I</string>
<key>SOGoTimeZone</key>
<string>Europe/Zurich</string>
<key>SOGoTrashFolderName</key>
<string>Trash</string>
<key>SOGoUserSources</key>
<array>
<dict>
<key>canAuthenticate</key>
<string>YES</string>
<key>id</key>
<string>maillogin</string>
<key>isAddressBook</key>
<string>NO</string>
<key>type</key>
<string>sql</string>
<key>userPasswordAlgorithm</key>
<string>none</string>
<key>viewURL</key>
<string>mysql://mysql_user:mysql_password:3306/sysdb_sogo/sogo_view</string>
</dict>
</array>
<key>SxVMemLimit</key>
<string>384</string>
<key>WOLogFile</key>
<string>/var/log/sogo/sogod.log</string>
<key>WOMessageUseUTF8</key>
<string>YES</string>
<key>WOParsersUseUTF8</key>
<string>YES</string>
<key>WOPidFile</key>
<string>/var/run/sogod/sogod.pid</string>
<key>WOPort</key>
<string>20000</string>
<key>WOUseRelativeURLs</key>
<string>YES</string>
<key>WOWorkersCount</key>
<string>1</string>
</dict>
</dict>
</plist>

The service in Postfix is:

127.0.0.1:30025 inet n - n - - smtpd
-o content_filter=lmtp-amavis:[127.0.0.1]:10024
-o cleanup_service_name=pre-cleanup
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_delay_reject=no
-o smtpd_error_sleep_time=0
-o smtpd_hard_error_limit=1000
-o smtpd_helo_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_soft_error_limit=1001
-o strict_rfc821_envelopes=no

I use a own service for SOGo because I don't know how to get SOGo to use SMTP AUTH (which I usually require for sending mail over the server).

TagsNo tags attached.

Activities

ludovic

ludovic

2010-03-29 16:59

administrator   ~0000824

What about if you set c_cn to the actual name of the user?

steeeeeveee

steeeeeveee

2010-03-29 20:05

reporter   ~0000825

Then the "From" header displays something like this:
from: =?utf-8?q?John=20Doe?= <john.doe@domain.tld>

My problem is that I don't have control over the real user name. Every domain owner can add whatever he/she likes to that field (even leaving it empty). Some of them have added the email address to that field. And IMHO SOGo should not add a double "From" header if c_cn is equal to c_name.

Another thing that I don't understand is when composing a message in SOGo then the "From:" line shows "From: john.doe@domain.tld <john.doe@domain.tld>" when c_cn is equal to c_name but when sending the mail then then the from header gets doubled. That is IMHO not consistent. I would at least expect:
from: =?UTF-8?q?john=2Edoe=40domain=2Etld?= <john.doe@domain.tld>

And definitely not:
from: john.doe@domain.tld,
john.doe@domain.tld

The other problem I have is that if c_cn is empty then my Postfix is barking about illegal address syntax (would need to debug the session to see what the heck SOGo is sending to Postfix):

Mar 30 01:46:39 nyx postfix/smtpd[6065]: warning: Illegal address syntax from localhost[127.0.0.1] in MAIL command: john.doe@domain.tld

And SOGo can not send the mail.

I guess you are now going to tell me that I need to have better data quality regarding user data. And you are right. But a software like SOGo on the other hand should be able to cope with empty c_cn or with the case that c_cn=c_name.

And keep in mind that not everyone has the real user name in his/her data set. And your documentation is explicitly mentioning to use the same data for c_cn as used for c_name in case one does not have the real user name available.

ludovic

ludovic

2010-03-29 20:35

administrator   ~0000826

In fact, the doc says to use the same data for c_name as for c_uid, not for c_cn. c_name is an ID, not the "common name" of the person. From the doc:

? c_uid : will be used for authentication – it's a username
or username@domain.tld
? c_name : will be used to uniquely identify entries – which
can be identical to c_uid
? c_cn : the user's common name

steeeeeveee

steeeeeveee

2010-03-29 21:44

reporter   ~0000827

Okay. Then I got it wrong from memory. Anyway... IMHO if c_cn is indeed the email address instead of the users common name then SOGo is acting weird. As mentioned above a consistent approach for the from line should be in that case:
from: =?UTF-8?q?john=2Edoe=40domain=2Etld?= <john.doe@domain.tld>

And definitely not:
from: john.doe@domain.tld,
john.doe@domain.tld

wsourdeau

wsourdeau

2010-04-07 14:49

viewer   ~0000884

This bug happens in sope-mime, in NGMailAddressParser

steeeeeveee

steeeeeveee

2010-04-07 18:30

reporter   ~0000894

So I should file a bug for SOPE or are you going to do this?

ludovic

ludovic

2010-04-07 22:13

administrator   ~0000895

No no, keep the bug here, SOPE is dead anyway.

wsourdeau

wsourdeau

2010-04-08 11:29

viewer   ~0000898

Actually, I was wrong. SOPE seems ok. It's SOGo that didn't provide an rfc822-compliant address.

wsourdeau

wsourdeau

2010-04-08 11:29

viewer   ~0000900

Fixed in 15cce56fb2a02fa6d50d7fd1d75ccff373d6108e

Issue History

Date Modified Username Field Change
2010-03-04 12:59 steeeeeveee New Issue
2010-03-19 14:17 ludovic Status new => assigned
2010-03-19 14:17 ludovic Assigned To => ludovic
2010-03-19 14:17 ludovic Target Version => 1.2.2
2010-03-29 16:59 ludovic Note Added: 0000824
2010-03-29 16:59 ludovic Status assigned => feedback
2010-03-29 20:05 steeeeeveee Note Added: 0000825
2010-03-29 20:35 ludovic Note Added: 0000826
2010-03-29 21:44 steeeeeveee Note Added: 0000827
2010-04-07 14:49 wsourdeau Category Web Mail => SOPE
2010-04-07 14:49 wsourdeau Note Added: 0000884
2010-04-07 18:30 steeeeeveee Note Added: 0000894
2010-04-07 22:13 ludovic Note Added: 0000895
2010-04-08 11:29 wsourdeau Note Added: 0000898
2010-04-08 11:29 wsourdeau Category SOPE => Web Mail
2010-04-08 11:29 wsourdeau Note Added: 0000900
2010-04-08 11:29 wsourdeau Status feedback => resolved
2010-04-08 11:29 wsourdeau Fixed in Version => 1.2.2
2010-04-08 11:29 wsourdeau Resolution open => fixed