Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th September 2010, 09:29
vitor vitor is offline
Junior Member
 
Join Date: Jul 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to use MYSQL_NAME_FIELD in authmysqlrc

Hello!
I have set up a mail system accordingly http://howtoforge.com/virtual-users-...dora-13-x86_64
everything works fine.

But i would like to know if its possible to add a new field name to users table
and use it as mail sender/recipient name?

What i did:
I have uncommented MYSQL_NAME_FIELD in authmysqlrc and pointed required field name, added to the table USERS new field name, filled it.

Like this:
MYSQL_NAME_FIELD name

After restarting the server i mailed a sample letter but sender was e-mail address not the name from table users.

Would you be so kind to answer my question
Reply With Quote
Sponsored Links
  #2  
Old 15th September 2010, 17:43
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Can you post your authmysqlrc?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 15th September 2010, 22:13
vitor vitor is offline
Junior Member
 
Join Date: Jul 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko View Post
Can you post your authmysqlrc?
Sure!

Here it is...

MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD xxxxxxxx
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
MYSQL_NAME_FIELD name
MYSQL_QUOTA_FIELD quota

I also turned DEBUG_LOGIN=2 in /etc/authlib/authdaemonrc
to watch mail log for reading "name" field from table.

Here some of it, hope it would help

Sep 16 00:03:18 mail authdaemond: received auth request, service=smtp, authtype=login
Sep 16 00:03:18 mail authdaemond: authmysql: trying this module
Sep 16 00:03:18 mail authdaemond: SQL query: SELECT email, password, "", 5000, 5000, "/home/vmail", CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/'), quota, name, "" FROM users WHERE email = 'vvedischev@domain.ru'
Sep 16 00:03:18 mail authdaemond: password matches successfully
Sep 16 00:03:18 mail authdaemond: authmysql: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=vvedischev@domain.ru, fullname=Vedischev V.N., maildir=domain.ru/vvedischev/, quota=209715200, options=<null>
Sep 16 00:03:18 mail authdaemond: authmysql: clearpasswd=<null>, passwd=BAcr3ni.MG.eY
Sep 16 00:03:18 mail authdaemond: Authenticated: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=vvedischev@domain.ru, fullname=Vedischev V.N., maildir=domain.ru/vvedischev/, quota=209715200, options=<null>
Sep 16 00:03:18 mail authdaemond: Authenticated: clearpasswd=xxxxxxxx, passwd=BAcr3ni.MG.eY


here we can see fullname takes exact meaning of name field from user table.

But sender's/recipient's name goes e-mail anyway.
Reply With Quote
  #4  
Old 16th September 2010, 14:24
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Ah, now I understand what you're trying to do. You must set the sender name in your email client, and besides, authmysqlrc is used by Courier which just fetches mails from your mailbox via IMAP/POP3. Postfix is used for sending mails.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 16th September 2010, 16:07
vitor vitor is offline
Junior Member
 
Join Date: Jul 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes i know i should set sender's name in my mail client to see it.

But i would like to know if it is possible for postfix to send name that courier reads from users table without setting user's name in e-mail client?

If its possible i would like to know how i can do it.
Reply With Quote
  #6  
Old 17th September 2010, 15:24
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

I don't think this is possible...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 17th September 2010, 22:49
vitor vitor is offline
Junior Member
 
Join Date: Jul 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Anyway, Falko, thanks a lot for answers and tutorials of course!!!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:57.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.