0

I'm trying to setup postfix on a new vps I just got and this is the first time doing any kind of email setup. I am getting an error when trying to perform a test email. I posted my config and error and I'm wondering if I made a mistake somewhere? I'm running a Ubuntu 12.04 LTS VPS.

Getting error:

mail from:<jhvisser>
250 2.1.0 <jhvisser>... Sender ok
rcpt to:<jhvisser>
553 5.5.4 <jhvisser>... Domain name required for sender address jhvisser

With config:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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

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

# Uncomment the next line to geneAug 23 10:15:36 jhvisser sm-mta[15093]: r7NEExQ1015093: from=<jhvisser@jhvisser.com>, size=5, class=0, nrcpts=1, proto=SMTP, daemon=MTA-v4, relay=localhost.localdomain [127.0.0.1]

Aug 23 10:15:36 jhvisser sm-mta[15093]: r7NEExQ1015093: from=, size=5, class=0, nrcpts=1, proto=SMTP, daemon=MTA-v4, relay=localhost.localdomain [127.0.0.1] rate "delayed mail" warnings #delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/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 = jhvisser.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = jhvisser.com
mydestination = jhvisser.com, localhost.com, , localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = 
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
smtpd_sasl_local_domain = 
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

New Error:

helo localhost
250 jhvisser.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
mail from:<jhvisser@jhvisser.com>
250 2.1.0 <jhvisser@jhvisser.com>... Sender ok
rcpt to:<jhvisser@jhvisser.com>
250 2.1.5 <jhvisser@jhvisser.com>... Recipient ok
data
354 Enter mail, end with "." on a line by itself
test
.
421 4.3.0 collect: Cannot write ./dfr7NDpBPF014521 (bfcommit, uid=0, gid=112): No such file or directory
Connection closed by foreign host.

Log:

Aug 23 10:15:36 jhvisser sm-mta[15093]: r7NEExQ1015093: from=<jhvisser@jhvisser.com>, size=5, class=0, nrcpts=1, proto=SMTP, daemon=MTA-v4, relay=localhost.localdomain [127.0.0.1]
  • sm-mta it seems sendmail instead of postfix. Are you sure that you are using postfix? – ALex_hha Aug 23 '13 at 15:34
  • @ALex_hha I followed this tutorial: help.ubuntu.com/community/Postfix . Should be postfix? – ComputerLocus Aug 23 '13 at 18:09
  • Should be, but "Hello localhost.localdomain [127.0.0.1], pleased to meet you" it's not typical postfix greetings. I will suggest to stop postfix and run # netstat -lanp | grep 25 or # lsof -i tcp:25 to see who exactly are listening on the port – ALex_hha Aug 23 '13 at 19:01
  • @ALex_hha Is there a good tutorial you know of to setup email on a Ubuntu server or a easier software? I essentially just want to be able to use SMTP so I can send and receive emails using Gmail. – ComputerLocus Aug 24 '13 at 1:29
2

postconf -n | grep reject and see the parameter "smtpd_sender_restrictions" : check if there is "reject_non_fqdn_sender".

in fact, you should use "jhvisser@jhvisser.com" as sender adress because the destination user can't respond to you if there is a problem.

  • I did what you said and changed both the to and from to use that in my tests and now they are okay but I have a new problem. Check my edit to see the new problem – ComputerLocus Aug 23 '13 at 13:53
  • Strange ! Check the logs : there is maybe a problem with your spool dir. – Dom Aug 23 '13 at 14:07
  • Logs added to OP. – ComputerLocus Aug 23 '13 at 14:16
  • sm-mta in the logs ?? it is sendmail not postfix. Check if you are running postfix like Alex_hha said, please – Dom Aug 24 '13 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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