PDA

View Full Version : [SOLVED] 10.04 - Problem sending email using client



DarkRanger
January 11th, 2011, 02:18 PM
I set up a server, complete with mx records and the likes. I have Postfix as a mail server, Dovecot as my POP3/SMTP server and I'm trying to send mail from a Windows based machine (using Outlook 2007).

I can receive mail using pop fine (for instance I'll send mail from my gmail account to the email address and the email will POP into my Outlook). But I can't send mail. When I try to send an email from Outlook, I get an instant response email saying:


Your message did not reach some or all of the intended recipients.

Subject: alsdkjfasdf
Sent: 2011/01/11 03:07 PM

The following recipient(s) cannot be reached:

'alberts@xxxxx.com' on 2011/01/11 03:07 PM
554 5.7.1 <alberts@xxxxx.com>: Relay access denied

I've read up a bit on this, and no solutions has helped me thus far.

Herewith my Postfix and Dovecot config files.

Postfix (main.cf)


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
inet_protocols = all
mailbox_size_limit = 0
mydestination = 3bm.co.za, localhost, localhost.localdomain, localhost, deltafacilities.com, deltainfrastructure.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_local_domain = 3bm.co.za, deltafacilities.com
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

Dovecot (dovecot.conf)


# 1.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-305-ec2 x86_64 Ubuntu 10.04.1 LTS
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap pop3
ssl: no
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
mail_privileged_group: mail
mail_location: mbox:~/mail:INBOX=/var/mail/%u
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
auth default2:
passdb:
driver: pam
userdb:
driver: passwd
auth default:
mechanisms: plain login
passdb:
driver: pam
userdb:
driver: passwd
socket:
type: listen
client:
path: /var/spool/postfix/private/auth
mode: 432
user: postfix
group: postfix

I'm still fairly new to this, so please be gentle. :P

Thirtysixway
January 11th, 2011, 06:38 PM
See where the line is for postfix

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128


You need to add which networks can send mail, I believe. Right now it's configured to only allow localhost addresses. Add lan such as 192.168.1.0/24 in order to have access from another computer on the same network as the server. I had to do that on my server to send mail from another machine.

If that doesn't work, it may be some authentication issues. I'm not an expert in it either, just started playing around with it a few weeks ago.

DarkRanger
January 11th, 2011, 06:49 PM
See where the line is for postfix

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128


You need to add which networks can send mail, I believe. Right now it's configured to only allow localhost addresses. Add lan such as 192.168.1.0/24 in order to have access from another computer on the same network as the server. I had to do that on my server to send mail from another machine.

If that doesn't work, it may be some authentication issues. I'm not an expert in it either, just started playing around with it a few weeks ago.

I'll give that a shot. Would you know what addresses to use or what to enter there if I want to be able to send email from any network? The server does require authentication, so it won't turn the server into an open relay AFAIK.

Thanks for the input so far.

Thirtysixway
January 11th, 2011, 06:56 PM
Looking at the postfix documentation, it may not actually be a good idea to trust IP addresses outside of the lan.

On google I'm seeing a lot of 'Did you enable "Server requires aurthentication" in your email client?'

Try looking through this guide http://www.howtoforge.com/perfect_setup_debian_sarge_p4 and see if it helps with anything

DarkRanger
January 11th, 2011, 07:00 PM
Looking at the postfix documentation, it may not actually be a good idea to trust IP addresses outside of the lan.

On google I'm seeing a lot of 'Did you enable "Server requires aurthentication" in your email client?'

Try looking through this guide http://www.howtoforge.com/perfect_setup_debian_sarge_p4 and see if it helps with anything

Server requires authentication enables me to connect and then I get the relay message. If server authentication is not on, it does not connect. So that is checked.

I also worked through that guide. It did sort out some issues I had.

The thing is, email is sent to the mailboxes on the server and these emails can come from anywhere. So if I specify only a certain network, it won't really resolve the problem. Or am I missing something here?

Thirtysixway
January 11th, 2011, 07:08 PM
I'm not sure :I
Maybe someone else can help? Or try IRC, sometimes they respond better in there.

DarkRanger
January 11th, 2011, 07:16 PM
Cool, thanks for the responses though! :)

DarkRanger
January 12th, 2011, 01:32 PM
Seems the authentication service never started. This fixed the issue:


chmod +x /etc/init.d/saslauthd
/etc/init.d/saslauthd start

The last line returned a permission denied error, so I googled that and... WIN!!

DarkRanger
January 12th, 2011, 02:27 PM
Now I can't receive email... Outlook just says Can't connect to POP server

EDIT: Quick restart of the server seemed to fix all issues. :)