PDA

View Full Version : problems sending receiving mail on Postfix


mavgh1
4th March 2006, 23:50
I am using SuSe 9.3 and installed Postfix following The Perfect Setup - SUSE 9.3 (Postfix With SMTP-AUTH And TLS )

server1:~ # telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.57.ro ESMTP Postfix
ehlo localhost
250-mail.57.ro
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250 8BITMIME
quit
221 Bye
Connection closed by foreign host.

It seems to be ok
Ive installed Courier-IMAP/Courier-POP3

My postfix main.cf

server1:~ # postconf -n
alias_maps = hash:/etc/aliases
biff = no
broken_sasl_auth_clients = yes
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
defer_transports =
disable_dns_lookups = no
home_mailbox = Maildir/
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 10240000
mydestination = $myhostname, localhost.$mydomain, mydomain
mydomain = 57.ro
myhostname = mail.$mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = no
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,check_ relay_domains
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
strict_rfc821_envelopes = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550

My problem is that I don't know howto add an account like user1@57.ro,user2@57.ro,user3@57.ro etc
Don't know how to add user and password for this accounts
I've searched on Internet but nothing matching with my request was found.

If someone can help me thanks in advance

falko
5th March 2006, 14:58
Have a look here: http://www.howtoforge.com/forums/showthread.php?t=2

mavgh1
5th March 2006, 17:50
Thanks very much I've tried but dont understand

Step 1 OK done it
postconf -e 'home_mailbox = Maildir/'
postconf -e 'mailbox_command ='
/etc/init.d/postfix restart

Step 2

useradd -d /home/sample_user -g users sample_user
passwd sample_user

I dont understand i make a user with the home directory /home/sample_user and group sample_user and the password sample user

Please detail for me like for dummies

Step 3

postconf -e 'virtual_maps = hash:/etc/postfix/virtusertable'
postconf -e 'mydestination = /etc/postfix/local-host-names'

Ive made a file virtusertable in /etc/postfix
Made a file local-host-names in /etc/postfix

Step 4
Inserted in file /etc/postfix/local-host-names domains to accept emails

Step 5

Inserted in file /etc/postfix/virtusertable

user1@mydomain.ro sample_user
user2@mydomain.ro sample_user
user3@mydomain.ro sample_user

falko
5th March 2006, 19:54
Step 2

useradd -d /home/sample_user -g users sample_user
passwd sample_user

I dont understand i make a user with the home directory /home/sample_user and group sample_user and the password sample user

Please detail for me like for dummies
You must replace the username, password and home directory appropriately.


Step 5

Inserted in file /etc/postfix/virtusertable

user1@mydomain.ro sample_user
user2@mydomain.ro sample_user
user3@mydomain.ro sample_user
Again, replace sample_user appropriately.

And don't forget to run postmap /etc/postfix/virtusertable
/etc/init.d/postfix restartat the end.

mavgh1
5th March 2006, 23:45
Now I can receive emails but cannot send

He said he cannot connect to SSL Server.Looking in log mail i found TLS no entropy and I uncomment in master.cf the line
tlsmgr unix n1000? 1tlsmgr

When I try to send emails he can connect to server(TLS conection established TLSv1 RC4-MD5 ,SASL LOGIN authentification failed) but he did not reconigze user and password.

till
6th March 2006, 08:06
Can you send emails when you connact with plain smtp without TLS?

mavgh1
6th March 2006, 21:40
I have the same problem SASL conection failed.
I must tell you that I'm running the server behind a router.Everything is configured to work behind the router(DNS,FTP etc and it works).When I receive mail I think there is the same problem he must route packets from Public IP to Private IP.
Thanks anyway for your time and still hope for some help.

falko
6th March 2006, 23:03
What's the exact error message?
Is saslauthd running? Please post the output of ps aux|grep sasl

mavgh1
6th March 2006, 23:53
root 6064 0.0 0.2 4060 1176 ? Ss Mar06 0:00 /usr/sbin/sasla uthd -a pam
root 6103 0.0 0.2 4060 1176 ? S Mar06 0:00 /usr/sbin/sasla uthd -a pam
root 6104 0.0 0.2 4060 1176 ? S Mar06 0:00 /usr/sbin/sasla uthd -a pam
root 6105 0.0 0.2 4060 1176 ? S Mar06 0:00 /usr/sbin/sasla uthd -a pam
root 6106 0.0 0.2 4060 1176 ? S Mar06 0:00 /usr/sbin/sasla uthd -a pam
root 13563 0.0 4.0 34564 20920 ? S Mar06 0:01 kwrite [kdeinit ] kwrite /etc/postfix/sasl_passwd
root 15294 0.0 0.1 1796 636 pts/1 R+ 00:38 0:00 grep sasl



When I maked the user and password I used the following syntax

The account is user1@57.ro

useradd -d /home/user1 -g users user1
passwd user1

In /home I made a folder user1
I think its that's correct because I can login to IMAP.
Thank you again for your quick response and patience.

falko
7th March 2006, 13:19
root 13563 0.0 4.0 34564 20920 ? S Mar06 0:01 kwrite [kdeinit ] kwrite /etc/postfix/sasl_passwd
What's that? Is it possible that kwrite hangs when you try to edit /etc/postfix/sasl_passwd?
I recommend to use vi on the command line to edit files: http://www.howtoforge.com/faq/12_15_en.html

Can you post the exact error message from your mail log?

mavgh1
7th March 2006, 19:32
ps aux|grep sasl
root 6122 0.0 0.2 4060 1132 ? Ss 19:06 0:00 /usr/sbin/saslauthd -a pam
root 6174 0.0 0.2 4060 1176 ? S 19:06 0:00 /usr/sbin/saslauthd -a pam
root 6175 0.0 0.2 4060 1176 ? S 19:06 0:00 /usr/sbin/saslauthd -a pam
root 6176 0.0 0.2 4060 1176 ? S 19:06 0:00 /usr/sbin/saslauthd -a pam
root 6177 0.0 0.2 4060 1132 ? S 19:06 0:00 /usr/sbin/saslauthd -a pam
root 7773 0.0 0.1 1792 624 pts/1 R+ 19:52 0:00 grep sasl

log mail

Mar 7 20:26:05 server1 postfix/smtpd[8105]: connect from unknown[194.126.184.34]
Mar 7 20:26:05 server1 postfix/smtpd[8105]: setting up TLS connection from unknown[194.126.184.34]
Mar 7 20:26:05 server1 postfix/smtpd[8105]: TLS connection established from unknown[194.126.184.34]: TLSv1 with cipher RC4-MD5 (128/128 bits)
Mar 7 20:26:05 server1 postfix/smtpd[8105]: warning: unknown[194.126.184.34]: SASL LOGIN authentication failed
Mar 7 20:26:05 server1 postfix/smtpd[8105]: lost connection after AUTH from unknown[194.126.184.34]
Mar 7 20:26:05 server1 postfix/smtpd[8105]: disconnect from unknown[194.126.184.34]
Mar 7 20:26:06 server1 postfix/smtpd[8105]: connect from unknown[194.126.184.34]
Mar 7 20:26:06 server1 postfix/smtpd[8105]: setting up TLS connection from unknown[194.126.184.34]
Mar 7 20:26:06 server1 postfix/smtpd[8105]: TLS connection established from unknown[194.126.184.34]: TLSv1 with cipher RC4-MD5 (128/128 bits)
Mar 7 20:26:06 server1 postfix/smtpd[8105]: warning: unknown[194.126.184.34]: SASL LOGIN authentication failed
Mar 7 20:26:06 server1 postfix/smtpd[8105]: lost connection after AUTH from unknown[194.126.184.34]
Mar 7 20:26:06 server1 postfix/smtpd[8105]: disconnect from unknown[194.126.184.34]
Mar 7 20:26:07 server1 postfix/smtpd[8105]: connect from unknown[194.126.184.34]
Mar 7 20:26:07 server1 postfix/smtpd[8105]: setting up TLS connection from unknown[194.126.184.34]
Mar 7 20:26:07 server1 postfix/smtpd[8105]: TLS connection established from unknown[194.126.184.34]: TLSv1 with cipher RC4-MD5 (128/128 bits)
Mar 7 20:26:07 server1 postfix/smtpd[8105]: warning: unknown[194.126.184.34]: SASL LOGIN authentication failed
Mar 7 20:26:07 server1 postfix/smtpd[8105]: lost connection after AUTH from unknown[194.126.184.34]
Mar 7 20:26:07 server1 postfix/smtpd[8105]: disconnect from unknown[194.126.184.34]
Mar 7 20:26:08 server1 imapd-ssl: Connection, ip=[::ffff:194.126.184.34]
Mar 7 20:26:08 server1 imapd-ssl: LOGIN, user=marius1, ip=[::ffff:194.126.184.34], protocol=IMAP
Mar 7 20:26:08 server1 imapd-ssl: Unexpected SSL connection shutdown.
Mar 7 20:26:08 server1 imapd-ssl: DISCONNECTED, user=marius1, ip=[::ffff:194.126.184.34], headers=0, body=0, time=0, starttls=1
Mar 7 20:26:08 server1 imapd-ssl: Connection, ip=[::ffff:194.126.184.34]
Mar 7 20:26:09 server1 imapd-ssl: LOGIN, user=marius1, ip=[::ffff:194.126.184.34], protocol=IMAP
Mar 7 20:26:09 server1 imapd-ssl: Unexpected SSL connection shutdown.
Mar 7 20:26:09 server1 imapd-ssl: DISCONNECTED, user=marius1, ip=[::ffff:194.126.184.34], headers=0, body=0, time=0, starttls=1
Mar 7 20:29:27 server1 postfix/anvil[8107]: statistics: max connection rate 3/60s for (smtp:194.126.184.34) at Mar 7 20:26:07
Mar 7 20:29:27 server1 postfix/anvil[8107]: statistics: max connection count 1 for (smtp:194.126.184.34) at Mar 7 20:24:50
Mar 7 20:29:27 server1 postfix/anvil[8107]: statistics: max cache size 1 at Mar 7 20:24:50

falko
7th March 2006, 23:11
Are you absolutely sure you use the correct username and password for sending emails?

mavgh1
8th March 2006, 02:23
With the same password I authenticate to IMAP.
If I dont use server authentication for outgoing mail I can send email from my server from user1@57.ro to user2@57.ro.

falko
8th March 2006, 10:12
I can send email from my server from user1@57.ro to user2@57.ro.
You don't need to authenticate if you
- send from localhost (e.g. with Webmail)
- send to a recipient that's on the server
- your client is within the mynetworks variable in /etc/postfix/main.cf.

mavgh1
8th March 2006, 10:55
What you suggest me to do.Everything seems to be ok but I cannot login.
Shell I use sasldb,change the authentication mode ?

falko
8th March 2006, 21:10
Please compare your configuration with the one from the SuSE 9.3 tutorial. It's working, I tested more than once, so I guess you maybe made a typo somewhere.

mavgh1
10th March 2006, 09:54
In /etc/sysconfig/saslauthd I changed

SASLAUTHD_AUTHMECH = pam change it to
SASLAUTHD_AUTHMECH = shadow
restart saslauthd and postfix and it works

Still have a question why yahoo.com send my emails to Bulk

Many thanks to Falko for his time.

falko
10th March 2006, 12:43
Still have a question why yahoo.com send my emails to Bulk

This can have many reasons:
- You're sending from a dynamic IP address/DSL line/dial-up account,...
- You don't have proper PTR and SPF records.
- Your IP address is on a blacklist.
...

I'd contact the Yahoo support and ask why this happens exactly.