Re: [Dovecot] problem about pop3 using dovecot

2012-09-08 Thread bmalik
But i use Maildir ?

is there a solution ? 

Meanwhile, after dovecot to 2.1.8, when i login to the new pop3 server,  i
got duplicate mails which i have kept for some days on the server.
how can i prevent this problem?  




--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/problem-about-pop3-using-dovecot-tp37394p37479.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] problem about pop3 using dovecot

2012-09-08 Thread bmalik


i only upgraded dovecot from 1.x to 2.1.x.
i didn't change any settings over server. after dovecot service restart, my
keep mails on the server, i got  again to the outlook. that's my test server
but i am going to migrate soon. but i don't want to get duplicate mails.
How can i prevent ?
Thanks



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/problem-about-pop3-using-dovecot-tp37394p37484.html
Sent from the Dovecot mailing list archive at Nabble.com.


[Dovecot] problem about pop3 using dovecot

2012-09-04 Thread bmalik
I upgraded dovecot from 1.1 to 2.1.8

pop3/imap works but i have a problem.

i use pop3 protocol on outlook 2010 for my account. and i set keep my mails
on the server for 5 days or until i delete them.
These settings were working old dovecot1.1. But when i upgraded it to 2.1.8.
if i even delete a mail from outlook the server doesn't delete or old mails
are not deleted.

what can be the problem ? 

thanks  



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/problem-about-pop3-using-dovecot-tp37394.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-09-03 Thread bmalik
i am sorry 

when i login to the server using pop3s,   i see in the dovecot log;

@400050457dd9179c653c pop3-login: Info: Login: user=t...@byserver.net,
method=DIGEST-MD5, rip=192.168.12.220, lip=192.168.12.115, mpid=87395, TLS,
session=w8H1WtjISwDV7pbc 

if i add my mail address into the users-with-forced-encryption file, i would
not reach my account.

i get an error;
@400050457dd9183f542c pop3(t...@byserver.net): Info: Post-login script
denied access to user t...@byserver.net
whereas i connect to the account via pop3s 
if i remove my mail address from the users-with-forced-encryption
there is no problem.

my postlogin_pop3.sh;
#!/usr/local/bin/bash
if [ $SECURED == secure ]
then
  :# handle secure connections here
else
  :# handle insecure connections here
  if grep -q $USER in /usr/local/etc/dovecot/users-with-forced-encryption
  then
printf * NO [ALERT] You are not allowed to connect without
encryption\r\n
exit 0
  fi
fi
exec $@
###
there is also no problem related to SSL certificate 
what can be the issue ? 






--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37388.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-15 Thread bmalik
Thanks a lot. the script you gave works . 



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37080.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-14 Thread bmalik
My purpose is to restrict a particular email address 's reach for dovecot
services such as pop3/imap.

how can i restrict a particular email address by tcp port ? 
I want a particular mail address to be forced to use pop3s/imaps. 
I use vpopmail / dovecot2.
How can i do a script for that ?

cat auth-vpopmail.conf.ext 
passdb {
  driver = vpopmail
  args = webmail=127.0.0.1
}
userdb {  
  driver = vpopmail   
  args = quota_template=quota_rule=*:backend=%q 
}



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37062.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-14 Thread bmalik
But I 'll do that for only some email addresses. 
How can i do that ? 
 



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37064.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-14 Thread bmalik
is there a solution ?  



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37074.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-13 Thread bmalik
hello

how can i do a login script by tcp port ? 

I use cdb database 

my dovecot.conf -n;
# doveconf -n 
# 2.1.8: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.2-RELEASE amd64  
auth_mechanisms = plain login digest-md5 cram-md5 apop
disable_plaintext_auth = no
first_valid_gid = 89
first_valid_uid = 89
last_valid_gid = 89
last_valid_uid = 89
login_greeting = Dovecot ready2.
mail_gid = 89
mail_plugin_dir = /usr/lib/dovecot
mail_uid = 89
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox Sent Messages {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix = 
}
passdb {
  args = webmail=127.0.0.1
  driver = vpopmail
}
protocols = imap pop3
service pop3-postlogin {
  executable = script-login /usr/local/bin/postlogin_pop3.sh
  user = root
}
service pop3 {
  executable = pop3 pop3-postlogin
}
ssl = no
userdb {
  args = quota_template=quota_rule=*:backend=%q
  driver = vpopmail
}
protocol imap {
  mail_max_userip_connections = 20
}
protocol pop3 {
  mail_max_userip_connections = 20
}



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37047.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-13 Thread bmalik
Ok

where do i have to locate the passwd-file in dovecot2

i use vpopmail and dovecot2.





--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37050.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-12 Thread bmalik
Thank you 
I wrote a loginscript in bash. it works well. I can restrict a user by IP.
Well , how can i restrict a particular email address by tcp port ?
I want a particular mail address to be forced to use pop3s/imaps.
I use vpopmail / dovecot2





--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37043.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-11 Thread bmalik
is there another post-login script that i can use on freebsd ?



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p37034.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-10 Thread bmalik
i can manage read -d problem changing -p

what should be user rights of the postlogin_pop3.sh ?
i use vpopmail




the pop3script;

#!/bin/sh
#  30-jul-2007
#
# Author:
#  Oliver Schulze L.
#  Contact: http://tinymailto.com/oliver
#  Paraguay

INTRANET_NETS=127.0.0.1 10.
 
# users that can login from the Internet
INTERNET_USERS=user1 user2 user3 user4 t...@test.com
 
DEBUG=0
 
 
 
# variables setup by dovecot: IP USER
 
# configure the dovecot binary to run based on the name of the script, so
# this script can be used for imap and pop3 just by making a link
SCRIPT_BASE=postlogin
DOVECOT_EXEC=
if [ $(basename $0) = ${SCRIPT_BASE}_imap.sh ] ; then
DOVECOT_EXEC=/usr/local/libexec/dovecot/imap
elif [ $(basename $0) = ${SCRIPT_BASE}_pop3.sh ] ; then
DOVECOT_EXEC=/usr/local/libexec/dovecot/pop3
else
MSG=Please edit the file $(basename $0) and change the SCRIPT_BASE
variable
/usr/bin/logger $MSG
# display a message to the user
echo * OK [ALERT] $MSG
# cancel the current imap request
echo * NO $MSG
exit 1
fi
 
# debug
if [ $DEBUG -eq 1 ] ; then
# TEST data
DEBUG=1
 
# intranet test, any user can login
#IP=192.168.1.23
#USER=user222
 
# internet test, only user user2 can login
#IP=200.85.32.2
#USER=user2
fi
 
 
if [ -z $IP ] ; then
echo $(basename $0): IP variable is empty
exit 2
fi
if [ -z $USER ] ; then
echo $(basename $0): USER variable is empty
exit 3
fi
 
# FLAGS
IN_INTRANET=0
INTERNET_ALLOWED=0
DOVECOT_ALLOW=0
 
# Create this file in a RAM based directory in order to gain performance
FILE_TMP=$(mktemp /tmp/login-intranet-dovecot.tmp.XX)
 
#
--
# check if the IP is from the Intranet
 
# always use a tmp file in while in order to modify this script variables
echo $INTRANET_NETS   $FILE_TMP
 
# cicle all intranets
while read -p ' ' net_intranet ; do
net_grep=$(echo $net_intranet | sed -e 's/\./\\\./g')
echo $IP | grep $net_grep 2/dev/null 1/dev/null
RES=$?
 
if [ $DEBUG -eq 1 ] ; then
echo   net_intranet: $net_intranet - RES: $RES
fi
 
if [ $RES -eq 0 ] ; then
# the IP is from the intranet, stop processing and allow
login
IN_INTRANET=1
break
fi
done  $FILE_TMP
 
 
#
--
# if the user is connecting from outside the intranet, check if it is
allowed
# to do so
if [ $IN_INTRANET -eq 0 ] ; then
# always use a tmp file in while
echo $INTERNET_USERS   $FILE_TMP
 
# cicle all allowed internet users
while read -p ' ' user_inet ; do
if [ $DEBUG -eq 1 ] ; then
echo   $USER == $user_inet
fi
 
if [ $USER = $user_inet ] ; then
# the user is conecting from the Internet and is
allowed, stop
# processing and allow login
INTERNET_ALLOWED=1
break
fi
done  $FILE_TMP
 
fi
 
if [ $DEBUG -eq 1 ] ; then
echo IN_INTRANET : $IN_INTRANET
echo INTERNET_ALLOWED: $INTERNET_ALLOWED
fi
 
# delete temp file
rm -f $FILE_TMP
 
if [ $IN_INTRANET -eq 1 ] ; then
# the user is conecting from the intranet
DOVECOT_ALLOW=1
elif [ $IN_INTRANET -eq 0 ]  [ $INTERNET_ALLOWED -eq 1 ] ; then
# the user is conecting from the internet and is an allowed internet
user
DOVECOT_ALLOW=1
fi
 
# check if the user can login
if [ $DOVECOT_ALLOW -eq 1 ] ; then
# the user can login, run the imap or pop3 server
if [ $DEBUG -eq 1 ] ; then
echo exec $DOVECOT_EXEC
else
# this script ends here
exec $DOVECOT_EXEC
fi
else
# user is not allowed to login, inform the user and system log
 
#MSG=El usuario '$USER' no puede conectarse desde Internet
MSG=User '$USER' not allowed to connect from the Internet [$IP]
/usr/bin/logger $(basename $0): $MSG
# display a message to the user
echo * OK [ALERT] $MSG
# cancel the current imap request
echo * NO $MSG
exit 10
fi

exec $@



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p7786.html
Sent from the Dovecot mailing list archive at Nabble.com.


Re: [Dovecot] about postlogin in dovecot2

2012-08-10 Thread bmalik
I started to use bash in the script and changed read -d instead of -p.
Also I get the script 's rights root:dovecot

I get an error;

-ERR pop3 binary must not be started from inetd, use pop3-login instead.
Connection closed by foreign host.
Aug 11 04:30:05 pop3y dovecot: pop3(t...@test.com): Post-login script denied
access to user t...@test.com
Aug 11 04:30:05 pop3y dovecot: pop3-postlogin: Fatal: master:
service(pop3-postlogin): child 15837 returned error 1 



--
View this message in context: 
http://dovecot.2317879.n4.nabble.com/about-postlogin-in-dovecot2-tp5993p25969.html
Sent from the Dovecot mailing list archive at Nabble.com.