Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic Aurora

 AfterLogic Forum : AfterLogic Aurora
Subject Topic: POP3 fetcher Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
robertocanazza
Newbie
Newbie


Joined: 09 May 2014
Online Status: Offline
Posts: 7
Posted: 22 May 2014 at 11:50pm | IP Logged Quote robertocanazza

I have installed rpm version into a new and clean CentOS 6.5.
All work fine but with pop3 don't fetch mail.
Loocking into the log file is all ok, it autenticate and access to pop3, indicate also the number of mail present, but don't download them.
Have you any suggestions?
thx
Back to Top View robertocanazza's Profile Search for other posts by robertocanazza
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6086
Posted: 23 May 2014 at 2:30am | IP Logged Quote Igor

POP3 fetcher relies on crontab entry firing every 10 minutes, and it looks like that crontab entry isn't set by default, we'll fix it in next update.

To have POP3 fetcher functional, the following entry must be added to "crontab -e":

Code:
*/10 * * * * /bin/bash /opt/afterlogic/scripts/mailfetch.sh


Hope this helps!

--
Regards,
Igor, AfterLogic Support

Back to Top View Igor's Profile Search for other posts by Igor
 
robertocanazza
Newbie
Newbie


Joined: 09 May 2014
Online Status: Offline
Posts: 7
Posted: 23 May 2014 at 9:59am | IP Logged Quote robertocanazza


Ok, tested and work fine!
...but... all the message has the time and date when fetch...
there's a way to mantain date and time of the message?
thx
Back to Top View robertocanazza's Profile Search for other posts by robertocanazza
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 26 May 2014 at 3:09am | IP Logged Quote Alex

It's a known limitation of the fetcher. Perhaps, we'll find another fetcher implementation in the future but can't guarantee that.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
robertocanazza
Newbie
Newbie


Joined: 09 May 2014
Online Status: Offline
Posts: 7
Posted: 27 May 2014 at 12:03am | IP Logged Quote robertocanazza

I have saved a fetched email and opened with Outlook, inside the message there is the original date of the mail.
There's no way to use that date in the list of fetched mail?

thx
Back to Top View robertocanazza's Profile Search for other posts by robertocanazza
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 27 May 2014 at 2:33am | IP Logged Quote Alex

It could lead to unpredictable results. In IMAP, an email message can have different dates assigned to it. Outlook shows the date which we cannot use as it may show incorrect results in other cases. We already tried that in the past and had to revert to the original behavior due to side effects, such as different dates in message list and when viewing the message itself.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 28 May 2014 at 4:17am | IP Logged Quote Alex

Looks like you deleted your last answer which was about adding the option "--received-header=off". Was this because it did not actually help? Anyway, we tried this and it does not help.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
robertocanazza
Newbie
Newbie


Joined: 09 May 2014
Online Status: Offline
Posts: 7
Posted: 28 May 2014 at 11:03am | IP Logged Quote robertocanazza

I don't know WHY, but after the change I've fetched more of 200 mail with perfect date/time.

To be sure in the "night" I've applied a restore point of the virtual machine and remake the change... but it wasn't as the first time... so...



Back to Top View robertocanazza's Profile Search for other posts by robertocanazza
 
robertocanazza
Newbie
Newbie


Joined: 09 May 2014
Online Status: Offline
Posts: 7
Posted: 28 May 2014 at 5:39pm | IP Logged Quote robertocanazza

Surfing the web I've found this script:

Code:

#!/bin/bash
#
# Date : July 4th, 2005
# Author: Benson Wong
# tummytech@gmail.com
#
# This shell script corrects email messages where the file system
# date does not match the Date: header in the email.
#
# This will fix problems with mail clients like Apple's mail.app
# which uses the file system timestamp resulting in emails with the
# wrong file system timestamp to display the wrong received date
#
# This script has to be run by a user [root] with the
# necessary privileges to read/modify files in a user's Maildir.
#

function usage() {
  if [ "$1" != "" ]; then
    echo "$1"
  fi
  echo "Usage: $0 /path/to/user/Maildir"
  exit 1
}

function email_date() {
  local DATELINE=`grep -e "^Date: " "$1" | head -1`
  local DELIVERYDATELINE=`grep -e "^Delivery-date: " "$1" | head -1`
  if [ -n "$DELIVERYDATELINE" ]; then
    local DATELINE="${DELIVERYDATELINE/elivery-d/}"
  fi

  # f**ked up date like Mon, 03 Nov 03 11:37:04 Romance Standard Time
  local regex='^Date: ([A-Za-z]{3}, [0-9]{2} [A-Za-z]{3} [0-9]{2,4} [0-9]{1,2}:[0-9]{2}:[0-9]{2}) ([A-Za-z ]*)$'
  if [[ $DATELINE =~ $regex ]]; then
    EDATE=`date -d "${BASH_REMATCH[1]}" "+%Y%m%d%H%M"`
    return 0
  fi

  # Missing "+" before timezone
  local regex='^Date: ([A-Za-z]*, [0-9]* [A-Za-z]* [0-9]{4} [0-9]{1,2}:[0-9]{2}:[0-9]{2}) ([0-9]{4})$'
  if [[ $DATELINE =~ $regex ]]; then
    EDATE=`date -d "${BASH_REMATCH[1]} +${BASH_REMATCH[2]}" "+%Y%m%d%H%M"`
    return 0
  fi

  # Remove day of the week
  local regex='^Date: ([A-Za-z]*,) (.*)$'
  if [[ $DATELINE =~ $regex ]]; then
    EDATE=`date -d "${BASH_REMATCH[2]}" "+%Y%m%d%H%M"`
    return 0
  fi

  local regex='^Date: (.*)$'
  if [[ $DATELINE =~ $regex ]]; then
    EDATE=`date -d "${BASH_REMATCH[1]}" "+%Y%m%d%H%M"`
    return 0
  fi
}

MDIR_PATH="$1"

[ $# -lt 1 ] && usage
[ ! -d "$MDIR_PATH" ] && usage "Error: $MDIR_PATH does not exist"
[ ! -r "$MDIR_PATH" ] && usage "Error: $MDIR_PATH is not readable"
[ ! -w "$MDIR_PATH" ] && usage "Error: $MDIR_PATH is not writable"

# set the internal field separator to the newline character
# instead of the default "".
# This is required for handling filenames and directories with spaces
IFS="
"
set -f
echo "start"
# Find all emails
for i in `find $MDIR_PATH -type f | egrep -v "(courierimap|maildirsize|maildirfolder)"`; do
  email_date "$i"
  if [ -z "$EDATE" ]; then
    echo ""
    echo "Unparsable date for" `basename $i`
    continue
  fi
  FDATE=`ls -l --time-style=long-iso "$i" | awk '{print $6,$7}'`
  # Reformat the date for touch.
  ODATE=`date -d "$FDATE" "+%Y%m%d%H%M"`
  if [ "$EDATE" -eq "$ODATE" ]; then
    # Skip it if the times are correct.
    echo -n "."
    continue
  fi
  echo ""
  echo `basename $i` "from $ODATE to $EDATE"
  touch -c -t "$EDATE" "$i"
done

echo ""
echo "done"


After fetched mail (with ALL the same date), applied this script and deleted the "dovecot.index.cache", refreshing the page the date is correct.

I'm not a programmer but if one has the ability to correct the script "mailfetch.sh" and integrate it with the part of this script that fix the date/time issue, will be a great goal!!

thx
Back to Top View robertocanazza's Profile Search for other posts by robertocanazza
 
robertocanazza
Newbie
Newbie


Joined: 09 May 2014
Online Status: Offline
Posts: 7
Posted: 29 May 2014 at 1:23am | IP Logged Quote robertocanazza

OK
...tested again and the script correct the date!!!

But is too easy to stop here

The dates are now correct, is sorted by dates but by time is in random mode...

How to sort by date / time?

thx
Back to Top View robertocanazza's Profile Search for other posts by robertocanazza
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 29 May 2014 at 3:36am | IP Logged Quote Alex

Quote:
The dates are now correct, is sorted by dates but by time is in random mode...

Yes, that's another one of "unpredictable results". We had too many issues with IMAP dates in fetcher and therefore left it as-is for a while.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide