How To Send Email From the Command Line on MacOSX 10.10.5 Yosemite

Author: , January 29th, 2017

I wanted to send email from cron for various reasons, but the emails would bounce with an error 554: 554 5.1.8 : Sender address rejected: Domain not found Clearly, Postfix was using the “internal” hostname of myappledesktop.local (MacOSX has TWO hostnames! also, myappledesktop.local is not the real hostname ;-). So, I needed two things: 1. […]

How To Block an Entire TLD in Postfix

Author: , September 13th, 2016

Step 1. Execute the following two commands: postconf -e smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains postconf -e reject_unauth_destinations=pcre:/etc/postfix/rejected_domains If that doesn’t work, you may hand-edit and add/edit these lines: 1 2 smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains reject_unauth_destinations=pcre:/etc/postfix/rejected_domains smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains reject_unauth_destinations=pcre:/etc/postfix/rejected_domains Step 2. Create the regex filter file: vim /etc/postfix/rejected_domains 1 2 /\.top$/           REJECT No spam allowed from the .top […]

How To Fix a “Corrupted index cache file” Error in Dovecot

Author: , June 17th, 2016

Jun 17 00:02:45 inbound dovecot: IMAP(yourName): Corrupted index cache file /home/yourName/Maildir/dovecot.index.cache: invalid record size service dovecot stop cd /home/yourName/Maildir/ rm dovecot.index* service dovecot start As always, YMMV. Proceed with caution.

How To Modify the Maximum Allowed Attachment Size in Postfix

Author: , April 22nd, 2015

By default, Postfix restricts attachment size to about 10MB (10240000 bytes). You can check the current value by running the following command: postconf | grep message_size_limit To change the attachment size limit to say 50 MB, run a command like: postconf -e message_size_limit=52428800 You may find that the maximum mailbox size is lower than the […]

How To Use Regular Expressions (regex) To Forward Email In Postfix

Author: , April 7th, 2015

Create the file /etc/postfix/virtual-regexp. For example, forward all emails with a leading eric and ending with to a Gmail account: 1 /eric.*/ /eric.*/ Edit the file /etc/postfix/ Add regexp:/etc/postfix/virtual-regexp to the virtual_alias_maps line. For example: 1 virtual_alias_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regexp virtual_alias_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regexp Generate the map .db file: 1 […]

How To Empty the Email Queue in Postfix

Author: , July 11th, 2013

postsuper -d ALL

How To Update the Postfix Virtual Table

Author: , May 18th, 2013

1 2 3 vim /etc/postfix/virtual /usr/sbin/postmap /etc/postfix/virtual /usr/sbin/postfix reload vim /etc/postfix/virtual /usr/sbin/postmap /etc/postfix/virtual /usr/sbin/postfix reload

How To Delete a Single Deferred Email in Postfix

Author: , January 6th, 2013

To view the Postfix deferred queue: postqueue -p To view a specific email: postcat -q {Queue ID} To delete a specific email: postsuper -d {Queue ID} Example of viewing the deferred queue and deleting a message: # postqueue -p -Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——- E15B9FC221 11627 Sun Jan 6 16:47:29 MAILER-DAEMON (connect to[]: […]

How To Use Sender-Based Routing In Postfix With AWS SES

Author: , November 6th, 2011

NOTE: This procedure requires Postfix version 2.7 or greater! Create or edit the following three files: /etc/postfix/ 1 sender_dependent_default_transport_maps = hash:/etc/postfix/sender_dependent_default_transport_maps sender_dependent_default_transport_maps = hash:/etc/postfix/sender_dependent_default_transport_maps /etc/postfix/ 1 2 aws-email unix  -       n       n       –       –       pipe  flags=R user=mail argv=/opt/aws/bin/ -r -k […]

How To Upgrade Postfix On CentOS / AWS Linux

Author: , November 6th, 2011

YMMV… 1 2 3 4 5 6 # postconf -d | grep ^mail_version # yum install db4-devel openssl-devel cyrus-sasl cyrus-sasl-devel pcre pcre-devel openldap openldap-devel # cd # wget <a href="" class="broken_link"></a> # tar xvzf postfix-2.8.4.tar.gz # cd postfix-2.8.4 # postconf -d | grep ^mail_version # yum install db4-devel openssl-devel cyrus-sasl cyrus-sasl-devel pcre pcre-devel openldap openldap-devel […]