Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Postfix and courier-imap problem. TSL wont work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mopmop
n00b
n00b


Joined: 20 May 2004
Posts: 71
Location: Oslo, Norway

PostPosted: Sat Sep 15, 2007 12:51 pm    Post subject: Postfix and courier-imap problem. TSL wont work Reply with quote

I wanted to setup a basic mailing system on my comp, and decided to use postfix as recomended by this howto on gentoo-wiki.com.

What I need is:

  • Be able to send mails from my computer to anyone, (pref. without the use of an external smtp server)
  • Sending mail to local users, both locally and from the net.
  • Access mail on box from anywhere by local users via IMAP


Problem 1
So far, 1 and 2 are working to some degree. Via mutt I can send mail instantly to local users. Sending mail to other users worked yesterday, but now it seems borked. Hovever, the main problem is I cant find a command-line command to send mail. sendmail is in /usr/sbin and I have no "mail" command.

Problem2
TLS is not working. Attempting to use smtp server from opera returns error :
Code:
Sending e-mail failed. Maybe the SMTP server is not set up properly? E-mail queued.

If I turn TLS off, sending works.

Problem3
IMAP doesnt work either way (TLS turned off or on). It just sticks on "connecting" and then nothing.


This is postconf -n
Code:

alias_database = hash:/etc/mail/aliases
alias_maps = hash:/etc/mail/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
default_destination_concurrency_limit = 2
home_mailbox = .maildir/
local_destination_concurrency_limit = 2
mail_owner = postfix
mailbox_command = /usr/bin/procmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, mycomp.myisp.no
mydomain = hopto.org
myhostname = mycomp.hopto.org
mynetworks = 127.0.0.0/8 192.168.2.0/24 mycomp.hopto.org
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases
proxy_interfaces = mycomp.hopto.org
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.6/readme
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,       permit_mynetworks,      reject_unauth_destination
smtpd_sasl_auth_enable = no
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/ssl/postfix/server.pem
smtpd_tls_cert_file = /etc/ssl/postfix/server.crt
smtpd_tls_key_file = /etc/ssl/postfix/server.key
smtpd_tls_loglevel = 5
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 450


I have ddns with no-ip.com so mycomp.hopto.org is routed to my router. The router forwards, among other things, ports 25 and 143 to my box.
If I omit @mycomp.hopto.org, mutt/postfix/someone turns this into username@mycomp.myisp.no. This is the reason mydestination includes this host name. Output of:
hostname = mycomp
domainname = (none)
dnsdomainname = hopto.org

Log after trying to send and connect to imap at once is here.

I am really stuck, any help is deeply appreciated. Let me know if you need more info.

~mopmop
_________________
AMD Athlon 64 3000+, MSI K8N NEO Platinum Edition S754, Seagate Barracuda 7200.7 200GB S-ATA, nVidia GeForce 6600 GT.


Last edited by mopmop on Sun Sep 16, 2007 10:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Sat Sep 15, 2007 6:00 pm    Post subject: Re: Problems with postfix. (eg. IMAP wont work) Reply with quote

Problem 1: Is the sendmail binary not enough for sending mail?
Problem 2: Please post the output of the command "postconf -n" and post the content of master.cf.
Problem 3: Not Postfix related. What IMAP server are you using? Courier? Cyrus? Other?

// SteveB
Back to top
View user's profile Send private message
mopmop
n00b
n00b


Joined: 20 May 2004
Posts: 71
Location: Oslo, Norway

PostPosted: Sun Sep 16, 2007 1:35 am    Post subject: Reply with quote

Thank you for your reply.

1. Silly me. It was just that I had the impression that /usr/sbin was reserved for root? It's not in my path, but I see now that it is indeed executable for a regular user. I'll make a symlink or something. Thanks :D

2. The output of postconf -n is already in the post.
master.cf is rather long and everything deviating from standard settings are listed by postconf -n, so I chose not to include it.
Nevertheless: main.cf with comments are found here. The massive "....#<VALUE SET>#..." thing was made during my attempted fix, to clearly see the variables not commented out.
The uncommented main.cf is here:

Code:


queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
myhostname = mycomp.hopto.org
mydomain = hopto.org
myorigin = $myhostname
proxy_interfaces = mycomp.hopto.org
mydestination = $myhostname, localhost.$mydomain, mycomp.myisp.no
unknown_local_recipient_reject_code = 450
mynetworks = 127.0.0.0/8 192.168.2.0/24 mycomp.hopto.org
alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
home_mailbox = .maildir/
mailbox_command = /usr/bin/procmail
local_destination_concurrency_limit = 2
default_destination_concurrency_limit = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/share/man
readme_directory = /usr/share/doc/postfix-2.3.6/readme
smtpd_sasl_auth_enable = yes
smtpd_sasl2_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain =
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtp_use_tls = yes
smtpd_use_tls=yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/ssl/postfix/server.key
smtpd_tls_cert_file = /etc/ssl/postfix/server.crt
smtpd_tls_CAfile = /etc/ssl/postfix/server.pem
smtpd_tls_loglevel = 5
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom


3. You're right, not postfix related. I'll make another thread or change the name of this one. But tomorrow, it's getting awfully late ;). Btw. IMAP server is Courier.

Hope this will help you help me.

mopmop
_________________
AMD Athlon 64 3000+, MSI K8N NEO Platinum Edition S754, Seagate Barracuda 7200.7 200GB S-ATA, nVidia GeForce 6600 GT.
Back to top
View user's profile Send private message
mopmop
n00b
n00b


Joined: 20 May 2004
Posts: 71
Location: Oslo, Norway

PostPosted: Sun Sep 16, 2007 1:37 pm    Post subject: Reply with quote

After some tinkering and rereading the wiki mentioned above. I finally got courier to work with ssl. It was just silly things. I case someone else is struggling with the same silly tings, here they are :

Wrote/misread "authmap" for the correct value "authpam" in /etc/courier/authlib/authdaemonrc. The error I got from that was:
Code:

Sep 16 12:52:33 [imapd] Connection, ip=[::ffff:127.0.0.1]
Sep 16 12:52:33 [imapd] LOGIN FAILED, user=myself, ip=[::ffff:127.0.0.1]
Sep 16 12:52:38 [imapd] Unexpected SSL connection shutdown.

Even though the password was correct

The second (really silly) mistake appeared when I ran "nmap localhost", discovering that imaps was listening on 993, not 143, and that opera didnt adjust this port when switching to SSL.


The only problem remaining is that TLS still deesnt work on SMTP. The error message is the same as the one posted above. Without TLS it works perfectly.
_________________
AMD Athlon 64 3000+, MSI K8N NEO Platinum Edition S754, Seagate Barracuda 7200.7 200GB S-ATA, nVidia GeForce 6600 GT.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum