| Linode Forum https://forum.linode.com/ |
|
| Postfix/Dovecot: Can't send mail via Thunderbird https://forum.linode.com/viewtopic.php?f=11&t=4147 |
Page 1 of 1 |
| Author: | trazoi [ Mon Apr 27, 2009 9:40 am ] |
| Post subject: | Postfix/Dovecot: Can't send mail via Thunderbird |
Hey everyone, I've just recently bought a Linode and am teaching myself web server admin by trial and error. I'm working through learning how to install and configure the basics to run the small site I want (to begin with:LAMP, WordPress, email, log admin, backups). I'm currently up to email, and I've hit a small problem that has me stumped. At the moment, I've got Postfix running with Dovecot using SASL authentication, as per this tutorial I found at debianadmin.com: http://www.debianadmin.com/debian-mail-server-setup-with-postfix-dovecot-sasl-squirrel-mail.html. The tutorial goes on to install Squirrel Mail, but I'm attempting to access my mail via Thunderbird locally so I can manage all my accounts together. It's almost working. I can send mail to my accounts and read them via Thunderbird, but I can't send mail via Thunderbird. If I try (using SSL and default port 465), I instantly get an error message "The server may be unavailable or is refusing SMTP connections". If I try different ports like 25, the sending hangs when it connects to my server. If instead I ssh into my linode and send mail via the command line mail, it works without problem. So I'm assuming there's a connection problem between my server and my computer. My gut feeling is that this is really simple, and I've forgotten to do something like turn on a setting in the command line settings in Postfix, Dovecot or SASL. Or it's something even more obvious and I've just misconfigured Thunderbird. I've tried modifying some of the settings in Postfix's main.cf config file, but nothing seems to work. Strangely I also can't seem to find reference to my failed attempts to send emails in the log files in /var/log. Learning the logging system was after email on my checklist so I'm pretty in the dark for what to look for here. While a solution is needed, I'd mainly like to know where I should be looking. I'm spending this week with my Linode learning the ropes, so learning how to do basic admin is just as important as getting it working. Once I figure out how to do all the basics I'm probably going to nuke everything and build it up again a bit better anyway (plus a good test of the backups!), so I don't mind making a bit of a mess. Thanks! Edit: Forgot to mention: I'm using Debian as my OS. |
|
| Author: | saman007uk [ Mon Apr 27, 2009 9:53 am ] |
| Post subject: | |
Post logs (/var/log/mail.log) and configuration files. It may be that your ISP is blocking somg ports. |
|
| Author: | trazoi [ Mon Apr 27, 2009 10:24 am ] |
| Post subject: | |
Is there a good way to figure out which ports I can use? I know I can receive and send mail via GMail. I'm pretty sure I've tried the same port I use for that, but I don't know if I have to change something in the default settings in Postfix or Dovecot to handle that. Here's the last lines from my mail.log file. I've mangled up the email addresses a bit to fox any spambots (all sent mail is from my site trazoi.com), but it should be pretty clear: Code: Apr 27 10:37:11 postfix/master[10547]: reload configuration /etc/postfix I think the one email sent was via (the command line) mail in a ssh session. All the demon restarting lines were from me making changes and resetting the email system. There would have been a lot of Thunderbird message attempts in that time, but I don't see them in the logs. My Postfix main.cf currently looks like this: Code: # See /usr/share/postfix/main.cf.dist for a commented, more complete version The stuff at the end are various commands I've seen on guides that I've meshed together. I haven't touched the defaults in master.cf save for adding a "deadbeats" line from one set of tips I found. The dovecot config file is large, and I'm not sure if that's the issue. The main change was the one that's in the tutorial I linked to, which I've typed in verbatim: Code: auth default {
Are there any other files that might help? Edit: Oh, and if there any other glaring problems with those config files, I'd be grateful if you pointed them out. Understanding how to configure the email system nicely is turning out to be a lot harder than Apache. |
|
| Author: | Stever [ Mon Apr 27, 2009 11:11 am ] |
| Post subject: | |
It looks to me like you have not set up postfix to listen on anything other than port 25. You will need to set thunderbird to use TLS on port 25, not SSL when you send with the server configured like this. I also highly recommend adding "smtpd_tls_auth_only = yes" to prevent SASL from being done without encryption. If you want to use SSL on port 465 instead, need to add an entry to master.cf for smtps service type. On my system (gentoo) it is already there but commented out. |
|
| Author: | Vance [ Tue Apr 28, 2009 12:51 am ] |
| Post subject: | |
Stever wrote: It looks to me like you have not set up postfix to listen on anything other than port 25.
You can check what TCP ports that daemons are listening on with the command netstat -nvlpt. You'll see something similar to the following: Code: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name If you don't see something ending in :465 under "Local Address," you don't have anything listening on that port. (Also, perhaps Thunderbird is trying to use port 587 for mail submission?) |
|
| Author: | trazoi [ Tue Apr 28, 2009 4:24 am ] |
| Post subject: | |
Thanks, everyone. After a few too many hours work on this I think I've got it sorted out now. It turns out I was looking at the wrong port, but I didn't have another port activated. With a bit of reconfiguring I've got it working with the same connection as GMail (port 587, TSL). The steps were something like this:
Well, now it works. I still don't know for sure how secure the system is, and I've also got to figure out how to archive the mail nicely, but it works. To check that nothing funny is happening with the mail, I should regularly check mail.log and the other similarly named log files, right? |
|
| Author: | Stever [ Tue Apr 28, 2009 12:07 pm ] |
| Post subject: | |
trazoi wrote: [*]In master.cf, uncomment the line for submission. This will activate port 587. I also uncommented the lines for the flags that looked like they were useful. I haven't yet uncommented the flag for smtpd_tls_security_level=encrypt but I'm unsure - sources suggest that's bad for receiving email as it blocks anyone with an incompatible client, but I'm not sure about receiving email.
The "-o smtpd_tls_security_level=encrypt" line sets it to only allow encrypted sessions on the submission port (587). This only applies to email you are originating - it has no effect on your receiving of email which should always be on port 25. As far as leaving it commented out, sending passwords in-the-clear is just a bad idea. IMHO, anyone with an incompatible client shouldn't be allowed to send email in this day and age. |
|
| Author: | trazoi [ Tue Apr 28, 2009 6:47 pm ] |
| Post subject: | |
Stever wrote: trazoi wrote: [*]In master.cf, uncomment the line for submission. This will activate port 587. I also uncommented the lines for the flags that looked like they were useful. I haven't yet uncommented the flag for smtpd_tls_security_level=encrypt but I'm unsure - sources suggest that's bad for receiving email as it blocks anyone with an incompatible client, but I'm not sure about receiving email. The "-o smtpd_tls_security_level=encrypt" line sets it to only allow encrypted sessions on the submission port (587). This only applies to email you are originating - it has no effect on your receiving of email which should always be on port 25. As far as leaving it commented out, sending passwords in-the-clear is just a bad idea. IMHO, anyone with an incompatible client shouldn't be allowed to send email in this day and age. Thanks for the clarification. I thought it was just on the submission port, but given the warnings I read in the manual about setting that flag to encrypt in main.cf I was hesitant to set it in master.cf. |
|
| Author: | roint [ Thu Jul 23, 2009 7:52 pm ] |
| Post subject: | |
Try this in master.cf: Code: smtps inet n - - - - smtpd Use port 465 for SSL with Outlook or Thunderbird. |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|