Postfix and authentication problem


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Postfix and authentication problem
# 1  
Old 10-17-2008
Postfix and authentication problem

Hi,
I've Postfix 2.5.1 mail server on Ubuntu 8.04. Recently, I got a new SMTP relay service to send out my mails. But for some reason every time I try to send mail I get this error:
(host relay.somehost.com[<ip_address_hidden>] said: 550 5.7.1 <testmail@hotmail.com>... Relaying denied. Proper authentication required. (in reply to RCPT TO command))

Here is my postconf output:
-------------------------------------------------------------------------------
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_command = /usr/bin/procmail
mailbox_size_limit = 0
mydestination = mydomain.com
myhostname = mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relay_domains = $mydestination
relayhost = [relay.somehost.com]:940
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)

smtpd_helo_restrictions = permit_mynetworks, reject_unknown_client, reject_invalid_hostname, reject_unknown_hostname, reject_non_fqdn_hostname, permit

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unknown_client, reject_invalid_hostname, reject_unknown_hostname, reject_non_fqdn_hostname, reject_unknown_sender_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unknown_recipient_domain, permit

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options =
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
-------------------------------------------------------------------------------
My sasl_passwd has the relay host with username and password. And I used postmap to make a db file of it.
Also, I tried this method to make sure that my user and pass are working:
perl -MMIME::Base64 -e 'print encode_base64("\000myuser\000mypass")'
And then tested with usual telnet method. It works. So the problem has to be with Postfix.

Any suggestions? Is there a way to do a higher level debug of Postfix.

Thanks in advance,
Nitin

Last edited by bakunin; 10-21-2008 at 05:21 AM.. Reason: spellings
# 2  
Old 10-19-2008
Run saslfinger -c and show output: saslfinger - debugging SMTP AUTH in Postfix

Also, show postconf -n output, not your entire postconf file.
MrC
# 3  
Old 10-20-2008
Thanks for the reply. The above post is my postconf -n output. Also, I did run saslfinger -c .. I didn't get any errors.
Here is the output of saslfinger:
--------------------------------------------
root@myhost:~# saslfinger -c
saslà¤à¥à¤¬à¤° 20 15:29:41 EDT 2008figuration सà¥à¤® à¤
version: 1.0.4
mode: client-side SMTP AUTH

-- basics --
Postfix: 2.5.1
System: Ubuntu 8.04.1 \n \l

-- smtp is linked to --
libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7dbe000)

-- active SMTP AUTH and TLS parameters for smtp --
relayhost = [relay.******t.com]:26
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


-- listing of /usr/lib/sasl2 --
total 847
drwxr-xr-x 2 root root 1472 2008-10-18 02:40 .
drwxr-xr-x 176 root root 47144 2008-10-19 19:50 ..
-rw-r--r-- 1 root root 13568 2008-04-09 17:50 libanonymous.a
-rw-r--r-- 1 root root 862 2008-04-09 17:49 libanonymous.la
-rw-r--r-- 1 root root 12984 2008-04-09 17:50 libanonymous.so
-rw-r--r-- 1 root root 12984 2008-04-09 17:50 libanonymous.so.2
-rw-r--r-- 1 root root 12984 2008-04-09 17:50 libanonymous.so.2.0.22
-rw-r--r-- 1 root root 15834 2008-04-09 17:50 libcrammd5.a
-rw-r--r-- 1 root root 848 2008-04-09 17:49 libcrammd5.la
-rw-r--r-- 1 root root 15320 2008-04-09 17:50 libcrammd5.so
-rw-r--r-- 1 root root 15320 2008-04-09 17:50 libcrammd5.so.2
-rw-r--r-- 1 root root 15320 2008-04-09 17:50 libcrammd5.so.2.0.22
-rw-r--r-- 1 root root 46332 2008-04-09 17:50 libdigestmd5.a
-rw-r--r-- 1 root root 871 2008-04-09 17:49 libdigestmd5.la
-rw-r--r-- 1 root root 43020 2008-04-09 17:50 libdigestmd5.so
-rw-r--r-- 1 root root 43020 2008-04-09 17:50 libdigestmd5.so.2
-rw-r--r-- 1 root root 43020 2008-04-09 17:50 libdigestmd5.so.2.0.22
-rw-r--r-- 1 root root 26608 2008-04-09 22:15 libgssapiv2.a
-rw-r--r-- 1 root root 1025 2008-04-09 22:14 libgssapiv2.la
-rw-r--r-- 1 root root 25260 2008-04-09 22:15 libgssapiv2.so
-rw-r--r-- 1 root root 25260 2008-04-09 22:15 libgssapiv2.so.2
-rw-r--r-- 1 root root 25260 2008-04-09 22:15 libgssapiv2.so.2.0.22
-rw-r--r-- 1 root root 13574 2008-04-09 17:50 liblogin.a
-rw-r--r-- 1 root root 842 2008-04-09 17:49 liblogin.la
-rw-r--r-- 1 root root 13268 2008-04-09 17:50 liblogin.so
-rw-r--r-- 1 root root 13268 2008-04-09 17:50 liblogin.so.2
-rw-r--r-- 1 root root 13268 2008-04-09 17:50 liblogin.so.2.0.22
-rw-r--r-- 1 root root 30016 2008-04-09 17:50 libntlm.a
-rw-r--r-- 1 root root 836 2008-04-09 17:49 libntlm.la
-rw-r--r-- 1 root root 29236 2008-04-09 17:50 libntlm.so
-rw-r--r-- 1 root root 29236 2008-04-09 17:50 libntlm.so.2
-rw-r--r-- 1 root root 29236 2008-04-09 17:50 libntlm.so.2.0.22
-rw-r--r-- 1 root root 13798 2008-04-09 17:50 libplain.a
-rw-r--r-- 1 root root 842 2008-04-09 17:49 libplain.la
-rw-r--r-- 1 root root 13396 2008-04-09 17:50 libplain.so
-rw-r--r-- 1 root root 13396 2008-04-09 17:50 libplain.so.2
-rw-r--r-- 1 root root 13396 2008-04-09 17:50 libplain.so.2.0.22
-rw-r--r-- 1 root root 22126 2008-04-09 17:50 libsasldb.a
-rw-r--r-- 1 root root 873 2008-04-09 17:49 libsasldb.la
-rw-r--r-- 1 root root 18080 2008-04-09 17:50 libsasldb.so
-rw-r--r-- 1 root root 18080 2008-04-09 17:50 libsasldb.so.2
-rw-r--r-- 1 root root 18080 2008-04-09 17:50 libsasldb.so.2.0.22
-rw-r----- 1 root root 701 2008-09-16 12:12 saslpasswd.conf
-rw-r----- 1 smmta smmsp 885 2008-09-16 12:12 Sendmail.conf

-- listing of /etc/postfix/sasl --
total 8
drwxr-xr-x 2 root root 112 2008-10-18 02:34 .
drwxr-xr-x 3 root root 448 2008-10-18 02:52 ..
-rw-r--r-- 1 root root 71 2008-10-18 02:34 OLDsmptd.conf
-rw-r--r-- 1 root root 68 2008-10-18 02:34 smtpd.conf


-- permissions for /etc/postfix/sasl_passwd --
-rw------- 1 root root 85 2008-10-17 16:36 /etc/postfix/sasl_passwd

-- permissions for /etc/postfix/sasl_passwd.db --
-rw------- 1 root root 12288 2008-10-17 16:36 /etc/postfix/sasl_passwd.db

/etc/postfix/sasl_passwd.db is up to date.

-- active services in /etc/postfix/master.cf --
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
smtp inet n - - - - smtpd
-o content_filter=spamassassin:dummy
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
-o smtp_fallback_relay=
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
spamassassin unix - n n - - pipe
user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

-- mechanisms on relay.******t.com --


-- end of saslfinger output --
# 4  
Old 10-21-2008
What is the output of :

Code:
$ telnet relay.******t.com 26

where you use the actual name of the relay host you've blanked out.
MrC
# 5  
Old 10-21-2008
I shouldn't be so paranoid.. Smilie

The telnet works, here is the output:
Code:
telnet relay.dnsexit.com 26
Trying 64.182.102.185...
Connected to relay.dnsexit.com.
Escape character is '^]'.
220 box7.911domain.com ESMTP Sendmail

Also, I checked to see if my user/pass work:
Code:
perl -MMIME::Base64 -e 'print encode_base64("\000username\000password")'

Using above perl command, I got a hash something like this:
***7QWERTYasdYWFk**
I tested that to make sure I get authenticated against the same relay server:
Code:
telnet relay.dnsexit.com 26
Trying 64.182.102.185...
Connected to relay.dnsexit.com.
Escape character is '^]'.
220 box7.911domain.com ESMTP Sendmail 
ehlo testing
250-box7.911domain.com Hello some.****.com [**.**.134.71], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 20000000
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN
250-STARTTLS
250-DELIVERBY
250 HELP
AUTH PLAIN ***7QWERTYasdYWFk**
235 2.0.0 OK Authenticated
quit
221 2.0.0 box7.911domain.com closing connection

I guess it has to be Postfix. It's just not bringing up SASL to authenticate. Is there a way to debug that?

Thanks again.
Nitin
# 6  
Old 10-21-2008
Ok, good, we were looking for the lines:

250-AUTH LOGIN PLAIN
250-STARTTLS

Now, check that what is on the LHS of your smtp_sasl_password_maps file (hash:/etc/postfix/sasl_passwd) matches exactly the value you have for relayhost = (eg. [relay.******t.com]:26).
MrC
# 7  
Old 10-21-2008
Also, I just noticed you don't have SASL enabled for the SMTP client:

Code:
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous

MrC
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Postfix Problem

Hello, I have a problem remotely connecting to the postfix. It sais "Connection refused". # telnet 104.200.16.232 25 Trying 104.200.16.232... telnet: connect to address 104.200.16.232: Connection refused But the postfix is started and running. # telnet 127.0.0.1 25 Trying... (3 Replies)
Discussion started by: galford
3 Replies

2. UNIX for Dummies Questions & Answers

Postfix Problem

hi guys i have a problem with postfix i can't send any mail to yahoo clients but i cant receive email from yahoo clients Feb 20 11:46:35 cp postfix/qmgr: 83F658003B: from=<ZZZ@XXX.org>, size=508, nrcpt=1 (queue active) Feb 20 11:46:35 cp postfix/smtp: 83F658003B: to=<ZZZ@yahoo.com>,... (1 Reply)
Discussion started by: mhs
1 Replies

3. Linux

Configure Postfix to relay to Exchange Server with NTLM authentication

Hello I have a shell script, which should send email, if any error occurred. This script is running in Red Hat Linux 4.6, and want to configure postfix so it can relay to an Exchange Server. The Authorization method of Exchange server, I guess is: 250-AUTH NTLM. So I have: Server A ( Red... (1 Reply)
Discussion started by: viktor1985
1 Replies

4. Red Hat

redhat linux postfix problem..

hello all, If i send mails using postfix,the mails stored in queue,not delivered to required recipient...can anyone please tell me the solution for this problem... (4 Replies)
Discussion started by: tilakraj
4 Replies

5. UNIX for Advanced & Expert Users

Postfix sender problem

Hi All! I have a very annoying problem. I have an openSuSE box, running postfix on it. It is configured, to use gmail to send mails. It is working fine, I accept the messages, but the sender is my gmail account, not the linux box. How can I (if I can) configure postfix to send the mails with... (0 Replies)
Discussion started by: szzed
0 Replies

6. Red Hat

SMTP authentication on Postfix/Dovecot on CentOS

Hi, I did setup one E-mail Server with postfix/dovecot/squirrelmail on CentOS 5.x and is working fine. I did configure SMTP authentication (without TSL/SSL) so that users from outside can send emails via our email server with SMTP auth. One weird issue i'm getting is that it's working from... (1 Reply)
Discussion started by: prvnrk
1 Replies

7. UNIX for Dummies Questions & Answers

Please help with Postfix config issue - How to allow remote Exchange server to relay to my postfix

Hi guys One of our clients have a problem with sending email to a certain domain. No matter what we try, the mails just dont get delivered. What I did then, is created a new connector on their Exchange server, pointing all mail sent to their client at "domain1" to relay to our Postfix mail... (0 Replies)
Discussion started by: wbdevilliers
0 Replies

8. IP Networking

Postfix SPF DNS problem

Hi I have a Postfix mail server in a Debian Linux network and used to be able to connect to it on port 25 via telnet. I also have working DNS on the server. I added this MX record to the DNS zone file: @ IN MX 10 server.c4.sysinst.ida.liu.se. It worked fine after that also but then... (3 Replies)
Discussion started by: jakethecake
3 Replies

9. IP Networking

postfix - reinject mail to postfix from hold queue directory

hi all. Am using smtpd_recipient_restrictions & check_recipient_access in postfix. The hash file looks like this: emailaddress1 HOLD emailaddress2 HOLD The aim is to place email from these recipients in the hold directory,check them then reinject them back in postfix on some... (0 Replies)
Discussion started by: coolatt
0 Replies

10. Red Hat

Redhat Linux - Postfix problem

We have a redhat linux el4 and used as a mail server.We configured postfix.all r working fine.we got a problem for a particular user when he tries to open his mailbox and the error is mentioned below: ERROR: Could not complete request. Query: SELECT "INBOX" Reason Given: Internal error... (3 Replies)
Discussion started by: ramjimh2k3
3 Replies
Login or Register to Ask a Question