LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   postfix with procmail (https://www.linuxquestions.org/questions/linux-server-73/postfix-with-procmail-4175582183/)

vincix 06-13-2016 04:00 PM

postfix with procmail
 
I'm trying to set up an e-mail server, but after installing procmail, I can't get it to work.
This is what I get when I try to send an e-mail within the domain:
Quote:

Jun 13 23:22:43 macroscian postfix/qmgr[21196]: D39BE70F8ED3E: from=<user@mydomain.com>, size=431, nrcpt=1 (queue active)
Jun 13 23:22:59 macroscian procmail[21207]: Couldn't rename bogus "/var/spool/mail/vinci" into "/var/spool/mail/BOGUS.vinci.2o"
Jun 13 23:23:00 macroscian postfix/local[21206]: D39BE70F8ED3E: to=<vinci@macroscian.com>, relay=local, delay=16, delays=0.18/0.04/0/16, dsn=5.2.0, status=bounced (can't create user output file. Command output: procmail: Renaming bogus mailbox "/var/spool/mail/vinci" info "/var/spool/mail/BOGUS.vinci.2o" procmail: Couldn't create "/var/spool/mail/vinci" )
Jun 13 23:23:00 macroscian postfix/cleanup[21204]: 0909370F8ED3F: message-id=<20160613202300.0909370F8ED3F@macroscian.com>
Jun 13 23:23:00 macroscian postfix/bounce[21243]: D39BE70F8ED3E: sender non-delivery notification: 0909370F8ED3F
Jun 13 23:23:00 macroscian postfix/qmgr[21196]: 0909370F8ED3F: from=<>, size=2477, nrcpt=1 (queue active)
Jun 13 23:23:00 macroscian postfix/qmgr[21196]: D39BE70F8ED3E: removed
Jun 13 23:23:00 macroscian postfix/local[21206]: 0909370F8ED3F: to=<quas@macroscian.com>, relay=local, delay=0.01, delays=0/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -a "$EXTENSION")
Jun 13 23:23:00 macroscian postfix/qmgr[21196]: 0909370F8ED3F: removed
This is the output of postconf -n:
Quote:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
disable_vrfy_command = yes
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = /usr/bin/procmail -a "$EXTENSION" "DEFAULT=$HOME/Maildir/" "MAILDIR=$HOME/Maildir/"
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = mail.mydomain.com, localhost, mydomain.com
mynetworks = my_network/24
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_security_level = may
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_non_fqdn_sender, reject_unknown_sender_domain
smtpd_tls_CAfile = /etc/postfix/tls/fullchain.pem
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/postfix/tls/cert.pem
smtpd_tls_key_file = /etc/postfix/tls/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550
under /etc/aliases I also have:
Quote:

root: vinci
Not 100% certain about this one, but in a tutorial I'm reading it says that procmail works only if all root e-mail is redirect to a real user.

frankbell 06-13-2016 09:16 PM

The best tutorial I've found on procmail is this one: http://userpages.umbc.edu/~ian/procmail.html

It's old, but it's well-written and clearly explained and, based on my personal experience, works for my personal use of Mutt for email.

Could you post the beginning of your .procmailrc file, the part up to when the procmail recipes start?

Did you also install formmail? I'm hardly a Linux postmaster, but I know that, in my .procmailrc file, I have to tell it where to find formmail, but I don't know enough to explain how they work together.

vincix 06-14-2016 04:06 AM

I've never heard of formmail, but that's quite irrelevant, given this is the first time I've configured an e-mail server. In the tutorial I'm reading, which is quite comprehensive, it says nothing of formmail. I'm using SpamAssassin which I gather does the same thing? What I'm trying to say is that I'm not really sure that procmail is dependent on formmail :)

vincix 06-14-2016 01:35 PM

For some reason, it started working. I've no idea why. It might be that I have forgotten to restart the services. This could have been one of the problems. So there's no need for formmail. At least this is what I'm inferring now.

Thanks for the answer, anyway.

frankbell 06-14-2016 10:56 PM

Glad it's working and sorry I missed the mark. It was sort of shot in the dark any way.

Could you post a link to the tutorial you were following? Others might find it interesting. I know I would.

Frankly, I'm not that clear on the relationship between formail and procmail, as it's been a while since I first set up Mutt. From what I remember, procmail said where the mail should go and formmail put it there in the correct format. It's not really analogous to Spam Assassin, as it doesn't assassinate anything:). But, as I said, I'm hardly a Linux postmaster.

Formail's man page says

Quote:

formail is a filter that can be used to force mail into mailbox format, perform `From' escaping, generate auto-replying headers, do simple header munging/extracting or split up a mailbox/digest/articles file. The mail/mail-box/article contents will be expected on stdin.
Based on that, formail seems to be more about format than anything else, and, thanks to you, I've learned something new tonight!

vincix 06-15-2016 01:10 AM

Well, it's more of a book than a tutorial, actually.
It's called Pro Linux System Administrator, by James Turnball, Peter Lieverdink and Dennis Matotek. (apress). It's 2009, and I'm implementing it for Centos 7, which means that I have to adapt a few things, but it's not all that bad.


All times are GMT -5. The time now is 04:24 AM.