You are not logged in.

#1 2017-08-28 19:21:12

bricem13
Member
Registered: 2011-02-02
Posts: 39

[solved] Postfix for local mail

Hello


I got a new computer and wanted to set up mail for local delivery (mainly for system jobs info to root redirected to my user). I did it on one of my previous computer (long ago) but can't get it to work now (I fear my geek time is gone:). At that time I used Maildir with procmail (next thing to get working back).

I appreciate that this topic might be boring but I follwed the wiki and could although not get it.

Few infos:

[brice@TuxBox:~]$ cat /etc/hostname 
TuxBox
[brice@TuxBox:~]$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>	<hostname.domain.org>	<hostname>
127.0.0.1	localhost.localdomain	localhost
::1		localhost.localdomain	localhost
127.0.1.1	TuxBox.localdomain	TuxBox

# End of file
[brice@TuxBox:~]$

Postfix aliases: root to brice

Postfix configuration:

[brice@TuxBox:~]$ sudo postconf -n
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/bin
compatibility_level = 2
daemon_directory = /usr/lib/postfix/bin
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
default_transport = error: outside mail is not deliverable
home_mailbox = Maildir/
html_directory = no
inet_interfaces = $myhostname, localhost.$mydomain, localhost
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = localdomain
myhostname = localhost
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
unknown_local_recipient_reject_code = 550
[brice@TuxBox:~]$ 

Then the test:

[brice@TuxBox:~]$ su
Password: 
[root@TuxBox brice]# nc servername 25
Error: Couldn't resolve host "servername"
[root@TuxBox brice]# telnet 25
Trying 0.0.0.25...
telnet: Unable to connect to remote host: Invalid argument
[root@TuxBox brice]# telnet localhost 25
Trying ::1...
Connection failed: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 localhost ESMTP Postfix
quit
221 2.0.0 Bye
Connection closed by foreign host.
[root@TuxBox brice]# 

any help is welcome smile

thanks
Brice

Last edited by bricem13 (2017-08-30 18:49:33)

Offline

#2 2017-08-28 19:35:22

bricem13
Member
Registered: 2011-02-02
Posts: 39

Re: [solved] Postfix for local mail

hummm

[brice@TuxBox:~]$ ls Maildir/
cur  new  tmp
[brice@TuxBox:~]$ ls Maildir/new/
1503696269.V807I444850M25992.TuxBox  1503947218.V807I445098M512085.TuxBox
[brice@TuxBox:~]$ 

old stuff:

[brice@TuxBox:~]$ cat .procmailrc 
# Beginning of the configuration

# do not log too much
VERBOSE=off

# directory with the mailboxes
MAILDIR=$HOME/Mail/`date +"%Y"`

# procmail log file
LOGFILE=$HOME/Mail/procmail.log

# where the fvwm script is
fvwm_scripts=$HOME/.fvwm/scripts/
PATH=$PATH:$fvwm_scripts

# End of the configuration

##############################
# It delivers at the Maildir format!
# For that: add a slash (/) to indicate a directory
# where to store the mails, otherwise mbox is used!
##############################

# Beginning of the sorting

# Add a header containing the number of lines of each mail
# if the mail misses one because mutt can count them unless
# using the mbox format, nevertheless the size of the message

so I do not use fvwm anymore. No folder inbox_2017 has been created in ~/Mail:

[brice@TuxBox:~]$ ls Mail
2005  2006  2007  2008  2009  2010  2011  2013  2017  list.sh  procmail.log
[brice@TuxBox:~]$ ls Mail/2017/
sent_2017
[brice@TuxBox:~]$ 

BR

Offline

#3 2017-08-29 19:15:20

bricem13
Member
Registered: 2011-02-02
Posts: 39

Re: [solved] Postfix for local mail

help!!!

I set up a googlemail account only to use for linux. Fetchmail gets the emails and delivers them to postfix.

althougth postfix is set to maildir, it does deliver to /var/spool/mail/brice (single file).

I'm stopped at this point...

Offline

#4 2017-08-29 19:17:02

bricem13
Member
Registered: 2011-02-02
Posts: 39

Re: [solved] Postfix for local mail

if I do:

[brice@TuxBox:~]$ echo "Test" | mail -s "Test : local mail delivery" "brice"
[brice@TuxBox:~]$ 

the file /var/spool/mail/brice inflates...

Offline

#5 2017-08-29 20:01:40

bricem13
Member
Registered: 2011-02-02
Posts: 39

Re: [solved] Postfix for local mail

Aug 29 21:48:28 TuxBox postfix/pickup[7512]: A53E51C1342: uid=1000 from=<brice>
Aug 29 21:48:28 TuxBox postfix/cleanup[7743]: A53E51C1342: message-id=<20170829194828.A53E51C1342@localhost>
Aug 29 21:48:28 TuxBox postfix/qmgr[7408]: A53E51C1342: from=<brice@localdomain>, size=319, nrcpt=1 (queue active)
Aug 29 21:48:28 TuxBox procmail[7749]: Suspicious rcfile "/home/brice/.procmailrc"
Aug 29 21:48:28 TuxBox postfix/local[7748]: A53E51C1342: to=<brice@localdomain>, orig_to=<brice>, relay=local, delay=0.25, delays=0.18/0.03/0/0.04, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -a "$EXTENSION")
Aug 29 21:48:28 TuxBox postfix/qmgr[7408]: A53E51C1342: removed
Aug 29 21:59:37 TuxBox postfix/pickup[7512]: 514661C134D: uid=1000 from=<brice>
Aug 29 21:59:37 TuxBox postfix/cleanup[7910]: 514661C134D: message-id=<20170829195937.514661C134D@localhost>
Aug 29 21:59:37 TuxBox postfix/qmgr[7408]: 514661C134D: from=<brice@localdomain>, size=319, nrcpt=1 (queue active)
Aug 29 21:59:37 TuxBox procmail[7916]: Suspicious rcfile "/home/brice/.procmailrc"
Aug 29 21:59:37 TuxBox postfix/local[7915]: 514661C134D: to=<brice@localdomain>, orig_to=<brice>, relay=local, delay=0.48, delays=0.42/0.02/0/0.05, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -a "$EXTENSION")
Aug 29 21:59:37 TuxBox postfix/qmgr[7408]: 514661C134D: removed

Offline

#6 2017-08-29 20:12:25

bricem13
Member
Registered: 2011-02-02
Posts: 39

Re: [solved] Postfix for local mail

it seems fixed now with:

[brice@TuxBox:~]$ chmod 700 .procmailrc

Offline

#7 2017-08-29 23:38:32

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [solved] Postfix for local mail

Good on you for solving it yourself. For the future, avoid needless bumping. Use the edit button instead of rapid fire posting. Since the thread is solved, please mark it as such. Thanks.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB