View previous topic :: View next topic |
Author |
Message |
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Sun Jul 22, 2012 7:57 pm Post subject: Moving whole SMS installation to another machine |
|
|
I have recently installed a SMS box using 32bit Current distribution. The SMS box is meant to be a mailserver, with virtual users on mysql support(dovecot, postfix, postfixadmin, roundcube). Everything works excellent.
Now I need to change the box(hardware) but to keep the installation.
I did this in the new server, after fresh install with:
Code: | rsync --exclude-from=/root/exclusions --delete -ave "ssh" root@old_server:/ / |
exclusions: /proc, /sys, /dev, /mnt, /root, /etc/fstab, udev, lilo.conf
Finally everything is working very good, except only one thing: I cannot send email messages from my smartphone. From my desktop computer there is no problem sending/receiving emails with or without SSL/TLS.
Only from my mobile I cannot complete smtp server setting. On the old_server I can succesfully smtp with the same smartphone .
I have also generated fresh new dovecot certs.
Any help/hint/idea will be much apreciated. |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Sun Jul 22, 2012 11:02 pm Post subject: |
|
|
keopp wrote: | I cannot complete smtp server setting |
Since you already setup for old server, should work for your new clone.
I can't think anything else other than the port settings, smartphones tend to use port 587.
Have you try 25 or 465, or adding the IP of the server instead of the hostname?
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Mon Jul 23, 2012 7:09 am Post subject: |
|
|
Yes, I've tryed 25, 465 and also a custom defined 10025. All of these works on the original installation.
There is something more: using another Android email client(k9), I can select how smtp perform the auth: auto, plain or login. If auto is selected, the auth is unsuccessfull but it succeeds if plain or login selected.
There is something more: in the original inst. I used 3.2.21-smp but in the clone 3.2.21.. I think I'll work a little about rc.modules... |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Mon Jul 23, 2012 9:22 am Post subject: |
|
|
What do you have in /usr/lib/sasl2/smtpd.conf? (BTW in new built I set configdir in /etc/sasl2 same as SMS64 version.)
Just comment "mech_list" so it provides all auth methods.
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Mon Jul 23, 2012 1:55 pm Post subject: |
|
|
I'm sorry I do not undestand your question above.... in /usr/lib/sasl2 there are the libraries installed by the package, in /etc/postfix/smtp.conf I did uncomment mech_list but no change(what about /etc/sasl2... there is no such a directory...).
In the meanwhile I made a fresh installation with SMS Current. The result is the same.
I use dovecot as local delivery agent and also for auth. |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Mon Jul 23, 2012 2:03 pm Post subject: |
|
|
copy smtpd.conf to /usr/lib/sasl2/
and try comment mech_list.
To see if actually working do
postfix reload
and telnet with
telnet hostname 25
and at prompt do
ehlo hostname
you should see what types of auth are available.
Dovecot it's for incoming pop/imap, you said you have problem setting smtp settings in android.
The reference about /etc/sasl2/ it's informational about the upcoming new build (rebuilt with openssl-1.0, gnutls-3.0)
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Mon Jul 23, 2012 2:23 pm Post subject: |
|
|
All clear now.
Thanks for suggestions.
It is right Dovecot is for pop/imap but also is used for auth mechanisms in smtp. In Dovecot debug mode this is what I get:
Code: | Jul 22 19:33:19 Doris postfix/smtpd[3757]: connect from unknown[192.168.7.30]
Jul 22 19:33:19 Doris dovecot: auth: Debug: auth client connected (pid=0)
Jul 22 19:33:19 Doris postfix/smtpd[3757]: lost connection after EHLO from unknown[192.168.7.30]
Jul 22 19:33:19 Doris postfix/smtpd[3757]: disconnect from unknown[192.168.7.30]
Jul 22 19:33:31 Doris postfix/smtpd[3700]: timeout after EHLO from unknown[192.168.7.30]
Jul 22 19:33:31 Doris postfix/smtpd[3700]: disconnect from unknown[192.168.7.30] |
Later edit:
Idid what you suggested:
root@Doris:/etc/postfix# telnet 192.168.7.105 10025
Trying 192.168.7.105...
Connected to 192.168.7.105.
Escape character is '^]'.
220 mail.myhost.ro ESMTP Postfix
ehlo myhost.ro
250-mail.myhost.ro
250-PIPELINING
250-SIZE 51200000
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.
But if I try telnet from another computer I get only:
220 mail.myhost.ro ESMTP Postfix
and that's all
In the maillog:
Jul 23 15:30:54 Doris postfix/smtpd[2467]: connect from unknown[192.168.7.28]
that's all |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Mon Jul 23, 2012 6:10 pm Post subject: |
|
|
What's the output of telnet at ports 25, 465, 587?
Since in the old server it's working I don't know exactly what we are looking for, but we assume things.
Do you have dovecot or maillog output when phone tries to connect?
Your output of
postconf -n
would help, and also master.cf.
What I'm expecting is after STARTTLS
250-STARTTLS
250-AUTH CRAM-MD5 DIGEST-MD5 LOGIN PLAIN
250-AUTH=CRAM-MD5 DIGEST-MD5 LOGIN PLAIN
or
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
if you use an smtpd.conf like
Code: | pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
sql_select: dummy |
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Mon Jul 23, 2012 7:16 pm Post subject: |
|
|
Thankyou for your help.
First telnet output is:
root@ns:~# telnet myhost.ro 10025
Trying myhost.ro...
Connected to myhost.ro.
Escape character is '^]'.
220 mail.myhost.ro ESMTP Postfix
ehlo mail.fsiql.ro
250-mail.myhost.ro
250-PIPELINING
250-SIZE 51200000
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
421 4.4.2 mail.myhost.ro Error: timeout exceeded
Connection closed by foreign host.
Note1: I can get this output only if I telnet from an external ip to the external eth0. Telneting from local lan into local server ip(192.168.7.105) has no result:
telnet 192.168.7.105 10025
220 mail.myhost.ro ESMTP Postfix
..... and that's all
Note2: I get this output for all requested ports including 10025, except 465 when after EHLO, I get "Connection closed by foreign host."
Maillog(Dovecot log incuded) output when phone tryes to connect for smtp settings(I've used port 10025, 25 and 587 both with tls then ssl - if available ):
Jul 23 19:38:16 Doris postfix/smtpd[2441]: connect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:38:34 Doris postfix/smtpd[2444]: connect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:38:50 Doris postfix/smtpd[2446]: connect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:38:59 Doris postfix/smtpd[2441]: lost connection after EHLO from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:38:59 Doris postfix/smtpd[2441]: disconnect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:38:59 Doris postfix/smtpd[2441]: connect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:39:31 Doris postfix/smtpd[2444]: lost connection after EHLO from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:39:31 Doris postfix/smtpd[2444]: disconnect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:39:34 Doris postfix/smtpd[2444]: connect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:43:51 Doris postfix/smtpd[2446]: timeout after EHLO from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:43:59 Doris postfix/smtpd[2441]: timeout after EHLO from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:44:34 Doris postfix/smtpd[2444]: timeout after EHLO from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:44:34 Doris postfix/smtpd[2444]: disconnect from mail.fsiql.ro[my.ext.ip.adr]
Note1: Using MS Outlook I get successfully smtp test only with pop before smtp enabled.
The maillog follows:
Jul 23 19:42:26 Doris dovecot: pop3-login: Login: user=<tudor.popa@myhost.ro>, method=PLAIN, rip=my.ext.ip.adr, lip=83.103.186.215, mpid=2492, TLS, session=<iJlL7oHF+gBTZ7rZ>
Jul 23 19:42:26 Doris dovecot: pop3(tudor.popa@myhost.ro): Disconnected: Logged out top=0/0, retr=0/0, del=0/1, size=1188
Jul 23 19:42:26 Doris postfix/smtpd[2423]: connect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:42:26 Doris postfix/smtpd[2423]: 543002C0208: client=mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:42:26 Doris postfix/cleanup[2497]: 543002C0208: hold: header Received: from tudorlap (mail.fsiql.ro [my.ext.ip.adr])??by mail.myhost.ro (Postfix) with ESMTP id 543002C0208??for <tudor.popa@myhost.ro>; Mon, 23 Jul 2012 19:42:26 +0300 (EEST) from mail.fsiql.ro[my.ext.ip.adr]; from=<tudor.popa@myhost.ro> to=<tudor.popa@myhost.ro> proto=ESMTP helo=<tudorlap>
Jul 23 19:42:26 Doris postfix/cleanup[2497]: 543002C0208: message-id=<>
Jul 23 19:42:26 Doris postfix/smtpd[2423]: disconnect from mail.fsiql.ro[my.ext.ip.adr]
Jul 23 19:42:29 Doris MailScanner[2421]: New Batch: Scanning 1 messages, 1433 bytes
Jul 23 19:42:29 Doris MailScanner[2421]: Virus and Content Scanning: Starting
Jul 23 19:42:29 Doris MailScanner[2421]: SpamAssassin cache hit for message 543002C0208.A75AC
Jul 23 19:42:29 Doris MailScanner[2421]: Requeue: 543002C0208.A75AC to 12F292C020C
Jul 23 19:42:29 Doris postfix/qmgr[2365]: 12F292C020C: from=<tudor.popa@myhost.ro>, size=629, nrcpt=1 (queue active)
Jul 23 19:42:29 Doris MailScanner[2421]: Uninfected: Delivered 1 messages
Jul 23 19:42:29 Doris MailScanner[2421]: Deleted 1 messages from processing-database
Jul 23 19:42:29 Doris dovecot: lda(tudor.popa@myhost.ro): sieve: msgid=unspecified: stored mail into mailbox 'INBOX'
Jul 23 19:42:29 Doris postfix/pipe[2502]: 12F292C020C: to=<tudor.popa@myhost.ro>, relay=dovecot, delay=3.2, delays=3.1/0.01/0/0.12, dsn=2.0.0, status=sent (delivered via dovecot service)
Jul 23 19:42:29 Doris postfix/qmgr[2365]: 12F292C020C: removed
I'll continue with another post for postconf -n and master.cf.
Last edited by keopp on Sun Jul 29, 2012 4:22 pm; edited 2 times in total |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Mon Jul 23, 2012 7:26 pm Post subject: |
|
|
Files attached.
Removed by now because nothing wrong inside.
Can be reuploaded by request.
Last edited by keopp on Sun Jul 29, 2012 4:18 pm; edited 2 times in total |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Mon Jul 23, 2012 8:49 pm Post subject: |
|
|
keopp wrote: | Note1: I can get this output only if I telnet from an external ip to the external eth0. Telneting from local lan into local server ip(192.168.7.105) has no result: |
Do you have two ethernet?
Do you use a firewall, router setup?
I see in main.cf
mydomain = termrom.ro
myhostname = mail.myhost.ro
Normally you should have
mydomain = myhost.ro
Also a double entry
smtpd_client_restrictions = permit_mynetworks, permit_mynetworks,
try also with
smtpd_client_restrictions =
Another possible issue
mydestination = localhost
you might wanna add $mydomain or any other virtual domain you use.
You can try setting also
smtpd_helo_required = no
to see if android client works.
If everything else fail you can try switching to
smtpd_sasl_type = cyrus
of course you might need to edit /etc/saslauthd.conf or smtpd.conf with sql_select options, if auth fails e.g.
Code: | testsaslauthd -u user -p pass |
Your 465 port ain't working probably from wrappermode=yes, try to comment it.
wrappermode=yes it's for outlook express mostly.
Code: | smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=ye |
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Tue Jul 24, 2012 7:29 am Post subject: |
|
|
Dear G, all your sugestions are very valuable, thank you again.
Yes, I have 2 eth but in this case rc.firewall is disabled and the routes are only default.
mydomain was a typo, in relity it has the correct value
I corrected the double entry dued to a wrong comment(#)
The mydestination cannot list a virtual domain(see here ), and since I use only virtual domains I use localhost.
The smtpd_helo_required is tested to work on the original installation. Anyhow I tryed it with 'no' but nothing changed.
I'll go for the cyrus but I'll continue first to try to find out why for the same settings, the 2 machines behave differently.
If I can get a solution I'll put it here. |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Sun Jul 29, 2012 1:20 pm Post subject: |
|
|
Hello again,
I've solved the problem. It was in main.cf.
Code: | smtpd_sasl_exceptions_networks = $mynetworks |
Commenting it out solved all problems:
- first: mobile android device access(through local net) and smtp auth offer;
- second: the MsOulook2007 must to have "Log on to incoming mail server before sending mail" option checked.
Thanks very much again for suport. |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Sun Jul 29, 2012 3:05 pm Post subject: |
|
|
Didn't that exist in the other machine?
Thanks for sharing...
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Sun Jul 29, 2012 3:53 pm Post subject: |
|
|
Of course it was. But I was accessing the other machine only over the ethernet, and everything was ok. When I initially installed that first machine, I didn't perform smtp(localy) tests with my smartphone, but only with Ms Outlook Express, The Bat! and Incredimail email clients which apparently seems not to be so sensitive as MsOutlook2007(and Android).
Any how I belive it's a good hint especially for lazy people(like I was) who follow and copy tutorials without trying to find deeply what every statement in a config file is meant for. On the other hand I belive this is the engine of getting more and more skilled.
I'm glad to be part of this(SMS) comunity.
Cheers. |
|
Back to top |
|
|