Avast WEBforum

Consumer Products => Avast Free Antivirus / Premium Security (legacy Pro Antivirus, Internet Security, Premier) => Topic started by: wanidoob on February 28, 2005, 08:11:14 PM

Title: Listening POP to 2 ports simultaneously ?
Post by: wanidoob on February 28, 2005, 08:11:14 PM
create 28/02/2005 (19h00)
edit 01/03/2005 (9h00) : reformat my request
edit 02/03/2005 (11h15) : change topic title, to be more pertinent

Hy,

My Mailer is Thunderbird 1.0

My "gmail" account :
Code: [Select]
user_pref("mail.server.serverX.hostname",       "127.0.0.1");
user_pref("mail.server.serverX.port",           995);
user_pref("mail.server.serverX.userName",
"nick@gmail.com#pop.gmail.com");

user_pref("mail.smtpserver.smtpX.hostname", "127.0.0.1");
user_pref("mail.smtpserver.smtpX.port", 587);
user_pref("mail.smtpserver.smtpX.username", "nick@gmail.com#smtp.gmail.com");

My others accounts :
Code: [Select]
user_pref("mail.server.serverX.hostname",       "127.0.0.1");
user_pref("mail.server.serverX.port",           110);
user_pref("mail.server.serverX.userName",
"nick#pop.server.com");

user_pref("mail.smtpserver.smtpX.hostname", "127.0.0.1");
user_pref("mail.smtpserver.smtpX.port", 25);
user_pref("mail.smtpserver.smtpX.username", "nick#smtp.gmail.com");

If I write this in avast4.ini :
Code: [Select]
SmtpListen=127.0.0.1:587
PopListen=127.0.0.1:995
It works fine with my "gmail" account but not with others

And if I changed it to :
Code: [Select]
SmtpListen=127.0.0.1:25
PopListen=127.0.0.1:110
It works with all my accounts except gmail


Avast works (alone and directly) with Thunderbird if I manually edit avast4.ini for pop 995 & 110 connexions but not both simultaneously...

So I don't need Stunnel, but my gmail account must be pop & smtp through the 995 & 587 port and others mail accounts through 110 & 25 ones.

So I just want Avast to listen simultaneously to two different ports
fort a same protocol.

Does work something like this :
Code: [Select]
SmtpListen=127.0.0.1:25,127.0.0.1:587
PopListen=127.0.0.1:110,127.0.0.1:995
Or this :
Code: [Select]
SmtpListen=127.0.0.1:25,587
PopListen=127.0.0.1:110,995

This two examples doesn't seems to work, but I don't know how to use those Avast4.ini lines :
Code: [Select]
DefaultSmtpServer=
DefaultPopServer=
UseDefaultSmtp=
PopRedirectPort=
SmtpRedirectPort=
Title: Re: Listening POP simultaneously to 110 and 995 ports without stunnel ?
Post by: Eddy on February 28, 2005, 09:22:58 PM
Look for a user named Technical. See the links in his signature. He has that explaind in his thread about avast4.ini
Title: Re: Listening POP simultaneously to 110 and 995 ports without stunnel ?
Post by: Lisandro on February 28, 2005, 09:38:35 PM
Look for a user named Technical. See the links in his signature. He has that explaind in his thread about avast4.ini

Here: http://forum.avast.com/index.php?board=2;action=display;threadid=1647
Anyway, I don't think it will help that much...
Title: Re: Listening POP simultaneously to 110 and 995 ports without stunnel ?
Post by: wanidoob on March 01, 2005, 10:06:13 AM
Thanks to have considered my question. I have edited my post to clarify it.

I didn't found this "avast4.ini" topic before, next time I will correctly use my glasses...

But no one message say to me how Avast to listen 2 differents ports (or 2 differents "server:port"), simultaneously...

If it doesn't exist nowaday, it will be a good inovation to do, I think. But if we can, please, tell me how ;o(


I'll continue in this topic (http://forum.avast.com/index.php?topic=1647.msg98491#msg98491)
Title: Re: Listening POP simultaneously to 110 and 995 ports without stunnel ?
Post by: vojtech on March 01, 2005, 11:46:20 AM
The mail scanner will not work with SSL no matter how you change the ports.
Title: Re: Listening POP simultaneously to 110 and 995 ports without stunnel ?
Post by: wanidoob on March 01, 2005, 12:11:33 PM
OK, that's what I was understanding at this time...

But SSL works with ThunderBird alone, with login "nick@gmail" and server "pop.gmail.com" / port "995". But I prefer Avast to scan those emails too...

And I don't find any complete conf files examples to work with Thunderbird + Avast +/- OpenSSL/Stunnel.

I know how to configure Thunderbird, but have I to change the 995 SSL and 587 TSL ports (in my gmail account configuration), can I keep the 110 and 25 ports (for others accounts) ?

I don't know how to configure Avast ? PopListen to 110, to 995, or to another one port (to work simultaneously with my normal and SSL accounts) ?

I don't know how to configure Stunnel (without anti-spam program) ? my tests doesn't work, the files "stunnel.pem" seems to lack, and I haven't any complete example for "stunnel.ini"...

Do I have some things to do for OpenSSL itself ?


very newbie in networking, especially secure networking...
Title: Re: Listening POP simultaneously to 110 and 995 ports without stunnel ?
Post by: Lisandro on March 01, 2005, 08:33:22 PM
The mail scanner will not work with SSL no matter how you change the ports.

Right now I can use Stunnel and GMail with Spamihilator and avast.
But not smtp... I'm trying yet...  :P
Title: Re: Listening POP simultaneously to 110 and 995 ports without stunnel ?
Post by: Lisandro on March 01, 2005, 10:48:55 PM
And I don't find any complete conf files examples to work with Thunderbird + Avast +/- OpenSSL/Stunnel.

For the account: username@gmail.com

The file stunnel.conf into the Stunnel folder must be:


# We're running as a client to SSLify the GMail POP connection
client=yes

# POP3 service, listens on localhost:11110
[gmail-pop3s]
accept=127.0.0.1:11110
connect=pop.gmail.com:995
#or the SSL port of your Secure POP server if you use another service.

# SMTP service, listens on localhost:11125
[gmail-smtps]
accept=127.0.0.1:11125
connect=smtp.gmail.com:465
protocol=smtp
#or the SSL port of your Secure SMTP server if you use another service.


In avast4.ini file:

[MailScanner]
PopListen=127.0.0.1:110
SmtpListen=127.0.0.1:25
ImapListen=127.0.0.1:143
NntpListen=127.0.0.1:119
AutoSetProtection=0
PassThrough=1
Trust=127.0.0.1
AutoRedirect=1
StartSmtp=1
StartPop=1
StartImap=1
StartNntp=1
PopRedirectPort=110,11110
SmtpRedirectPort=25,11125
ImapRedirectPort=143
NntpRedirectPort=119
IgnoreLocalhost=0

Account configuration into your email program:

POP3 server: 127.0.0.1
Account name: 127.0.0.1&username&11110
Port: 120 (if you use Spamihilator), if not, I suppose 110 will work

Of course, you must have Stunnel installed and running as a service and OpenSSL.

Do I have some things to do for OpenSSL itself ?

No. Only install it.

Still testing smtp configuration
Title: Listening simultaneously to SSL pop (gmail) and non SSL pop
Post by: wanidoob on March 02, 2005, 10:35:18 AM
I've tried with your confs, and I thank you to have posted them !

Note for you : my gmail informations indicates the smtp port 587 for thunderbird (http://www.google.com/gmail/help/images/screenshots/thunderbird0x/smtp_settings.gif") (and Entourage 2004, Appel Mail. But 465 for all versions of Outlook, EntourageX... both 587 and 465 might be tested (http://gmail.google.com/support/bin/answer.py?answer=13287") !)

So, with "IgnoreLocalhost=0" no one pop connection does work, but non SSL pop connections are working with "IgnoreLocalhost=1".

But my gmail connection isn't working at all : thunderbird is "connected to 127.0.0.1...", but no pass request niether error message !

My confs (without anti-spam) :
(I use colors to mark where the datas come from - please notify me if I was mistaken or if I missed something)

Thunderbird gmail account :
Quote
login= "nick@gmail.com#127.0.0.1"
server= "127.0.0.1"
port="110"

Avast ini file, all [MailScanner] section :
Quote
[MailScanner]
Log=20
ShowTrayIcon=1
PopListen=127.0.0.1:110
SmtpListen=127.0.0.1:25
ImapListen=127.0.0.1:143
NntpListen=127.0.0.1:119
AutoSetProtection=0
PassThrough=1
Trust=127.0.0.1
AutoRedirect=1
StartSmtp=1
StartPop=1
StartImap=1
StartNntp=1
PopRedirectPort=110,11110
SmtpRedirectPort=25,11025
ImapRedirectPort=143
NntpRedirectPort=119
IgnoreLocalhost=1
IgnoreAddress=

Stunnel conf file :
Quote
# We're running as a client to SSLify the GMail POP connection
client=yes

# POP3 service, listens on localhost:11110
[gmail-pop3s]
accept=127.0.0.1:11110
connect=pop.gmail.com:995
#or the SSL port of your Secure POP server if you use another service.

# SMTP service, listens on localhost:11125
[gmail-smtps]
accept=127.0.0.1:11125
connect=smtp.gmail.com:587
protocol=smtp
#or the SSL port of your Secure SMTP server if you use another service.

That's right that I don't understand exactly the pop connection route, is that exact :
thunderbird send "nick@gmail.com#127.0.0.1" to 127.0.0.1:110
=> avast listen 127.0.0.1:110
=> avast send (PopRedirectPort) "nick@gmail.com" to 127.0.0.1:110 (*) and 127.0.0.1:11110 (**)
=> stunnel accept 127.0.0.1:11110 and connect to pop.gmail.com:995
=> pop.gmail.com authentify the login, and return mails
=> stunnel get and pass mails through avast
=> avast scan it and add X-tags
=> thunderbird get them

(*) but avast is listen to 127.0.0.1:110 : does it check it again ?
(**) does all datas be send twice, once to 127.0.0.1:110 and once to 127.0.0.1:11110 ? so each login/pass is send to pop.gmail.com and to another one pop server... not secure for gmail SSL-data niether for all pass : all connections could be intercept on the unsecure pop connections ?
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: lukor on March 02, 2005, 12:37:11 PM
The port on which mail scanner listens on you localhost is absolutely irrelevant. Make it 43223 if you like, it won't change the functionality of the product, nor would it add missing features (like the understanding to SSL protocol).

Those are ports avast listen's on. What do you think those number mean? They are just arbitrary numbers - of course they must match the configuration in you mail client, but appart from this the have no meaning.

What is your OS? Is it win9x?
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: Lisandro on March 02, 2005, 12:43:47 PM
Nor would it add missing features (like the understanding to SSL protocol).

Lukas, can't the email be downloaded and 'locally' scanned?

I mean something like this:
ISP > Stunnel or Spam application > avast > email program

Or avast can only scan the email 'after' it was handled by the email program?
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: lukor on March 02, 2005, 12:50:29 PM
Yes, that is possible. I though that this is exactly how you have it configured....
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: wanidoob on March 02, 2005, 01:43:24 PM
I know I'm not an engineer network  ::)
I'm a poor lansome newbie  :-\
english newbie + network newbie

so please be patient :-*

What is your OS? Is it win9x?

My O.S. is WinXP

I choose the 110 port to be listen on, because of my others mails (non SSL). I'm french and I don't understand what means "unrelevant" : "not important" (so I can choose what I want - that's I'm thinking) or "not good" (and so, which could be good) ?


I know that avast doesn't support SSL, but I thought stunnel was doing it : stunnel connects directly to pop.gmail.com (in SSL mode + OpenSSL 0.9.7e). So stunnel get emails and passed them (no-SSL mode) to thunderbird through avast

My problem is :

- if stunnel launch as service at win startup, it seems not to work because of no network detection (it says "DNS resolving error" on "pop.gmail.com" and "smtp.gmail.com"), and no session is detected when I try to pop my email with thunderbird

- if I lauch stunnel as service after win startup, it appears as service, but I can't change the "stopped"status (in msconfig, services tab)

+ and If I want avast to scan 'locally', I have to uncheck
IgnoreLocalhost (=0). But in this case, no one mail account (gmail/SSL niether others/no-SSL) reach the pop.server !
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: lukor on March 02, 2005, 10:24:33 PM
Wanidoob,

what I meant is that you don't have to fiddle with the port number avast listens on. Just choose one port and let it there. Having the listening port in avast set to 110 makes things easier if you want your mail client to download mail directly through avast, since 110 is usually the default number and so you need not to change it. There is no need to force avast listen on two ports for whatever reason - as you are suggesting in your original post.

The configuration suggested by Technical seems pretty reasonable to me. It should work with SSL tunnel. I don't know how SSL tunnel works in detail, so I cannot help you with it's configuration right now.

In general you can firstly setup the SSL tunnel and your mail client to work together - and forget about avast for a moment. You will end up with something like Technical offered. That is, you'll have a service running on your localhost, eg. on port 11110, which connects to the gmail pop server via SSL. That is, instead of pop.gmail.com, port 995, you would be connecting to localhost, port 11110, and the connection to gmail will be realized by the SSL tunnel. In order to work, you would have to setup the localhost server in your mail client. Technical's config is further complicated by the presence of SpamFilter, but let's omit this for a moment.

In you mail client you now have localhost as a server and 11110 as a port. If this would work (with SSL tunnel setup correctly) all is fine. Now it's time to add avast scanning to the whole stream. Best place for avast is between your mail client and SSL Tunnel. Avast automatically monitors all connections to port 110, eg. pop.myisp.com:110, but in your case there is no connection to port 110, instead 11110 is being used. So firstly you'll have to add PopRedirectPort=110,11110. Now avast will redirect (monitor) both 110 and 11110 ports. Your connections are directed to localhost:11110, but under standard setup localhost is ignored and not monitored. So secondly you need to add IgnoreLocalhost=0.

Finally, if you have problems starting the SSL Tunnel service, please use Control Panel / Administrative Tools / Services, there you can change the status from stopped to started.

Lukas.



Title: Re: Listening POP to 2 ports simultaneously ?
Post by: wanidoob on March 04, 2005, 06:29:11 PM
thanks a lot lukor...

it works !!

I will say more, but not at this time
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: wanidoob on March 07, 2005, 09:17:59 AM
a little more precisions...

Avast automatically monitors all connections to port 110, eg. pop.myisp.com:110, but in your case there is no connection to port 110, instead 11110 is being used. So firstly you'll have to add PopRedirectPort=110,11110. Now avast will redirect (monitor) both 110 and 11110 ports.

OK, that's fine... I didn't understand what "PopRedirectPort" meant. Now I do. But it isn't so easy to understand that Avast support two scan modes :
- "Listen" which is needing a login as "nick#pop.server.com" (and Avast log itself to "pop.server.com" with the login "nick" / maileur send "nick#pop.server.com" to "127.0.0.1:110")
- "Redirect" which simply catch the stream from normal maileurs configuration (maileur send "nick" directly to "pop.server.com")

Your connections are directed to localhost:11110, but under standard setup localhost is ignored and not monitored. So secondly you need to add IgnoreLocalhost=0.

But for the "Redirect" method I had to uncheck "ignore local communications". And the "Listen" method needs this to be checked.

There is no need to force avast listen on two ports for whatever reason - as you are suggesting in your original post.

But in my mind, Avast do it (what I wanted) finally : it scans more than one ports with the "redirect" method.

And in fact, it could be nice to force Avast to "listen" to 2 (or more) ports : because with the "Redirect" method, if Avast doesn't work (for any reason : not lauched, crashed, blocked...), the maileur does pop emails, but without Avast scan !

And it seems to be impossible to use "Listen" and "Redirect" simultaneously (or am I a stupid boy ?, that's a 50% / 50% :-)

Finally, if you have problems starting the SSL Tunnel service, please use Control Panel / Administrative Tools / Services, there you can change the status from stopped to started.

That was an artefact of my silly mind. When windows start up, stunnel do error like "Error resolving 'pop.gmail.com': Neither nodename nor servname known (EAI_NONAME) / Cannot resolve 'pop.gmail.com:995' - delaying DNS lookup". And when connected, it doesn't show any "OK messages", but it works fine !


If any is interresting in, I can post here my 3 confs files (thunderbird, avast, stunnel)
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: Lisandro on March 07, 2005, 04:51:44 PM
If any is interresting in, I can post here my 3 confs files (thunderbird, avast, stunnel)

I am... Thanks  8)
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: wanidoob on March 09, 2005, 12:40:17 PM
I am... ThanksĀ  8)

So here are my *secret* conf filesĀ  8)

How to use Thunderbird + Stunnel + Avast...
and How to support Gmail and others accounts simultaneously

My Thunderbird normal account :
* POP
- login "nick1@provider1.com"
- server "pop.provider1.com"
- port "110"
- security protocol : none ("secure connection (SSL)" unchecked and "secure authenticate" unchecked)
* SMTP
- login "nick1@provider1.com" (if necessary, ie if "use with login and password" checked)
- server "smtp.provider1.com"
- port "25"
- security protocol : none ("secure connection (SSL)" unchecked and "secure authenticate" unchecked)

Code: [Select]
user_pref("mail.account.account1.identities", "id1");
user_pref("mail.account.account1.server", "server1");

user_pref("mail.identity.id1.fullName", "My Nick1");
user_pref("mail.identity.id1.identityName", "Nick1");
user_pref("mail.identity.id1.smtpServer", "smtp1");
user_pref("mail.identity.id1.useremail", "nick1@provider1.com");

user_pref("mail.server.server1.hostname", "pop.provider1.com");
user_pref("mail.server.server1.name", "My Nick1 account (normal)");
user_pref("mail.server.server1.port", 110);
user_pref("mail.server.server1.type", "pop3");
user_pref("mail.server.server1.userName", "nick1@provider1.com");

// user_pref("mail.server.server1.useSecAuth", 0);
// I don't know if this line with another value than 0 or false is supported through Avast (??). I think it is, but I did not test.

user_pref("mail.smtpserver.smtp1.hostname", "smtp.provider1.com");
user_pref("mail.smtpserver.smtp1.port", 25);
user_pref("mail.smtpserver.smtp1.try_ssl", 0);

user_pref("mail.smtpserver.smtp1.username", "nick1@provider1.com");
// this last line could be unnecessary, according to provider1


My Thunderbird gmail account :
* POP
- login "nick2@gmail.com"
- server "127.0.0.1"
- port "11110"
- security protocol : none ("secure connection (SSL)" unchecked and "secure authenticate" unchecked)
* SMTP
- login "nick2@gmail.com" (don't forget it, in addition to pop login)
- server "127.0.0.1"
- port "11025"
- security protocol : none ("secure connection" : "none" checked)

Code: [Select]
user_pref("mail.account.account2.identities", "id2");
user_pref("mail.account.account2.server", "server2");

user_pref("mail.identity.id2.fullName", "My Nick2");
user_pref("mail.identity.id2.identityName", "Nick2");
user_pref("mail.identity.id2.smtpServer", "smtp2");
user_pref("mail.identity.id2.useremail", "nick2@gmail.com");

user_pref("mail.server.server2.hostname", "127.0.0.1");
user_pref("mail.server.server2.name", "My Nick2 account (Gmail)");
user_pref("mail.server.server2.port", 11110);
user_pref("mail.server.server2.type", "pop3");
user_pref("mail.server.server2.userName", "nick2@gmail.com");

// user_pref("mail.server.server2.useSecAuth", 0);
// this line does not appears, but it doesn't exists with another value than 0 or false

user_pref("mail.server.server2.realhostname", "127.0.0.1");
// I don't know if this line is usefull. it is the only one "realhostname" line of all my "prefs.js"

user_pref("mail.smtpserver.smtp2.hostname", "127.0.0.1");
user_pref("mail.smtpserver.smtp2.port", 11025);
user_pref("mail.smtpserver.smtp2.try_ssl", 0);

user_pref("mail.smtpserver.smtp2.username", "nick2@gmail.com");
// this last line is really necessary


My stunnel conf :
Code: [Select]
# We're running as a client to SSLify the GMail POP/SMTP connections
client=yes

# POP3 service, listens on localhost:11110
[gmail-pop3s]
accept=127.0.0.1:11110
connect=pop.gmail.com:995
#or the SSL port of your Secure POP server if you use another service.

# SMTP service, listens on localhost:11025
[gmail-smtps]
accept=127.0.0.1:11025
connect=smtp.gmail.com:587
protocol=smtp
#or the SSL port of your Secure SMTP server if you use another service.
I'm not sure that "protocol=smtp" is really usefull (?), but "protocol=pop(3)" in [gmail-pop3s] seems pop scan to unwork


My Avast conf :
Code: [Select]
[MailScanner]
Log=20
ShowTrayIcon=1
AutoSetProtection=0
PassThrough=1
Trust=127.0.0.1
AutoRedirect=1
StartSmtp=1
StartPop=1
StartImap=1
StartNntp=1
PopRedirectPort=110,11110
SmtpRedirectPort=25,11025
ImapRedirectPort=143
NntpRedirectPort=119
IgnoreLocalhost=0
IgnoreAddress=

Now everything works together !
It remains to add a anti-Spam if need be
Title: Re: Listening POP to 2 ports simultaneously ?
Post by: yoramdavid on March 11, 2006, 09:18:44 PM
Hello, I did all this and it worked fine for a while.
Then all the sudden thuinderbird would check for new e-mail, sends login information and says: Downloading message 1/3 and does not download anything.

Can anyone help with this, please?
I run stunnel 4.10

regards,

yoram