aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-02-26 23:39:29 +0100
committerMichael <icarus@dabo.de>2012-02-26 23:39:29 +0100
commitfe3dfbee5638dd2988bd8b126652b3138572f02c (patch)
treed22540e6b2534321c1ba38385608a9729179ac33 /include/poller.php
parent437e18d7a7433ea5a9e3388c39ba32c7fe25eb18 (diff)
downloadvolse-hubzilla-fe3dfbee5638dd2988bd8b126652b3138572f02c.tar.gz
volse-hubzilla-fe3dfbee5638dd2988bd8b126652b3138572f02c.tar.bz2
volse-hubzilla-fe3dfbee5638dd2988bd8b126652b3138572f02c.zip
Mail: New options for actions after importing mails.
Diffstat (limited to 'include/poller.php')
-rwxr-xr-xinclude/poller.php46
1 files changed, 36 insertions, 10 deletions
diff --git a/include/poller.php b/include/poller.php
index d79079fcd..cfbc46b87 100755
--- a/include/poller.php
+++ b/include/poller.php
@@ -454,11 +454,24 @@ function poller_run($argv, $argc){
intval($r[0]['id'])
);
}
- //logger("Mail: Deleting ".$msg_uid);
- //imap_delete($mbox, $msg_uid, FT_UID);
- imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
- logger("Mail: Moving ".$msg_uid);
- imap_mail_move($mbox, $msg_uid, "Archiv", FT_UID);
+ switch ($mailconf[0]['action']) {
+ case 0:
+ break;
+ case 1:
+ logger("Mail: Deleting ".$msg_uid);
+ imap_delete($mbox, $msg_uid, FT_UID);
+ break;
+ case 2:
+ logger("Mail: Mark as seen ".$msg_uid);
+ imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
+ break;
+ case 3:
+ logger("Mail: Moving ".$msg_uid." to ".$mailconf[0]['movetofolder']);
+ imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
+ if ($mailconf[0]['movetofolder'] != "")
+ imap_mail_move($mbox, $msg_uid, $mailconf[0]['movetofolder'], FT_UID);
+ break;
+ }
continue;
}
@@ -520,11 +533,24 @@ function poller_run($argv, $argc){
q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d LIMIT 1",
intval($stored_item)
);
- //logger("Mail: Deleting ".$msg_uid);
- //imap_delete($mbox, $msg_uid, FT_UID);
- imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
- logger("Mail: Moving ".$msg_uid);
- imap_mail_move($mbox, $msg_uid, "Archiv", FT_UID);
+ switch ($mailconf[0]['action']) {
+ case 0:
+ break;
+ case 1:
+ logger("Mail: Deleting ".$msg_uid);
+ imap_delete($mbox, $msg_uid, FT_UID);
+ break;
+ case 2:
+ logger("Mail: Mark as seen ".$msg_uid);
+ imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
+ break;
+ case 3:
+ logger("Mail: Moving ".$msg_uid." to ".$mailconf[0]['movetofolder']);
+ imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
+ if ($mailconf[0]['movetofolder'] != "")
+ imap_mail_move($mbox, $msg_uid, $mailconf[0]['movetofolder'], FT_UID);
+ break;
+ }
}
}