Sample Header Ad - 728x90

Configuring postfix in local machine in order to send mails

0 votes
1 answer
3557 views
I am trying to automate a procedure and when a certain condition is met I would like to notify the user with an automated mail using the **mail** command. The thing is, that the messages are not being send and as far as I understood there are some configurations that have to be made first. The thing is that when I go with
sudo dpkg-reconfigure postfix
in order to modify it I am not completely sure about what to fill there. - 1 - The first page asks for System mail name - 2 - The second one asks for root and postmaster mail recipients - 3 - Other destinations to accept mail - 4 - Force synchronous mail queue Y/N - 5 - Local networks (this was pre-filled) - 6 - Mailbox size - 7 - Local address extension character - 8 - Protocols (ipv6, ipv4)
# I selected them both
But I really need help with 1,2,3,5,7 because when i try to send a test mail I do not receive anything Thank you in advance Update: ### OS info
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
### Postfix version
mail_version = 3.4.10
### postconf
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 100
mydestination = aoos.homenet.telecomitalia.it, aoos, localhost.localdomain, , localhost
myhostname = aoos.homenet.telecomitalia.it
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter =
relayhost =
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level = may
### mailq
-Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
DD866CE073F*    2566 Sun May 10 18:17:10  MAILER-DAEMON
                                         broxigar@aoos

DA34ECE0693*    2493 Fri May 15 19:08:58  MAILER-DAEMON
                                         broxigar@aoos

D474DCE0692*    2531 Fri May 15 19:08:58  MAILER-DAEMON
                                         broxigar@aoos

CFCC4CE0690*    2491 Fri May 15 19:08:58  MAILER-DAEMON
                                         broxigar@aoos

0DC1FCE0738*    2398 Sun May 10 18:05:51  MAILER-DAEMON
                                         broxigar@aoos

D06F9CE0691*    2497 Fri May 15 19:08:58  MAILER-DAEMON
                                         broxigar@aoos

3534ECE068E      417 Fri May 15 17:01:06  broxigar@aoos
(host mx..it[130.192.182.65] said: 452 4.5.2 Could not resolve sender domain. (in reply to MAIL FROM command))
                                         userXXX@.it
## After Edit (postconf -n)
# 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 = no

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

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html  -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtp_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt

#smtp_tls_CApath=/etc/ssl/certs
#smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
#smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
#smtp_sasl_auth_enable = yes
#smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
#smtp_sasl_security_options = noanonymous
#smtp_tls_security_level = encrypt
#smtp_tls_wrappermode = yes


smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = aoos.polito.it
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, aoos.polito.it, localhost.polito.it, localhost

#myorigin = $mydomain 
relayhost = [mail.polito.it]:465
#relay_domains = $mydestination
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
## After Edit (mailq)
-Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
64428CE10EA*    2334 Fri Jun 19 22:55:27  MAILER-DAEMON
                                         broxigar@aoos
## After Edit (journalctl -xe)
Jun 19 22:55:29 aoos postfix/smtp: 64428CE10EA: to=, relay=server.domain.it[]:465, delay=2, delays=0.01/0/0.03/2, dsn=5.0.0, status=bounced (host server.domain.it[] said: 551 broxigar@aoos failed to route the address (in reply to RCPT TO command))
Asked by ex1led (286 rep)
May 10, 2020, 04:24 PM
Last activity: Jul 2, 2025, 12:03 AM