| | 61 | |
| | 62 | |
| | 63 | === Configuring for Virtual Users === |
| | 64 | |
| | 65 | Virtual users are useful for hosting providers where a single mailserver is providing email for a number of different domains. The goal is that the user logs in to roundcube with their email login/password, and roundcube knows where to lookup their complete email address. Two options are support, SQL lookups or a sendmail style virtuser file. |
| | 66 | |
| | 67 | In order to test if virtuser is configured correctly, log in to roundcube with a user that does not exist yet. Compose a message, if you see the From address as user@correct_domain, then it worked. If you see user@localhost, something is wrong. To reset and try again, delete that user from the roundcube users and identities tables. |
| | 68 | |
| | 69 | 1) virtuser_file |
| | 70 | {{{ |
| | 71 | $rcmail_config['virtuser_file'] = '/etc/mail/virtuser'; |
| | 72 | }}} |
| | 73 | |
| | 74 | This assumes that the file /etc/mail/virtuser contains information about your virtual users in the following format: |
| | 75 | |
| | 76 | {{{ |
| | 77 | user@domain login1 |
| | 78 | user@domain login2 |
| | 79 | }}} |
| | 80 | |
| | 81 | 2) virtuser_query (SQL) |
| | 82 | {{{ |
| | 83 | $rcmail_config['virtuser_query'] = "SELECT email_address FROM database.table WHERE login = '%u'"; |
| | 84 | }}} |
| | 85 | |
| | 86 | If you are using postfix and/or some kind of hosting panel, chances are your email accounts are already stored in a SQL table. If that is the case, you want to lookup the emails with a virtuser_query. The parts of the example query: |
| | 87 | |
| | 88 | {{{ |
| | 89 | // email_address - the first column returned by the query must be the complete email address |
| | 90 | // database - name of the database where your table is located, the roundcube db user must have read access |
| | 91 | // table - name of the table where your email addresses are stored |
| | 92 | // login - name of the field that contains the username that is used to log in to roundcube (and send/receive email) |
| | 93 | }}} |