Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am developing a program in vb.net which needs to connect directly with my mailserver (postfix) to send emails which will be directed towards email to sms transmissions. My mailserver is otherwise working properly and I am not having any problems with it functionally (it sends and receives without problem on squirrelmail). I also attempted a smtp test with http://www.nanogenesis.fr/ and it is reporting the same error, I am thinking this is a problem with my postfix settings. My application is currently running the code (and could easily run authentication also):

        'create the mail message
    Dim mail As New MailMessage()

    'set the addresses
    mail.From = New MailAddress("anemail@domain.tld")
    mail.[To].Add("anotheremail@otherdomain.tld")

    'set the content
    mail.Subject = "Page"
    mail.Body = "this email is to test the paging system"

    'set the server
    Dim smtp As New SmtpClient("fasttrackdispatch.com")
    Dim errmsg As String
    'send the message
    Try
        smtp.Send(mail)
        Console.Write("Your Email has been sent sucessfully - Thank You")

    Catch exc As Exception
        errmsg = "Send failure: " & exc.ToString()
    End Try

on my software side this is appears to be working however the email doesnt send,

the mail.log file states

Jan 22 18:53:54 localhost postfix/smtpd[14954]: connect from unknown[199.1.16.46]
Jan 22 18:53:54 localhost postfix/smtpd[14954]: NOQUEUE: reject: RCPT from unknown[199.1.16.46]: 554 5.7.1 <email@domain.tld>: Relay access denied; from=<email@domain.tld> to=<email@domain.tld> proto=ESMTP helo=<FCRA>
Jan 22 18:53:55 localhost postfix/smtpd[14954]: lost connection after RCPT from unknown[199.1.16.46]
Jan 22 18:53:55 localhost postfix/smtpd[14954]: disconnect from unknown[199.1.16.46]

etc/postfix/main.cf is

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = /usr/share/doc/postfix

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = fasttrackdispatch.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = fasttrackdispatch.com, localhost, localhost.localdomain
relayhost = 
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks       $virtual_mailbox_limit_maps
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings

Any help is appreciated

share|improve this question
add comment

1 Answer 1

I think what's happening is that postfix doesn't know that it's supposed to allow your IP address (199.1.16.46) to relay. This might not be the best solution, but you could change the mynetworks directive in etc/postfix/main.cf to look something like:

mynetworks = 127.0.0.0/8, 199.1.16.46/32

and then restart postfix and see if that makes it behave better.

share|improve this answer
    
This would fix it for my computer however I need to make it functional for any computer running my software –  James Stafford Jan 22 at 20:56
3  
In that case, you need to set up some kind of SMTP authentication in your application in order to prevent becoming an open relay, and you probably want to encrypt the connection to prevent your username/password from being sniffed. I'm not a postfix guru, but there's probably a guide on the Intart00bs. –  Katherine Villyard Jan 22 at 21:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.