[Dovecot] Expunge email Plugin
Hello everyone.....
I Need to know when a email is expunge, but i don't need change this action. I Need to call another action + the default action.
There is a plugin to do this ?
On Mon, 2010-06-21 at 17:27 -0300, Alex Baule wrote:
Hello everyone.....
I Need to know when a email is expunge, but i don't need change this action. I Need to call another action + the default action.
There is a plugin to do this ?
In v2.0 there is a notify plugin which you can pretty easily use to catch expunge events. mail_log plugin also uses it.
I use the notify plugin as a base to my plugin.
So, i need the filename from the expunged mail, to use to search my other file to erase.
What's the way to find the filename ? I thy to get by i_stream_get_name, but i'm lost with the input istream to get this.
2010/6/25 Timo Sirainen <tss@iki.fi>
On Mon, 2010-06-21 at 17:27 -0300, Alex Baule wrote:
Hello everyone.....
I Need to know when a email is expunge, but i don't need change this action. I Need to call another action + the default action.
There is a plugin to do this ?
In v2.0 there is a notify plugin which you can pretty easily use to catch expunge events. mail_log plugin also uses it.
hi,
i have a ubuntu server running Dovecot imap, how to backup everybody's email? rsync /home is enough? Thanks,
Angelo
It depens where dovecot are storing the email!
Do you know where is it ?
post the output of
# dovecot -n
[]'sf.rique
On Sat, Jun 26, 2010 at 8:35 PM, Angelo Chen <angelochen961@gmail.com>wrote:
hi,
i have a ubuntu server running Dovecot imap, how to backup everybody's email? rsync /home is enough? Thanks,
Angelo
Hi,
this is the output of dovecot -n, backing up /home directory in the hard disk enough ? Thanks,
Angelo
# 1.1.4: /etc/dovecot/dovecot.conf log_timestamp: %Y-%m-%d %H:%M:%S protocols: imap imaps pop3 pop3s login_dir: /var/run/dovecot/login login_executable(default): /usr/lib/dovecot/imap-login login_executable(imap): /usr/lib/dovecot/imap-login login_executable(pop3): /usr/lib/dovecot/pop3-login mail_privileged_group: mail mail_executable(default): /usr/lib/dovecot/imap mail_executable(imap): /usr/lib/dovecot/imap mail_executable(pop3): /usr/lib/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/modules/imap mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3 auth default: passdb: driver: pam userdb: driver: passwd
On Jun 27, 2010, at 11:13 AM, Henrique Fernandes wrote:
It depens where dovecot are storing the email!
Do you know where is it ?
post the output of
# dovecot -n
[]'sf.rique
On Sat, Jun 26, 2010 at 8:35 PM, Angelo Chen <angelochen961@gmail.com> wrote: hi,
i have a ubuntu server running Dovecot imap, how to backup everybody's email? rsync /home is enough? Thanks,
Angelo
On Mon, 2010-06-28 at 14:27 +0800, Angelo Chen wrote:
auth default: passdb: driver: pam userdb: driver: passwd
You're using system accounts so yes, but I'd hope that if server is on any importance you would be doing more than just backing up that. /home /etc /var/mail or where ever your MTA stores its mail before users get it should be backed up daily at a bare minimum.
If this is a server of importance you should be doing nightly tar backups of at least /etc, once a week a full rsync of the entire box, and a nightly rsync of your mail store, in your case /home and /var/mail (or /var/spool/postfix if you're using that), and use that on a rolling 7 day basis... providing you have the space for it on your backup server.
Cheers
Hi Noel,
I use exim4 and it delivers right into ~/.Maildir, so I assume /home contains all the emails, right? why we need to back up /etc and /var/mail? Thanks,
Angelo
auth default: passdb: driver: pam userdb: driver: passwd
You're using system accounts so yes, but I'd hope that if server is on any importance you would be doing more than just backing up that. /home /etc /var/mail or where ever your MTA stores its mail before users get it should be backed up daily at a bare minimum.
If this is a server of importance you should be doing nightly tar backups of at least /etc, once a week a full rsync of the entire box, and a nightly rsync of your mail store, in your case /home and /var/mail (or /var/spool/postfix if you're using that), and use that on a rolling 7 day basis... providing you have the space for it on your backup server.
Cheers
On Tue, 2010-06-29 at 22:28 +0800, Angelo Chen wrote:
Hi Noel,
I use exim4 and it delivers right into ~/.Maildir, so I assume /home contains all the emails, right? why we need to back up /etc and /var/mail? Thanks,
No real experience with Exim, last time I looked at it was 10 years ago, but if that's where it stores all received messages, read or new-unread, then /home it is.
/etc contains most of your system config stuff, always good idea to back it up, if this is a server it should have no GUI crap installed so it should be fairly small, and /var/vmail was an example only, just like i'd say /var/www if this was a web server, or /var/named if DNS server. /var/mail /var/vmail etc is not applicable to you as you use system and not virtual users.
Cheers
You're using system accounts so yes, but I'd hope that if server is on any importance you would be doing more than just backing up that. /home /etc /var/mail or where ever your MTA stores its mail before users get it should be backed up daily at a bare minimum.
If this is a server of importance you should be doing nightly tar backups of at least /etc, once a week a full rsync of the entire box, and a nightly rsync of your mail store, in your case /home and /var/mail (or /var/spool/postfix if you're using that), and use that on a rolling 7 day basis... providing you have the space for it on your backup server.
Cheers
On Sat, 2010-06-26 at 12:59 -0300, Alex Baule wrote:
I use the notify plugin as a base to my plugin.
So, i need the filename from the expunged mail, to use to search my other file to erase.
What's the way to find the filename ? I thy to get by i_stream_get_name, but i'm lost with the input istream to get this.
This gives you the base filename:
mail_get_special(mail, MAIL_FETCH_UIDL_FILE_NAME, &fname)
Great... its work
Now i need a header value too, i see in mail_log plugin, some functions to get headers value...
but it's a enum with some know fields.
There is some function like this mail_get_special, to get a header value ?
like "get_header_value(mail,"HEADERFIELD", &value);" ??
2010/6/29 Timo Sirainen <tss@iki.fi>
On Sat, 2010-06-26 at 12:59 -0300, Alex Baule wrote:
I use the notify plugin as a base to my plugin.
So, i need the filename from the expunged mail, to use to search my other file to erase.
What's the way to find the filename ? I thy to get by i_stream_get_name, but i'm lost with the input istream to get this.
This gives you the base filename:
mail_get_special(mail, MAIL_FETCH_UIDL_FILE_NAME, &fname)
On Tue, 2010-06-29 at 11:23 -0300, Alex Baule wrote:
There is some function like this mail_get_special, to get a header value ?
like "get_header_value(mail,"HEADERFIELD", &value);" ??
lib-storage/mail-storage.h and http://wiki.dovecot.org/Design/Storage/Mail describe different ways of getting stuff. There's mail_get_first_header().
participants (5)
-
Alex Baule
-
Angelo Chen
-
Henrique Fernandes
-
Noel Butler
-
Timo Sirainen