Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postfix - relay outbound via ISP SMTP server w/AUTH [SOLVED]
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
brainspank
n00b
n00b


Joined: 21 Jan 2005
Posts: 8
Location: St. Louis, MO

PostPosted: Tue Apr 25, 2006 6:50 pm    Post subject: postfix - relay outbound via ISP SMTP server w/AUTH [SOLVED] Reply with quote

I searched the forums, but none of the answers for others solved my problem.

I'm running a postfix server and am sending directly to destination MX hosts. I've run into issues with hosts denying my mail, so I'd like to relay through my ISP and the ISP requires login.

I got the HOST/ID/PASS from my ISP. I can send using this information directly via Thunderbird, but getting postfix to do it is resulting in "relaying denied" messages. From this info, I believe postfix is just not auth'ing the ISP SMTP server.

I've followed several guides on this forum and the internet, and all declare the same solution. However, it does not work for me. I'm lost and would appreciate some help in debugging or solutions.

# postconf -n
Code:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
body_checks = pcre:/etc/postfix/pcre-body.cf
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[localhost]:10024
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
debug_peer_list = 127.0.0.1, smtp.lbdsl.net, smtp.txlink.net
default_destination_concurrency_limit = 2
disable_vrfy_command = yes
header_checks = pcre:/etc/postfix/pcre-header.cf
home_mailbox = .maildir/
html_directory = no
inet_interfaces = all
local_destination_concurrency_limit = 2
local_recipient_maps = unix:passwd.byname $alias_maps
mail_owner = postfix
mailbox_command = /usr/bin/procmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, webmail.$mydomain, etc...
myhostname = mail.<host>.net
mynetworks = 127.0.0.0/8 192.168.1.0/24 <extern IP>
mynetworks_style = subnet
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.1.5-r1/readme
relayhost = [smtp.lbdsl.net]
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks,    reject_unauth_destination,    reject_invalid_hostname,    reject_unauth_pipelining,    reject_non_fqdn_sender,    reject_unknown_sender_domain,    reject_non_fqdn_recipient,    reject_unknown_recipient_domain,    check_recipient_access hash:/etc/postfix/access_recipient,    reject_rbl_client relays.ordb.org,    reject_rbl_client sbl.spamhaus.org,    permit
unknown_local_recipient_reject_code = 550
virtual_alias_domains = <domains>
virtual_alias_maps = hash:/etc/postfix/virtual


# egrep -v '^#' master.cf
Code:

smtp      inet  n       -       n       -       -       smtpd
pickup    fifo  n       -       n       60      1       pickup
        -o content_filter=
        -o receive_override_options=no_header_body_checks
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
old-cyrus unix  -       n       n       -       -       pipe
  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
cyrus     unix  -       n       n       -       -       pipe
  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
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=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient


smtp-amavis     unix    -       -       n       -       2       smtp
   -o smtp_data_done_timeout=1200
   -o disable_dns_lookups=yes

127.0.0.1:10025 inet    n       -       n       -       -       smtpd
   -o content_filter=
   -o local_recipient_maps=
   -o relay_recipient_maps=
   -o smtpd_restriction_classes=
   -o smtpd_helo_restrictions=
   -o smtpd_sender_restrictions=
   -o smtpd_recipient_restrictions=permit_mynetworks,reject
   -o mynetworks=127.0.0.0/8
   -o strict_rfc821_envelopes=yes


# cat /etc/postfix/sasl_passwd
Code:

<host> <id>:<pass>


I'm using:
postfix 2.2.5
cyrus-sasl 2.1.21-r2
amavis

thanks for any help you can provide.

- bs


Last edited by brainspank on Wed Apr 26, 2006 3:38 am; edited 1 time in total
Back to top
View user's profile Send private message
langthang
Retired Dev
Retired Dev


Joined: 27 Nov 2003
Posts: 620

PostPosted: Tue Apr 25, 2006 9:23 pm    Post subject: Reply with quote

your /etc/postfix/sasl_passwd is in the format as:
Code:
[smtp.lbdsl.net] <id>:<pass>

note [] around smtp.lbdsl.net
_________________
Gentoo users' map
Back to top
View user's profile Send private message
brainspank
n00b
n00b


Joined: 21 Jan 2005
Posts: 8
Location: St. Louis, MO

PostPosted: Wed Apr 26, 2006 12:43 am    Post subject: Reply with quote

langthang wrote:
your /etc/postfix/sasl_passwd is in the format as:
Code:
[smtp.lbdsl.net] <id>:<pass>

note [] around smtp.lbdsl.net


yes, I found that syntax in the docs from postfix. the "[ ]" is supposed to mean that it won't check for MX records. I originally tried using this entry without the "[ ]", but since that didn't work either...

here's where I got the syntax:
http://www.postfix.org/postconf.5.html#relayhost
Back to top
View user's profile Send private message
langthang
Retired Dev
Retired Dev


Joined: 27 Nov 2003
Posts: 620

PostPosted: Wed Apr 26, 2006 2:12 am    Post subject: Reply with quote

edit you master.cf, locate the smtp line and put a -v so it read:
Code:
smtp      unix  -       -       n       -       -       smtp -v

send an email and watch your mail log for clue.
_________________
Gentoo users' map
Back to top
View user's profile Send private message
brainspank
n00b
n00b


Joined: 21 Jan 2005
Posts: 8
Location: St. Louis, MO

PostPosted: Wed Apr 26, 2006 3:37 am    Post subject: Reply with quote

langthang wrote:
edit you master.cf, locate the smtp line and put a -v so it read:
Code:
smtp      unix  -       -       n       -       -       smtp -v

send an email and watch your mail log for clue.


Sweet!

thanks, langthang. I didn't know how to do that before. From watching the verbose logs, I discovered that the SMTP server was actually an alias (my bad for not noticing earlier). The ISP's FAQ didn't take into account people running a mail server. I put the real host in the sasl_passwd file and postmap'd it, and everthing worked!

As a side note, my master.cf smtp line actually references "smtpd" instead of "smtp" as the command (last arg).

ie.
Code:

smtp      inet  n       -       n       -       -       smtpd


I don't care too much because it works, but it's odd. It came that way from the package, so I'm not going to worry about it.

thanks again. Yet another fast turnaround from the Gentoo forums - I love 'em!

- bs
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