Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to delete mails from maildir Post 302106235 by squid04 on Wednesday 7th of February 2007 08:42:32 AM
Old 02-07-2007
Script to delete mails from maildir

Hi buddies,

Anybody has any script to delete mails from Maildir/cur???
I mean is it possible to delete mails from Maildir/cur matching a particular subject like spam or fax???

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Maildir or mbox??

Hi, I was wondering if someone can tell me what the difference is exactly between maildir and mbox. We have a few solaris 9 systems here and would like to get an imap server running on them. I have setup fetchmail so that it retrives remote pop3 mail into an account, and that mail is then... (3 Replies)
Discussion started by: sugarat
3 Replies

2. UNIX for Dummies Questions & Answers

maildir question

Hi, I had a server hosting my website which kept all of my mail in a folder of my home dir called "mail". In that folder was "cur", "new", "tmp"... Which as I understand is the maildir format. I just recently switched to a new server, and am attempting to transfer all my mail over, however,... (0 Replies)
Discussion started by: patrick99e99
0 Replies

3. Shell Programming and Scripting

Delete all mails using mailx or mail

Hi , ?im a newbie using shell scripts. Is there any way to write a script that will delete all mails from my mailbox using mail or mailx command Thanks for your time E. Festas (2 Replies)
Discussion started by: ninjanesto
2 Replies

4. UNIX for Dummies Questions & Answers

Delete all mails on Solaris

How do I delete all my mails in the mailbox on Solaris? $mail ? d * Illegal numeric ? d * does not work. Also I want to retain the mailbox. Thanks, Rahul. (3 Replies)
Discussion started by: rahulrathod
3 Replies

5. Red Hat

Maildir quota in postfix.... urgent help

Friends, I am new to the postfix mail servers. My setup was configured with the below Mail Server(MTA,MRA) Postfix, Courier-IMAP Operating System Redhat Enterprise Linux 5.4 . SPAM Protection/Content Filter IMSS 7.1 DNS,LDAP BIND,OPENLDAP WebMail ... (0 Replies)
Discussion started by: kmvinay
0 Replies

6. Solaris

Delete clientmqueue mails

My clientmqueue directory is almost 6.7GB. There are like a thousands of e-mail that are present. Is there any way to delete them or just delete them normally. Also while deleting them, do i need to shutdown my sendmail service? Root FS is almost at 100%. Please help in this. Thanks in... (1 Reply)
Discussion started by: aksijain
1 Replies

7. Shell Programming and Scripting

mailx- how to delete least of mails

Hi, when i run the mailx command it gives me the least of mails . suppose there are 1- 150 mails and i want to delete 30 to 145 mails . then what command i have to use here? Thanks (6 Replies)
Discussion started by: aish11
6 Replies

8. Windows & DOS: Issues & Discussions

Direct junk mails to inbox (instead of going to delete)

hi, some of my email are going into the junk box. so i have stopped the email junk filtering as per the below link Outlook 2013 Junk Email Filter - Litmus but now the mails are going into delete box instead of my inbox. so any idea how can i stop the junk emails going into delete box and... (2 Replies)
Discussion started by: mallikarjun7777
2 Replies

9. Shell Programming and Scripting

Mails from shell script

Hello Gurus, I am facing some issues while doing the automation of some progs. The requirement is if any prog fails with error automatically the script will send alert for such failed progs. Below is the table structure:- PROG_NAME Description... (1 Reply)
Discussion started by: pokhraj_d
1 Replies

10. Shell Programming and Scripting

Help with consolidating mails sent by executing script

I have a script which checks for swap usage of the unix server. A cron job has been created to execute this script every hour and send the output via mail. This output is only required for a particular duration and it can range anywhere from 6 hours to 10 hours. So we are commenting out the... (1 Reply)
Discussion started by: kiran1112
1 Replies
DSYNC(1)							      Dovecot								  DSYNC(1)

NAME
dsync - Dovecot's mailbox synchronization utility SYNOPSIS
dsync [options] mirror location2 dsync [options] backup location2 DESCRIPTION
dsync is Dovecot's mailbox synchronization utility. It can be used for several different use cases: Two-way synchronization of mailboxes in different servers (via ssh(1)), creating backups of mails to a remote server, and convert mailboxes from/to different mailbox formats. The syncing is done as perfectly as possible: an IMAP or a POP3 client shouldn't be able to notice any differences between the two mail- boxes. Two-way syncing means that it's safe to do any kind of modifications in both sides, and dsync will merge the changes without losing any changes done on either side. This is possible because dsync can access Dovecot's index logs that keep track of changes. It's of course possible to have conflicts during merging, these are resolved in a safe way. See the dsync design document for more information. dsync uses the same configuration files as the rest of Dovecot (via doveconf binary). The entire configuration can be changed by giving -c parameter to another configuration file, or using -o parameter to override specific settings. When executing a remote dsync program it works the same way: it uses its own local configuration. dsync can be run completely standalone. It doesn't require any Dovecot server processes to be running, except when using -u parameter to do a userdb lookup from auth process. dsync can currently sync only one user at a time. If you want to dsync all users, you'll need to get a list of all users and execute dsync separately for each one. Any errors are written to stderr. OPTIONS
dsync recognizes the following command line options: -c config-file read configuration from the given config-file. By default /etc/dovecot/dovecot.conf will be used. -C alt_char Specifies an alter- native mailbox name character. If source and destination mailbox formats are different, it's possible that on one side there exists a mailbox name that isn't valid for the other side. These invalid mailbox names are fixed by replacing such invalid characters with the given alt_char. The default is '_'. -D Activates debug messages and makes dsync more verbose. -f Makes dsync run in "full sync" mode rather than "fast sync" mode. In fast sync mode dsync might skip syncing a mailbox, if both locations had modified it equally many times (i.e. highest-modseqs were equal), but with different changes. -m mailbox Specifies the mailbox that should be synchronized or from which mails should be converted. The default is to synchronize all respectively convert from all mailboxes. -o setting=value Overrides the configuration setting from /etc/dovecot/dovecot.conf and from the userdb with the given value. In order to override multiple settings, the -o option may be specified multiple times. -R Reverse backup direction, so mails in location2 are backed up to default mail location. -u user Specifies that the userdb lookup for the given user should be done and used to set up the environment (uid, gid, home, etc.). By default the system user's current environment will be used. -v Makes dsync more verbose. ARGUMENTS
location2 The first mail location is based on configuration (mail_location or userdb settings). It's also possible to override it by giving -o mail_location=mail_location setting. This parameter defines the other mail location that is used. If the location is on local filesystem, you can use a regular mail_location, such as maildir:/backup/user/Maildir If the location is on a remote server, dsync can ssh to it by giving host or user@host as the parameter. If user is specified, it's given as -u parameter to dsync, not to ssh. The ssh username is always the default. The final way to specify a location is to give a full command line or a path to a script that executes the dsync. For example: ssh mailuser@host dsync -u user COMMANDS
dsync provides the following commands: mirror Does a two-way synchronization between two mail locations. Changes in both locations are synchronized to the other one, without losing any changes made by either of them. Any potential UID conflicts are resolved by giving them new UIDs. backup Backup mails from default mail location to location2 (or vice versa, if -R parameter is given). No changes are ever done to the source location. Any changes done in destination are discarded. EXIT STATUS
dsync will exit with one of the following values: 0 Synchronization was done perfectly. 2 Synchronization was done without errors, but some changes couldn't be done, so the mailboxes aren't perfectly synchronized. Running dsync again usually fixes this. Typically this occurs for message modification sequences with newly created mailboxes. It can also occur if one of the mailboxes change during the syncing. 1, >2 Synchronization failed. EXAMPLE
MIRRORING Mirror mailboxes to a remote server. Any errors are written to stderr. dsync -u username mirror username@example.com If you need more complex parameters to ssh, you can use e.g.: dsync -u username mirror ssh -i id_dsa.dovecot mailuser@example.com dsync -u username CONVERTING Assuming that the mail_location setting in /etc/dovecot/conf.d/10-mail.conf is set to: mail_location = mdbox:~/mdbox, a logged in system user may convert her/his mails from its Maildir in her/his home directory to the mdbox mailbox format. The user has to execute the com- mand: dsync mirror maildir:~/Maildir If you want to do this without any downtime, you can do the conversion one user at a time. Initially: o Configuration uses mail_location = maildir:~/Maildir o Set up the possibility of doing per-user mail location using userdb extra fields. Then for each user: 1. Run dsync mirror once to do the initial conversion. 2. Run dsync mirror again, because the initial conversion could have taken a while and new changes could have occurred during it. This second time only applies changes, so it should be fast. 3. Update mail extra field in userdb to mdbox:~/mdbox. If you're using auth cache, you need to flush it. 4. Wait for a few seconds and then kill the user's all existing imap and pop3 sessions (that are still using maildir). 5. Run dsync mirror once more to apply final changes that were possibly done. After this there should be no changes to Maildir, because the user's mail location has been changed and all existing processes using it have been killed. Once all users have been converted, you can set the default mail_location to mdbox and remove the per-user mail locations from userdb. REPORTING BUGS
Report bugs, including doveconf -n output, to the Dovecot Mailing List <dovecot@dovecot.org>. Information about reporting bugs is avail- able at: http://dovecot.org/bugreport.html SEE ALSO
doveadm(1), doveadm-kick(1), doveconf(1), dovecot(1) Additional resources: dsync design http://wiki2.dovecot.org/Design/Dsync Dovecot v2.2 2011-01-16 DSYNC(1)
All times are GMT -4. The time now is 04:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy