Issues sending emails using PostFix Mail Server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Issues sending emails using PostFix Mail Server
# 1  
Old 08-15-2017
Hammer & Screwdriver Issues sending emails using PostFix Mail Server

I'm unable to send email from my Linux server despite SMTP port 25 Active and Listening.

Code:
[root@TechX ~]# hostname
TechX

I checked the mail log ( /var/log/maillog ) and found the below error.

Quote:
Aug 14 21:49:59 TechX postfix/cleanup[2300]: warning: proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf lookup error for "root@TechX.yourdomain.com"
Aug 14 21:49:59 TechX postfix/cleanup[2300]: warning: C05AD6FAF: virtual_alias_maps map lookup problem for root@TechX.yourdomain.com -- deferring delivery
Aug 14 21:49:59 TechX postfix/cleanup[2300]: warning: proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf lookup error for "root@TechX.yourdomain.com"
Aug 14 21:49:59 TechX postfix/cleanup[2300]: warning: C05AD6FAF: recipient_bcc_maps lookup problem
Aug 14 21:50:00 TechX postfix/pickup[2269]: warning: C17AF29807: message has been queued for 87 days
I'm sharing all the ".cf" files seen in the error log.

1.

Code:
[root@TechX ~]# more /etc/postfix/main.cf

# postfix config file

# uncomment for debugging if needed
soft_bounce=yes

# postfix main
mail_owner = postfix
setgid_group = postdrop
delay_warning_time = 4

# postfix paths
html_directory = no
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
queue_directory = /var/spool/postfix
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man

# network settings
inet_interfaces = all
mydomain = yourdomain.com
myhostname = TechX
mynetworks = $config_directory/mynetworks
mydestination = $myhostname, localhost.$mydomain, localhost
relay_domains = proxy:mysql:/etc/postfix/mysql-relay_domains_maps.cf

# mail delivery
recipient_delimiter = +

# mappings
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
transport_maps = hash:/etc/postfix/transport
#local_recipient_maps =

# virtual setup
#virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/postfix/virtual_regexp
virtual_alias_maps = proxy:regexp:/etc/postfix/virtual_regexp
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf
virtual_minimum_uid = 101
virtual_uid_maps = static:101
virtual_gid_maps = static:12
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

# debugging
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
                 xxgdb $daemon_directory/$process_name $process_id & sleep 5

# authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

# tls config
smtp_use_tls = yes
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
# Change mail.example.com.* to your host name
smtpd_tls_key_file = /etc/pki/tls/private/TechX.key
smtpd_tls_cert_file = /etc/pki/tls/certs/TechX.crt
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtpd_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt

# rules restrictions
smtpd_client_restrictions =
smtpd_helo_restrictions =
smtpd_sender_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_rec
ipient_domain
# uncomment for realtime black list checks
# ,reject_rbl_client zen.spamhaus.org
# ,reject_rbl_client bl.spamcop.net
# ,reject_rbl_client dnsbl.sorbs.net
smtpd_helo_required = yes
unknown_local_recipient_reject_code = 550
disable_vrfy_command = yes
smtpd_data_restrictions = reject_unauth_pipelining

# Other options
# email size limit ~20Meg
message_size_limit = 204800000
mailbox_size_limit = 2048000000

# Vacation Scripts
vacation_destination_recipient_limit = 1
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf

2.
Code:
[root@TechX ~]# more /etc/postfix/mysql-virtual_alias_maps.cf
hosts = localhost
user = postfix
password = xxxxxxxxxxx
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND (active = '1' OR active = '3')

3.
Code:
[root@TechX ~]# more /etc/postfix/mysql-virtual_vacation.cf
user = postfix
password = xxxxxxxxxxx
dbname = postfix
table = vacation
select_field = email
where_field = email
additional_conditions = and active = '9'
result_format = %u#%d@autoreply.TechX

Below are my hosts file entries

Code:
[root@TechX ~]# more /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 guest
::1       guest
127.0.0.1 TechX
::1       TechX
127.0.0.1 autoreply.TechX
45.86.72.111 TechX.com
45.86.72.111 jira.TechX.com
45.86.72.111 shop.TechX.com

Can you please suggest what should i do to fix the problem ?

Last edited by mohtashims; 08-15-2017 at 06:53 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sending Mail with Postfix

im able to install postfix on my ubuntu server. no issues. but ican't send mail. i dont know what to put for the "relayhost". i've googled this endlessly but i'm clueless. isn't there a general smart host i can use that'll allow me to send? i dont care for receiving mail. i just want to be... (1 Reply)
Discussion started by: SkySmart
1 Replies

2. UNIX for Dummies Questions & Answers

Issues in sending mail with attachements

Hi I am using the below command to send mail from unix with body as well as attachment. But the attachment is in encoded form in the body itself. I am not receiving as attachment: (cat body_success.txt;uuencode Log.txt Log.txt)| mailx -s "success" $ToID I am receiving... (5 Replies)
Discussion started by: pandeesh
5 Replies

3. UNIX for Dummies Questions & Answers

issues in sending mail

Hi, i am trying the below script for sending mail. if then count=`cat $sfile|wc -l` echo "There are $count abends.Please take care " > body.txt (cat body.txt;uuencode $sfile $sfile) | mailx -s "Alert:there are failures" pandeesh@gmail.com fi In the mail, i am getting like: ... (4 Replies)
Discussion started by: pandeesh
4 Replies

4. Emergency UNIX and Linux Support

Access denied when sending mail - postfix

i have configured mail server with postfix with dovecot with no encryption: When connecting with Thunderbird imap is working fine. when sending email from another domain to this domain again it is fine. but when i want to send mail frommy domain to another it gives me error and this is... (3 Replies)
Discussion started by: majid.merkava
3 Replies

5. UNIX for Advanced & Expert Users

Issues while sending a mail having records fetched from SQL -all in UNIX

hi-I want to write a UNIX Script which will fetch records from Oracle database.I want to store these records in a file under fields like email address,name and the transaction_id and then fetch these records from the file and send the email to individual users with their transaction ID details. (4 Replies)
Discussion started by: DeepSalwan
4 Replies

6. Programming

Mail sending from VFP9 through internal postfix esmtp server.

hi all, please help me in this regard. I am VFP 9 programmer. I want to send the mail from within VFP 9 application. I have used CDO of microsoft which is working fine. however to be able to send the mail i have to setup the router gateway on user machine which enable him to surf through the... (0 Replies)
Discussion started by: choudharidl
0 Replies

7. UNIX for Dummies Questions & Answers

Sending Outgoing Emails from Unix Server

the server i have here is a Ubuntu server. it has nagios on it. after setting up nagios and having it work as it should, i realized at the very end of all my work that obviously nagios will also need to send out email alerts to a set of email addresses that it has in its database. my problem... (1 Reply)
Discussion started by: SkySmart
1 Replies

8. UNIX for Dummies Questions & Answers

Configuring my PostFix Mail Server

Hi folks! I have a Postfix email server running on my MacOs x box. I would like to customize this automatic message to portuguese language: ============ This is the Postfix program at host myserver.com. I'm sorry to have to inform you that the message returned below could not... (4 Replies)
Discussion started by: fundidor
4 Replies
Login or Register to Ask a Question