fmbiete / PHP-Push-2

Z-Push Fork With CalDAV/LDAP/CardDAV/IMAP AS12+ Support
4 stars 4 forks source link

Sender Fullname #15

Closed ghost closed 11 years ago

ghost commented 11 years ago

With Exchange Account Type on my Phone, i cant specify a Fullname. All Mail is send with only the Mailadres. Is there a way to specify also a Fullname in the config?

fmbiete commented 11 years ago

Not in z-push config. The user full name must be set in the e-mail client settings.

This is a example for Android devices: Android

ghost commented 11 years ago

Ahh is see. I think this should be the best way, since i cant know what fur users are coming in, if i config z-push. But on WIndows Phone, there is no field to define a Fullname. You can set E-Mail-Address, Password, Domain, Server, SSL and PIM Types (Contacts, Mail, Calendar and ToDo). If i setup Exchange via Zarafa, the Fullname is send. I think it comes from the Zarafa Settings. So we must find a other way for BackendIMAP, since there is no field in Windows Phone. I havetried to setup the Mail Address like "Firstname Lastname user@domain.tld". This works, but sometimes (forwarding of Mail), the name isnt used and sometimes i see a RFC822 Error in the Logfile. So i think here is room for a enhancement.

fmbiete commented 11 years ago

The IMAP server doesn't store the fullname, so you can only get it from the client (it must come in the messages "From" header, something like "Francisco Miguel Biete fmbiete@domain.com")

If you configure an IMAP account in your Windows Phone, do you have that possibility??

Searching, I only have found a solution. Define a relation between the fullname and the IMAP username (config file or LDAP server), and add it to the "From" header.

We could ask Manfred/Sebastian their thoughts about this issue, but I really would not like to mix LDAP with IMAP for this, or maintain a file for all my users... In my opinion is a client problem.

ghost commented 11 years ago

Yes, if i configure a pure IMAP Account, i can fill in my Realname (Fullname). But not, if i configure a EAS Account. The i can only give Mailaddress, Username, Server and so on. On a Android, it seems that you can specify also a Fullname with EAS. But not on WIndows Phone.

fortiko commented 11 years ago

This is also very interesting for iOS. Perhaps my comment from the forum can help http://z-push.sourceforge.net/phpbb/viewtopic.php?f=7&t=2058

"Real Names", additional IMAP mappings

Postby ajl » Mon Jun 04, 2012 9:29 pm In the AS12.1 branch, the following settings exist that would be very useful in AS2.0, mainly the "Real Name" mapping that makes it possible to not only have an email address as the "From:" for emails, as discussed here:

http://z-push.sourceforge.net/phpbb/viewtopic.php?f=4&t=1642&start=10#p6091 http://z-push.sourceforge.net/phpbb/viewtopic.php?f=4&t=2005#p7121

In addition, on iOS 5.1.1 Drafts, Trash and Sent work magically, but perhaps not for all devices. From the AS12.1 fork:

 // Define username => fullname changes here
    // ideally this could also be a preference for a table lookup with a custom SQL or LDAP query
    // to integrate with existing infrastructure such as PostfixAdmin or OpenLDAP
    define('IMAP_USERNAME_FULLNAME', serialize(array(
            'first@last.tld'=>'Last, First M.',
            'user2'=>'Lastname2, Firstname2',
            )));

        // Additionally you have to have a Sent Items folder in case you plan to sync with Nokia MfE Built in client / certain HTC Adnroid devices!
    define('IMAP_SENTFOLDER', 'Sent'); // already exists in PHP-Push

        // You have to have a Deleted Items folder in case you plan to sync with Nokia MfE Built in client / certain HTC Adnroid devices!
    define('IMAP_DELETEDITEMSFOLDER', 'Trash');

        // You have to have a Draft folder in case you plan to sync with Nokia MfE Built in client / certain HTC Adnroid devices!
    define('IMAP_DRAFTSFOLDER', 'Drafts');
ghost commented 11 years ago

thx for the suggestion, but it doesnt work here on a Windows Phone Device. But its not this big problem. thx anyway.

fortiko commented 11 years ago

The backend code is missing for now, which (on the server!) will match your usernames with an array of know usernames and their real names, similar to what you can see here: https://github.com/dpeddi/activesync/blob/master/backend/imap.php (search on that page for IMAP_USERNAME_FULLNAME and/or map_user_fullname).

Ideally, this would of course not be a fixed array, but a dynamic lookup on the Dovecot/Postfix/PFA/Roundcube/whatever DB where the user already set his real name.

ghost commented 11 years ago

I know that this is backend code. i have changed it in the backend, but together with the phone it doesnt do anything. But the idea of getting this to work with a RoundCube Database would be very cool. Maybe anyone can figure out, how to pull this from the Database. Sure, i can write a simple query, but i have only access to my RoundCube DB. But its a good idea. But first we must get this to work with a hardcoded way, before we can fill this with values from a Query.

fmbiete commented 11 years ago

That would be beyond the backendIMAP... but after get the fullname you should force it into the SendMail function inside the backendIMAP.

That's a reaaaaaalllyyyyy dirty hack.

I will not implement the fixed array in config, since I have more than 3000 potential users. But could offer ldap/roundcube search as an option in the not near future

ghost commented 11 years ago

Hmmm in combination with roundcube, you could also realize a fullname query. I use Roundcube here to, and the fullname is saved in a mysql database. this and the search is a realy good idea.