LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-29-2009, 11:38 AM   #1
lomax0990
LQ Newbie
 
Registered: Jul 2009
Posts: 15

Rep: Reputation: 0
Postfix SMTP Authentication


I'm hoping someone can help me with Postfix/Dovecot SMTP authentication.

When trying to send a test message with a mail client over the internet I get the following error:

Code:
The message could not be sent because one of the recipients was rejected by the server. The rejected e-mail address was username@gmail.com'. Subject 'test', Account: 'mailgw.mydomain.com', Server: 'mailgw.mydomain.com', Protocol: SMTP, Server Response: '554 5.7.1 <username@gmail.com>: Relay access denied', Port: 25, Secure(SSL): No, Server Error: 554, Error Number: 0x800CCC79
The g-mail account is the address I'm sending to. The account i'm sending from has an account on the server and I can successfully download messages using this client. I can also log in to squirrelmail using this account. So I know that dovecot is authenticating it.

Ideally I would like anyone that can authenticate from domain example.com to be able to send mail through my server.

Below are what I think are the relevant portions of my main.cf and dovecot.conf file.

Main.cf
----------
Code:
virtual_mailbox_domains = /etc/postfix/virtual_config/virtual_domains
virtual_mailbox_maps = hash:/etc/postfix/virtual_config/virtual_mailboxes
virtual_mailbox_base = /var/spool/virtual_mail
virtual_minimum_uid = 100
virtual_uid_maps = static:501
virtual_gid_maps = static:501
virtual_alias_maps = hash:/etc/postfix/virtual_config/virtual_aliases

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
broken_sasl_auth_clients = yes
#smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks

Dovecot.conf
----------------
Code:
auth default {
  # Space separated list of wanted authentication mechanisms:
  #   plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
  #   gss-spnego
  # NOTE: See also disable_plaintext_auth setting.
  mechanisms = plain login cram-md5

 passdb passwd-file {
    # File contains a list of usernames, one per line
    args = /etc/postfix/virtual_config/virtual_passwords
    #args = /etc/dovecot.deny
    #deny = yes
   }

  userdb passwd {
  }
  userdb static {
        args = uid=501 gid=501 home=/var/spool/virtual_mail/%d/%n
        }

socket listen {
    #master {
      # Master socket provides access to userdb information. It's typically
      # used to give Dovecot's local delivery agent access to userdb so it
      # can find mailbox locations.
      #path = /var/run/dovecot/auth-master
      #mode = 0600
      # Default user/group is the one who started dovecot-auth (root)
      #user =
      #group =
    #}
    client {
      # The client socket is generally safe to export to everyone. Typical use
      # is to export it to your SMTP server so it can do SMTP AUTH lookups
      # using it.
      #path = /var/run/dovecot/auth-client
      path = /var/spool/postfix/private/auth
      mode = 0660
      user = postfix
      group = postfix
    }
 }
}
Any help is much appreciated. This server hosts e-mail for multiple domains and it's done with virtual users.
 
Old 10-30-2009, 12:23 PM   #2
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
In my main.cf, I have these lines:

Code:
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks
I'd have to re-read the differences beween smtpd_sender vs smtpd_recipient restrictions again so all I can say is "works for me" ... I don't have any smtpd_sender_restrictions in my config these days. Everything is under recipient_restrictions.

Ciao,
- Arch
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SMTP authentication in postfix aravind1024004 Linux - Server 12 09-04-2010 09:32 AM
postfix smtp authentication hariiyer Linux - Server 4 09-14-2009 02:30 AM
postfix smtp authentication problem ssilayaraja Linux - Server 0 08-07-2009 06:39 AM
Postfix SMTP Authentication lasantha Linux - Server 0 10-26-2007 01:06 PM
Postfix smtp authentication help dt23 Mandriva 1 09-28-2004 08:32 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration