LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   configure postfix to connect to remote smtp server (https://www.linuxquestions.org/questions/linux-software-2/configure-postfix-to-connect-to-remote-smtp-server-806224/)

mrpurple 05-05-2010 11:11 PM

configure postfix to connect to remote smtp server
 
Try as I might I cant get postfix to send emails through an external email server (I can succesfully get client software to do it no trouble)
After following the howto at:
http://www.howtoforge.com/how-to-rel...postfix-server
I get 5.0.0 errors re:
Code:

May  6 16:06:32 SERVER1 postfix/error[20357]: 2392F21438: to=<SOME_ADDRESS@hotmail.com>, relay=none, delay=0.17, delays=0.1/0.01/0/0.06, dsn=5.0.0, status=bounced (smtp.live.com)
Here's my main.cf
Code:

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
content_filter = scan:127.0.0.1:10026
default_transport = error
inet_interfaces = all
mailbox_size_limit = 0
mydestination = VARIOUSHOSTS.localhost localhost
myhostname = XXXX.XXX.com
mynetworks = 127.0.0.0/8 192.168.2.0/24 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_transport = error
relayhost = smtp.live.com
smtp_always_send_ehlo = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpasswd
smtp_sasl_security_options = noanonymous
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = no
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_reject_unlisted_recipient = no
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_alias_maps = proxy:mysql:/etc/postfix/my_alias_maps.cf
virtual_gid_maps = static:8
virtual_mailbox_base = var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/my_domains_maps.cf
virtual_mailbox_limit = proxy:mysql:/etc/postfix/my_mailbox_limits.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/my_mailbox_maps.cf
virtual_minimum_uid = 150
virtual_transport = dovecot
virtual_uid_maps = static:150

I do have a password file and i did postmap it (there'd be different errors if i didnt anyhow right)

I get basically the same error no matter what smtpserver/username/password combination I use leading me to believe its my setup and not my username/password

senthilvael 05-05-2010 11:50 PM

Hi,
Does the log provide any more details? Does your ip listed in any RBL?







Quote:

Originally Posted by mrpurple (Post 3958809)
Try as I might I cant get postfix to send emails through an external email server (I can succesfully get client software to do it no trouble)
After following the howto at:
http://www.howtoforge.com/how-to-rel...postfix-server
I get 5.0.0 errors re:
Code:

May  6 16:06:32 SERVER1 postfix/error[20357]: 2392F21438: to=<SOME_ADDRESS@hotmail.com>, relay=none, delay=0.17, delays=0.1/0.01/0/0.06, dsn=5.0.0, status=bounced (smtp.live.com)
Here's my main.cf
Code:

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
content_filter = scan:127.0.0.1:10026
default_transport = error
inet_interfaces = all
mailbox_size_limit = 0
mydestination = VARIOUSHOSTS.localhost localhost
myhostname = XXXX.XXX.com
mynetworks = 127.0.0.0/8 192.168.2.0/24 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_transport = error
relayhost = smtp.live.com
smtp_always_send_ehlo = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpasswd
smtp_sasl_security_options = noanonymous
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = no
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_reject_unlisted_recipient = no
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_alias_maps = proxy:mysql:/etc/postfix/my_alias_maps.cf
virtual_gid_maps = static:8
virtual_mailbox_base = var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/my_domains_maps.cf
virtual_mailbox_limit = proxy:mysql:/etc/postfix/my_mailbox_limits.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/my_mailbox_maps.cf
virtual_minimum_uid = 150
virtual_transport = dovecot
virtual_uid_maps = static:150

I do have a password file and i did postmap it (there'd be different errors if i didnt anyhow right)

I get basically the same error no matter what smtpserver/username/password combination I use leading me to believe its my setup and not my username/password


mrpurple 05-06-2010 03:35 PM

Hi,
Thanks for having a look!
here's a more complete log file

Code:

May  7 08:08:46 SERVER1 dovecot: POP3(XXX@YYY.com): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0
May  7 08:08:48 SERVER1 dovecot: pop3-login: Login: user=<XXX@YYY.com>, method=PLAIN, rip=192.168.2.6, lip=192.168.2.8
May  7 08:08:48 SERVER1 dovecot: POP3(XXX@YYY.com): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0
May  7 08:08:49 SERVER1 postfix/smtpd[29090]: connect from techoffice1[192.168.2.6]
May  7 08:08:49 SERVER1 postfix/smtpd[29090]: E11AF2100D: client=techoffice1[192.168.2.6]
May  7 08:08:49 SERVER1 postfix/cleanup[29093]: E11AF2100D: message-id=<594A9EC1DE31471890E22AD74E333A58@techoffice1>
May  7 08:08:50 SERVER1 postfix/qmgr[20340]: E11AF2100D: from=<XXX@YYY.com>, size=1346, nrcpt=1 (queue active)
May  7 08:08:50 SERVER1 postfix/smtpd[29090]: disconnect from techoffice1[192.168.2.6]
May  7 08:08:50 SERVER1 clamsmtpd: 10003B: accepted connection from: 127.0.0.1
May  7 08:08:50 SERVER1 postfix/smtpd[29096]: connect from localhost[127.0.0.1]
May  7 08:08:50 SERVER1 postfix/smtpd[29096]: 13F0821437: client=techoffice1[192.168.2.6]
May  7 08:08:50 SERVER1 postfix/cleanup[29093]: 13F0821437: message-id=<594A9EC1DE31471890E22AD74E333A58@techoffice1>
May  7 08:08:50 SERVER1 postfix/qmgr[20340]: 13F0821437: from=<XXX@YYY.com>, size=1580, nrcpt=1 (queue active)
May  7 08:08:50 SERVER1 clamsmtpd: 10003B: from=XXX@YYY.com, to=ZZZ@hotmail.com, status=CLEAN
May  7 08:08:50 SERVER1 postfix/smtp[29094]: E11AF2100D: to=<ZZZ@hotmail.com>, relay=127.0.0.1[127.0.0.1]:10026, delay=0.26, delays=0.1/0.01/0.05/0.09$
May  7 08:08:50 SERVER1 postfix/smtpd[29096]: disconnect from localhost[127.0.0.1]
May  7 08:08:50 SERVER1 postfix/qmgr[20340]: E11AF2100D: removed
May  7 08:08:50 SERVER1 postfix/error[29098]: 13F0821437: to=<ZZZ@hotmail.com>, relay=none, delay=0.14, delays=0.09/0.01/0/0.04, dsn=5.0.0, status=bounced (smtp.live.com)
May  7 08:08:50 SERVER1 postfix/cleanup[29093]: 364F52143B: message-id=<20100506200850.364F52143B@YYYmail.YYY.com>
May  7 08:08:50 SERVER1 postfix/bounce[29099]: 13F0821437: sender non-delivery notification: 364F52143B

May  7 08:08:50 SERVER1 postfix/qmgr[20340]: 364F52143B: from=<>, size=3407, nrcpt=1 (queue active)
May  7 08:08:50 SERVER1 postfix/qmgr[20340]: 13F0821437: removed
May  7 08:08:50 SERVER1 deliver(XXX@YYY.com): msgid=<20100506200850.364F52143B@YYYmail.YYY.com>: saved mail to INBOX
May  7 08:08:50 SERVER1 postfix/pipe[29100]: 364F52143B: to=<XXX@YYY.com>, relay=dovecot, delay=0.12, delays=0.04/0.01/0/0.07, dsn=2.0.0, st$
May  7 08:08:50 SERVER1 postfix/qmgr[20340]: 364F52143B: removed

FYI here is an email passed through internally which worked
Code:

May  7 08:22:57 SERVER1 postfix/smtpd[29201]: connect from techoffice1[192.168.2.6]
May  7 08:22:57 SERVER1 postfix/smtpd[29201]: 97F172100D: client=techoffice1[192.168.2.6]
May  7 08:22:57 SERVER1 postfix/cleanup[29204]: 97F172100D: message-id=<B962EC5289404072982C026EAB7C68FA@techoffice1>
May  7 08:22:57 SERVER1 postfix/qmgr[20340]: 97F172100D: from=<XXX@YYY.com>, size=1371, nrcpt=1 (queue active)
May  7 08:22:57 SERVER1 postfix/smtpd[29201]: disconnect from techoffice1[192.168.2.6]
May  7 08:22:57 SERVER1 clamsmtpd: 10003C: accepted connection from: 127.0.0.1
May  7 08:22:57 SERVER1 postfix/smtpd[29207]: connect from localhost[127.0.0.1]
May  7 08:22:57 SERVER1 postfix/smtpd[29207]: B8D6721437: client=techoffice1[192.168.2.6]
May  7 08:22:57 SERVER1 postfix/cleanup[29204]: B8D6721437: message-id=<B962EC5289404072982C026EAB7C68FA@techoffice1>
May  7 08:22:57 SERVER1 clamsmtpd: 10003C: from=XXX@YYY.com, to=XXX@YYY.com, status=CLEAN
May  7 08:22:57 SERVER1 postfix/qmgr[20340]: B8D6721437: from=<XXX@YYY.com>, size=1611, nrcpt=1 (queue active)
May  7 08:22:57 SERVER1 postfix/smtp[29205]: 97F172100D: to=<XXX@YYY.com>, relay=127.0.0.1[127.0.0.1]:10026, delay=0.22, delays=0.08/0.01/0.$
May  7 08:22:57 SERVER1 postfix/smtpd[29207]: disconnect from localhost[127.0.0.1]
May  7 08:22:57 SERVER1 postfix/qmgr[20340]: 97F172100D: removed
May  7 08:22:57 SERVER1 deliver(XXX@YYY.com): msgid=<B962EC5289404072982C026EAB7C68FA@techoffice1>: saved mail to INBOX
May  7 08:22:57 SERVER1 postfix/pipe[29209]: B8D6721437: to=<XXX@YYY.com>, relay=dovecot, delay=0.17, delays=0.08/0.01/0/0.08, dsn=2.0.0, st$
May  7 08:22:57 SERVER1 postfix/qmgr[20340]: B8D6721437: removed


As far as block lists I get nothing on MXtoolbox but on RBL check I get:
Quote:

dnsbl.mags.net (127.0.0.5) dnsbl.mags.net

However I'm not sure if a single block list would cause it to ping from all the servers (I've tried three) with the same code 5.0.0

Here is the bounced email (produced I guess by postfix?? since its the same for any external server)
Code:

Reporting-MTA: dns; YYYmail.YYY.com
X-Postfix-Queue-ID: 13F0821437
X-Postfix-Sender: rfc822; XXX@YYY.com
Arrival-Date: Fri,  7 May 2010 08:08:50 +1200 (NZST)

Final-Recipient: rfc822; ZZZ@hotmail.com
Original-Recipient: rfc822;ZZZ@hotmail.com
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; smtp.live.com


mrpurple 05-06-2010 10:54 PM

Sorted it After going through an example "corporate config file" I found that the following two lines fixed me right up I dont know which one was the answer but it must have been one or the other

mydestination = $mydomain, $myhostname, localhost.$mydomain
default_transport = smtp

Thanks for watching anyhow hope this helps the next person who had my problem

mrpurple 05-09-2010 03:40 PM

Just to be clear it was the:

default_transport = smtp

line that was the problem
why it was wrong (for me) in the how-to i used and why it doesnt appear in any other how-to ive seen i couldnt tell you.

clutch68rs 03-17-2011 10:30 AM

Thanks!
 
Quote:

Just to be clear it was the:

default_transport = smtp
Thanks for posting this! It worked for me as well.


All times are GMT -5. The time now is 08:08 AM.