0

I successfully setup SMTP-only using the guide provided by DigitalOcean. However, this time I wanted to set it up in a subdomain. Consider this domain that I have: `http://v1.product.staging.veil-soft.com.

With the same guide I used I can't make the email working.

Here are my config:

main.cfg file:

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

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

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = veil-soft.com
smtp_generic_maps = hash:/etc/postfix/generic
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = veil-soft.com, localhost.localdomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all

/etc/aliases file:

# See man 5 aliases for format
postmaster:    root
root:          eng@veil-soft.com

/etc/postfix/generic file:

root@v1.product.staging.veil-soft.com noreply@veil-soft.com

/etc/mailname file:

veil-soft.com

Tried to send using the mail command:

echo "This is the body of the email" | mail -s "Testing" web@veil-soft.com

And the mail.log produces this:

Aug 11 19:57:54 hostname postfix/pickup[8245]: AA598101F08: uid=0 from=<root@veil-soft.com>
Aug 11 19:57:54 hostname postfix/cleanup[8548]: AA598101F08: message-id=<20160811235754.AA598101F08@veil-soft.com>
Aug 11 19:57:54 hostname postfix/qmgr[30043]: AA598101F08: from=<root@veil-soft.com>, size=358, nrcpt=1 (queue active)
Aug 11 19:57:54 hostname postfix/local[8553]: AA598101F08: to=<web@veil-soft.com>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Aug 11 19:57:54 hostname postfix/qmgr[30043]: AA598101F08: removed
Aug 11 20:00:01 hostname postfix/local[8596]: 7B19E101F15: to=<eng@veil-soft.com>, orig_to=<root@veil-soft.com>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "eng")
Aug 11 20:00:01 hostname postfix/qmgr[30043]: 7B19E101F15: removed
Aug 11 20:00:01 hostname postfix/local[8597]: 7C8F7101F08: to=<eng@veil-soft.com>, orig_to=<root@veil-soft.com>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "eng")
Aug 11 20:00:01 hostname postfix/qmgr[30043]: 7C8F7101F08: removed
  • Does "engineering" exist? – Ryan Babchishin Aug 12 '16 at 2:28
  • Is it correct to list the users under /var/mail/? If yes engineering is not there. – Gulok Aug 12 '16 at 2:33
  • Unless you're using some kind of imap server or whatever, I believe you'll need to create a local user called engineering for that to work. Correct me if I'm wrong. – Ryan Babchishin Aug 12 '16 at 2:37
  • Updated my question with correct domain. – Gulok Aug 12 '16 at 3:32
1

Unless you're using some kind of imap server or whatever, I believe you'll need to create a local user called engineering for that to work. Correct me if I'm wrong.

This line worked:

Aug 11 19:57:54 hostname postfix/local[8553]: AA598101F08: to=<name@domain.com>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox).` 

Is name a local user? Setup engineering the same way.

  • Update to original answer

Based on the revised edit by the OP and comments below, the following changes need to be made to the postfix configuration

The problem appears to be that the server was intended to relay mail to another SMTP server for the vielsoft.com domain, but was attempting local delivery instead because of misconfiguration.

/etc/postfix/main.cf

mydestination = v1.product.staging.vielsoft.com

myhostname = v1.product.staging.vielsoft.com

/etc/mailname

v1.product.staging.vielsoft.com

| improve this answer | |
  • Hi I am sending an email to gerald@domain.com. This user does not exist in the server in question. Which I believe it should not. What if I want to send an email to a gmail email? – Gulok Aug 12 '16 at 2:43
  • But the above line didnt deliver the email to my mailbox. Am I missing something? – Gulok Aug 12 '16 at 2:44
  • @Gulok That line says it did deliver the message, on the local server. So I'm guessing /var/spool/mail/user. Your main.cf says mydestination=domain.com so you will receive mail for that domain and not relay it. – Ryan Babchishin Aug 12 '16 at 2:53
  • @Gulok It says relay=local so it's attempting to deliver mail locally, not relay it to another server as you'd expect if it were going to gmail... can you please use proper domain names in your examples and logs? I feel the info is inaccurate. If a message is going to gmail it will show something like relay=alt4.gmail-smtp-in.l.google.com – Ryan Babchishin Aug 12 '16 at 2:56
  • Sure I will update the question. Sorry for that. – Gulok Aug 12 '16 at 3:21

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.