Author Topic: Where did External mail recieve go?  (Read 3587 times)

bertalanimre

  • Zen Monk
  • **
  • Posts: 87
  • Karma: +3/-0
    • View Profile
Re: Where did External mail recieve go?
« Reply #15 on: July 21, 2014, 02:48:42 pm »
I have to keep the original mails since the server I'm using is still only in test phase. If I download all the mails and the server needs to be reinstalled that wouldn't be a good thing. :) Plus the mailboxes are important like sh*t.... :) I'll let you know if it works.

Torsten73

  • Zen Warrior
  • ***
  • Posts: 174
  • Karma: +6/-1
    • View Profile
Re: Where did External mail recieve go?
« Reply #16 on: July 21, 2014, 02:49:08 pm »
Getting there. :)

It does fetch all email and keeps them on the source server as well. Magnificant, thank you. Now, ther is still one problem. :D It keeps fetching it non-stop and now in my test account I have 2 messages but each 20 times ( before I stopped fetchmail ). I don't know if there is any way of forcing the fetchmail to compare the mails and see if it already exists. If there is not, then I'll try to solfe it like this:

1stly on Friday I'll reset all users password so I can add them all to the fetchmailrc and start fetchmail so by Monday morning it will finnish with all users .( thinking about it, it is not a good idea because if it finnishes in 10 hours, then all users will have all their emails but 4 times.... ) damn, need to rethink again....

*Bert is brainstorming.........

this also happens in zentyal 3.4 when you activate fetch already read messages. switch it of and choose only don´t delete option and it works. But you will not get older messages. It seems to be not only a problem of zentyal as i though before you post the same with manual fetchmail setting.
Maybe it helps.
--------------------------------------------------------------
Zentyal 3.5 (offline) unter Ubuntu12.04.3 YAVDR 0.5 als KVM Host
Action Pack Abo with a running Exc. 2013 :-)

StuartNaylor

  • Guest
Re: Where did External mail recieve go?
« Reply #17 on: July 21, 2014, 03:08:11 pm »
Fetchmail is really good as a normal external email retriever for your users.

If you are doing migrations then imapcopy for imap is an excellent migration tool.

apt-get install imapcopy  /usr/share/doc/imapcopy/examples

Also I found a really freaky feature out today which I am not sure how I feel about it.

https://forum.zentyal.org/index.php/topic,22655.msg87142.html#msg87142

ldbsearch -H /var/lib/samba/private/sam.ldb '(&(objectclass=person)(name=Administrator))' name unicodePwd

# record 1
dn: CN=Administrator,CN=Users,DC=office,DC=zentyal,DC=lan
name: Administrator
unicodePwd:: kXh1DQFudwnw+lnHhubyUw==

Give this site a go and tell me your success rate.

http://www.hashkiller.co.uk/ntlm-decrypter.aspx paste kXh1DQFudwnw+lnHhubyUw== and my test server password is zent1

You might not need to reset there passwords, you might understand why I have questions about this.
« Last Edit: July 21, 2014, 03:11:18 pm by StuartNaylor »

bertalanimre

  • Zen Monk
  • **
  • Posts: 87
  • Karma: +3/-0
    • View Profile
Re: Where did External mail recieve go?
« Reply #18 on: July 21, 2014, 03:29:42 pm »
that hashkiller is the best way to add words to attacker programs that try a number of words to enter a website, equipemtn or anything.... Don't use it. :)

I'm watching ipamcopy right now. I hope it will work. If it does, you have saved my life ( and probably my job as well ). :)

bertalanimre

  • Zen Monk
  • **
  • Posts: 87
  • Karma: +3/-0
    • View Profile
Re: Where did External mail recieve go?
« Reply #19 on: July 21, 2014, 04:07:23 pm »
It WORKS! ImapCopy + Fetchmail with IMAP is just what I needed. I'll start the 1st phase of the tests and if it works still then I'll publish the methods here step-by-step guys. :)

bertalanimre

  • Zen Monk
  • **
  • Posts: 87
  • Karma: +3/-0
    • View Profile
Re: Where did External mail recieve go?
« Reply #20 on: July 28, 2014, 03:46:58 pm »
Sorry for being very inactive but had some jobs to do. But here is the Step-by-step Guide how to migrate mails from an external mail server without any mail loss and using fetchmail:

1st thing is to download ImapCopy
Code: [Select]
sudo apt-get install imapcopy
2; Configure the imapcopy.cfg file wich is supposed to be in the folder where imapcopy is. ( normally your home folder )
Code: [Select]
mcedit imapcopy.cfg
3; What you need to edit is sourceserver, destination server, ports, usernames and password. You can find them in the basic config file
Code: [Select]
SourceServer hostname.sourceserver.com
SourcePort 143

DestServer hostname.destinationserver.com
DestPort 143

..
..
..

Copy "user1@sourceserver.com" "password" "user1@destserver.com" "password"
Copy "user2@sourceserver.com" "password" "user2@destserver.com" "password"

Normallí this will copy all the files/folders and labels as well.

4; Run ImapCopy
Code: [Select]
imapcopy
5; Take a break. We just copied all the messages to our local mailbox  ;)
Code: [Select]
sudo getadrink
6; Now we will set up fetchmail. I'll show how to start fetchmail manually because new users should use this instead of the daemon and apply these settings to the daemon only if it works 100%. Create a config file for the fetchmail
Code: [Select]
mcedit .fetchmailrc
7; Add the user, server, protocol and the rest wich will let fetchmail know that we want to keep the mail in our source mailbox
Code: [Select]
set syslog;
set postmaster "postmaster@destserver.com";
set daemon 60;
set logfile /home/user/fetchmail.log;

defaults
     smtpaddress "sysadmin@destserver.com"

poll sourceserver.com protocol imap:
     username "user1@sourceserver.com" is "user1@destserver.com"
     password "password";

poll sourceserver.com protocol imap:
     username "user2@sourceserver.com" is "user2@destserver.com"
     password "password";

keep

What could need some explanation:
set daemon 60; = Check incoming mails in every 60 seconds
keep = Keep the mail in the source server


8; Create the logfile since fetchmail can't create it on it's own. What a bastard  :)
Code: [Select]
mcedit fetchmail.log
Then save it.

9; Start Fetchmail
Code: [Select]
fetchmail
10; If you want, you can check the log file for any errors. With these settings it is working for me like a charm. It keeps all mails on the server and copies all unread messages the my local mail server. Perfect for testing.

In case if you need any help, do not hesitate to ask. :)

Torsten73

  • Zen Warrior
  • ***
  • Posts: 174
  • Karma: +6/-1
    • View Profile
Re: Where did External mail recieve go?
« Reply #21 on: July 28, 2014, 09:39:53 pm »
I am not sure if zentyal did a mistake, but external mail can be activated again and in users you can configure it. But editing is not possible due to a missing user corner...

Still waiting for a stuff/dev statement.
--------------------------------------------------------------
Zentyal 3.5 (offline) unter Ubuntu12.04.3 YAVDR 0.5 als KVM Host
Action Pack Abo with a running Exc. 2013 :-)

bertalanimre

  • Zen Monk
  • **
  • Posts: 87
  • Karma: +3/-0
    • View Profile
Re: Where did External mail recieve go?
« Reply #22 on: July 29, 2014, 08:14:26 am »
Yes, a developer reply would be nice to have.
« Last Edit: July 29, 2014, 08:38:08 am by bertalanimre »

AbsyntH

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
Re: Where did External mail recieve go?
« Reply #23 on: July 29, 2014, 10:02:01 am »
it's back on "Core version    3.5.2"

"Retrieve mail for external accounts
This allow users to retrieve mail for external accounts, the mail would be delivered to their local account. External account can be configured in the user's corner. " 

just flag the checkbox in you mail page and configure it per user ;)

(but it seems that does not begin to download your email, i don't see them in my SOGo/openchange webpage)
« Last Edit: July 29, 2014, 10:10:08 am by AbsyntH »

StuartNaylor

  • Guest
Re: Where did External mail recieve go?
« Reply #24 on: July 29, 2014, 10:53:59 am »
Code: [Select]
Jul 29 09:49:26 zent1 fetchmail[14264]: starting fetchmail 6.3.26 daemon
Jul 29 09:49:27 zent1 fetchmail[14264]: 7 messages for stuartiannaylor@inbox.com at my.inbox.com (125967 octets).
Jul 29 09:49:28 zent1 postfix/smtpd[14265]: connect from localhost.localdomain[127.0.0.1]
Jul 29 09:49:28 zent1 postfix/smtpd[14265]: 7E07A22D2F: client=localhost.localdomain[127.0.0.1]
Jul 29 09:49:28 zent1 postfix/cleanup[14271]: 7E07A22D2F: message-id=<30004590.20140715210838.53c598564d22a5.60150238@mail132.atl41.mandrillapp.com>
Jul 29 09:49:28 zent1 fetchmail[14264]: reading message stuartiannaylor@inbox.com@my.inbox.com:1 of 7 (14935 octets) flushed
Jul 29 09:49:28 zent1 postfix/qmgr[13914]: 7E07A22D2F: from=<bounce-md_30004590.53c59856.v1-a2f3bd1cb5eb417fb9ad6952b34bb10e@mandrillapp.com>, size=16902, nrcpt=1 (queue active)
Jul 29 09:49:28 zent1 dovecot: lda(peterpugh@zentyal.lan): msgid=<30004590.20140715210838.53c598564d22a5.60150238@mail132.atl41.mandrillapp.com>: saved mail to INBOX
Jul 29 09:49:28 zent1 postfix/pipe[14272]: 7E07A22D2F: to=<peterpugh@zentyal.lan>, relay=dovecot, delay=0.16, delays=0.1/0.02/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)

Jul 29 09:49:33 zent1 postfix/qmgr[13914]: 52C6C22D2F: removed
Jul 29 09:49:33 zent1 postfix/smtpd[14265]: disconnect from localhost.localdomain[127.0.0.1]
Jul 29 09:50:01 zent1 cron[2001]: (*system*ebox-mail) RELOAD (/etc/cron.d/ebox-mail)

bertalanimre

  • Zen Monk
  • **
  • Posts: 87
  • Karma: +3/-0
    • View Profile
Re: Where did External mail recieve go?
« Reply #25 on: July 29, 2014, 10:56:59 am »
Yes, noticed it.... However I'm NOT going to use it now since I worked 2 weeks with this. :D And as far as I can recall it does not keep the downloaded messages on the source server. That is still a mistake. Oh, and where is the user corner? How can a user change his password ( only mail server, no AD to lok in to )

StuartNaylor

  • Guest
Re: Where did External mail recieve go?
« Reply #26 on: July 29, 2014, 11:17:23 am »
Mine stay on the server but there are tick boxes to set. (mine are unticked so should say)

One thing is and I thought about this afterwards is the problem of storing passwords in ldap as they can't be hashes.

If you use it your passwords will be bare on ldap. lol

Hidden Attributes

All operational attributes are hidden, but not all hidden attributes are operational. These attributes are not particularly well hidden, they just don’t show up in * search. You need to specify the name to get them.
Operation attributes are generated, not static. The data that they hold is generated from other attributes or from system information. They are read-only.
There are some non-operational, but hidden attributes which may be read-only, read-write or there are even some that are write-only (for example, changing password).
The database schema information contains an attribute called “SystemFlags”, which allows multiple values. If one of the values within this field is ‘FLAG_ATTR_IS_OPERATIONAL’ then this is a hidden or operational attribute.
Some hidden attributes are:
   replPropertyMetaData
   nTSecurityDescriptor
   msDS-BridgeHeadServersUsed
   msDS-Entry-Time-To-Die
   msDS-USNLastSyncSuccess

https://wiki.samba.org/index.php/Samba4/LDBIntro#Hidden_Attributes

Or its permissions
« Last Edit: July 29, 2014, 11:32:13 am by StuartNaylor »

bertalanimre

  • Zen Monk
  • **
  • Posts: 87
  • Karma: +3/-0
    • View Profile
Re: Where did External mail recieve go?
« Reply #27 on: July 29, 2014, 11:32:09 am »
How does Hidden Attributes comes into this topic? :)

StuartNaylor

  • Guest
Re: Where did External mail recieve go?
« Reply #28 on: July 29, 2014, 11:34:19 am »
The whole ldap is on port 390.

So maybe the idea of putting fetchmail accounts in ldap isn't that good an idea?

Maybe should be hidden or done via permissions

StuartNaylor

  • Guest
Re: Where did External mail recieve go?
« Reply #29 on: July 30, 2014, 05:08:35 am »
I guess samba-tool dsacl set [options]

http://technet.microsoft.com/en-us/library/cc771151.aspx