[Dovecot] plugin development: retrieve username -d -f inside plugins
Hello,
i don't know if it a the right place to ask my question related to the development of dovecot plugins, please correct me if it is not.
I'm trying some dovecot plugin development. I did a little plugin that suit my needs but i'd like to go further now... I would like to know if there is a kind of "getenv" function that I could call to retrieve in my plugin the username of the mailbox being delivered by dovecot-lda or served by imap server.
For example, when I use the deliver with "cat file.txt | deliver -d " user@domain.net" -f "me@domain.net" I would like to call a function that could return for me the argument of "-d" or "-f".
i'm working with dovecot 2.0.17 by now.
Thank you
On 27.8.2012, at 12.11, Alano Conraz wrote:
I'm trying some dovecot plugin development. I did a little plugin that suit my needs but i'd like to go further now... I would like to know if there is a kind of "getenv" function that I could call to retrieve in my plugin the username of the mailbox being delivered by dovecot-lda or served by imap server.
struct mail_user->username has it. How you get to struct mail_user depends on where you want to access it from. Note that each process is capable of handling multiple different users (although it's not commonly done).
struct mail_user->username has it. How you get to struct mail_user depends on where you want to access it from. Note that each process is capable of handling multiple different users (although it's not commonly done).
i'm not sure to understand the last part. mail_user->username is a char *, right ? What is the content of the string if there is multiple users ? Thanks for your answer btw.
On 27.8.2012, at 16.47, Alano Conraz wrote:
struct mail_user->username has it. How you get to struct mail_user depends on where you want to access it from. Note that each process is capable of handling multiple different users (although it's not commonly done).
i'm not sure to understand the last part. mail_user->username is a char *, right ? What is the content of the string if there is multiple users ? Thanks for your answer btw.
Each user has a separate struct mail_user. I was mainly trying to say that that's the reason for why there's no global variable or such where you can get access to the username.
participants (2)
-
Alano Conraz
-
Timo Sirainen