postfix disable bounce for transport - postfix-mta

I have postfix with different transport. For one of these transports I want to disable message bounce.
master.cf
smtp inet n - n - - smtpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o smtp_fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
dovecot unix - n n - - pipe
flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -d $(recipient)
emailtransport unix - n n - - pipe
flags=X user=transpostfix argv=/media/raid1m/mailparse/emailtransport.php
#****** other options ************
other2emailtransport unix - n n - - pipe
flags=X user=other2transpostfix argv=/media/raid1m/mailparse/other2emailtransport.php
log output:
Mar 26 15:35:14 machin1 postfix/smtpd[12110]: connect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/smtpd[12125]: connect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/pipe[3893]: 0738C180997: to=<transpostfix#localhost.localhost>, orig_to=<zauri.t#ass.exemple.com.domain>, relay=emailtransport, delay=0.5, delays=0.07/0/0/0.42, dsn=2.0.0, status=sent (delivered via emailtransport service)
Mar 26 15:35:14 machin1 postfix/qmgr[12106]: 0738C180997: removed
Mar 26 15:35:14 machin1 postfix/smtpd[12110]: setting up TLS connection from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/smtpd[12125]: CC0FF180996: client=client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/smtpd[21657]: disconnect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/smtpd[12110]: Anonymous TLS connection established from client=68.ip-11-11-10.eu[11.12.13.14]: TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)
Mar 26 15:35:15 machin1 postfix/smtpd[12224]: 1662E180997: client=client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:15 machin1 postfix/cleanup[20853]: CC0FF180996: message-id=<a779c13adb0ff35fc576b6a9a3a779c7#async.clubggff.com>
Mar 26 15:35:15 machin1 postfix/qmgr[12106]: CC0FF180996: from=<notification+kjdkjivh3i_d#example-mail.com>, size=16051, nrcpt=1 (queue active)
Mar 26 15:35:15 machin1 postfix/smtpd[12110]: 6873F180998: client=client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:15 machin1 postfix/cleanup[21196]: 1662E180997: message-id=<cb01d448de2987547cd69fcab1e92f92#async.clubggff.com>
Mar 26 15:35:15 machin1 postfix/pipe[6928]: CC0FF180996: to=<transpostfix#localhost.localhost>, orig_to=<s01064154705#add3000.exemple.com.domain>, relay=emailtransport, delay=0.97, delays=0.55/0/0/0.42, dsn=2.0.0, status=sent (delivered via emailtransport service)
Mar 26 15:35:15 machin1 postfix/qmgr[12106]: CC0FF180996: removed
Mar 26 15:35:15 machin1 postfix/cleanup[21201]: 6873F180998: message-id=<1729890133889801-1540059429539540#groups.clubggff.com>
Mar 26 15:35:15 machin1 postfix/qmgr[12106]: 1662E180997: from=<notification+kjdkj5wd1k3_#example-mail.com>, size=18421, nrcpt=1 (queue active)
Mar 26 15:35:15 machin1 postfix/qmgr[12106]: 6873F180998: from=<notification+kjdkpj3hdv5d#example-mail.com>, size=24947, nrcpt=1 (queue active)
Mar 26 15:35:16 machin1 postfix/pipe[6941]: 1662E180997: to=<transpostfix#localhost.localhost>, orig_to=<margaretgarza#add3000.exemple.com.domain>, relay=emailtransport, delay=1.4, delays=0.95/0/0/0.41, dsn=2.0.0, status=sent (delivered via emailtransport service)
Mar 26 15:35:16 machin1 postfix/qmgr[12106]: 1662E180997: removed
Mar 26 15:35:16 machin1 postfix/smtpd[12154]: NOQUEUE: reject: RCPT from client=68.ip-11-11-10.eu[11.12.13.14]: 504 5.5.2 <164.132.109.68>: Helo command rejected: need fully-qualified hostname; from=<mbeuwen#sfilc.com> to=<t120304677#yahoo.com.tw> proto=SMTP helo=<164.132.109.68>
Mar 26 15:35:16 machin1 postfix/smtpd[12130]: disconnect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:16 machin1 postfix/smtpd[12157]: connect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:16 machin1 postfix/pipe[6938]: 6873F180998: to=<transpostfix#localhost.localhost>, orig_to=<fgbdfscxw#my-dom.exemple.com.domain>, relay=emailtransport, delay=1, delays=0.58/0/0/0.47, dsn=5.3.0, status=bounced (Command died with status 255: "/media/raid1m/mailparse/emailtransport.php")
Mar 26 15:35:16 machin1 postfix/cleanup[22236]: 4FFE918099A: message-id=<20160326133516.4FFE918099A#1.444.exemple.com.domain>
Mar 26 15:35:16 machin1 postfix/bounce[10936]: 6873F180998: sender non-delivery notification: 4FFE918099A
Mar 26 15:35:16 machin1 postfix/qmgr[12106]: 4FFE918099A: from=<>, size=27004, nrcpt=1 (queue active)
Mar 26 15:35:16 machin1 postfix/qmgr[12106]: 6873F180998: removed
Mar 26 15:35:16 machin1 postfix/error[10938]: 4FFE918099A: to=<notification+kjdkpj3hdv5d#example-mail.com>, relay=none, delay=0.03, delays=0.01/0.01/0/0.01, dsn=4.3.5, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=delete-lev.exemple.com.domain type=A: Host not found)
I need disable bounce for emailtransport. Some time emailtransport.php give a mistake, but it's exactly does the job I want.
How to turn off any that bounce message to emailtransport and so that it did not affect the work or other transports such as other2emailtransport
I don't need this:
Mar 26 15:35:16 machin1 postfix/pipe[6938]: 6873F180998: to=<transpostfix#localhost.localhost>, orig_to=<fgbdfscxw#my-dom.exemple.com.domain>, relay=emailtransport, delay=1, delays=0.58/0/0/0.47, dsn=5.3.0, status=bounced (Command died with status 255: "/media/raid1m/mailparse/emailtransport.php")
Mar 26 15:35:16 machin1 postfix/cleanup[22236]: 4FFE918099A: message-id=<20160326133516.4FFE918099A#1.444.exemple.com.domain>
Mar 26 15:35:16 machin1 postfix/bounce[10936]: 6873F180998: sender non-delivery notification: 4FFE918099A
After Command died with status 255 I need delete message 6873F180998. And don't send bound message 4FFE918099A.

I solved my problem but it does not quite answer my question.
In the documentation is written: http://www.postfix.org/pipe.8.html
DIAGNOSTICS
Command exit status codes are expected to follow the conventions
defined in <sysexits.h>. Exit status 0 means normal successful comple-
tion.
In the case of a non-zero exit status, a limited amount of command out-
put is logged, and reported in a delivery status notification. When
the output begins with a 4.X.X or 5.X.X enhanced status code, the sta-
tus code takes precedence over the non-zero exit status (Postfix ver-
sion 2.3 and later).
This means I need to have my PHP script gave out EXIT(0); I turned on the reporting of errors ini_set('error_reporting', -1); and found a problem in script. when I repaired this script error disappeared and the issue resolved.
Other theoretical options to think how to solve the problem (but I'm unsure if this is possible):
Disable for special postfix transport use bounce
Always rewrite error status PHP script to 0
edit something in sysexits.h

Related

Postfix: lost connection after CONNECT from host

I'm trying to connect to a postfix server from roundcube in another host (all in LAN).
I get always a "lost connection after CONNECT from myhost".
This is my full log:
tail -f /var/log/mail.log
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: initializing the server-side TLS engine
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: connect from ns1.domainexample.com[10.0.0.10]
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: smtp_stream_setup: maxtime=300 enable_deadline=0
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostname: smtpd_client_event_limit_exceptions: ns1.domainexample.com ~? 127.0.0.0/8
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? 127.0.0.0/8
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostname: smtpd_client_event_limit_exceptions: ns1.domainexample.com ~? [::ffff:127.0.0.0]/104
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? [::ffff:127.0.0.0]/104
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostname: smtpd_client_event_limit_exceptions: ns1.domainexample.com ~? [::1]/128
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? [::1]/128
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostname: smtpd_client_event_limit_exceptions: ns1.domainexample.com ~? 10.0.0.0/8
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? 10.0.0.0/8
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: > ns1.domainexample.com[10.0.0.10]: 220 domainexample.com ESMTP Postfix (Debian/GNU)
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: watchdog_pat: 0x55bacd1b1500
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: vstream_fflush_some: fd 19 flush 41
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: smtp_get: EOF
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostname: smtpd_client_event_limit_exceptions: ns1.domainexample.com ~? 127.0.0.0/8
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? 127.0.0.0/8
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostname: smtpd_client_event_limit_exceptions: ns1.domainexample.com ~? [::ffff:127.0.0.0]/104
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? [::ffff:127.0.0.0]/104
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostname: smtpd_client_event_limit_exceptions: ns1.domainexample.com ~? [::1]/128
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? [::1]/128
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostname: smtpd_client_event_limit_exceptions: ns1.domainexample.com ~? 10.0.0.0/8
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? 10.0.0.0/8
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: lost connection after CONNECT from ns1.domainexample.com[10.0.0.10]
Jan 28 11:49:46 domainexample postfix/smtpd[4796]: disconnect from ns1.domainexample.com[10.0.0.10] commands=0/0
Always after match with "match_hostaddr: smtpd_client_event_limit_exceptions: 10.0.0.10 ~? 10.0.0.0/8"
This is my config:
postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
debug_peer_level = 3
debug_peer_list = 10.0.0.10
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = mail.domainexample.com, domainexample.com, mail.domainexample.com, localhost.domainexample.com, localhost
myhostname = domainexample.com
mynetworks = 127.0.0.0/8 10.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = 10.0.0.0/8
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 (Debian/GNU)
smtpd_recipient_restrictions = permit_mynetworks
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_loglevel = 3
smtpd_tls_security_level = may
virtual_alias_maps = hash:/etc/postfix/virtual
If I connect since the roundcube host, I can do it without problems (by CLI):
openssl s_client -starttls smtp -crlf -connect mail.domainexample.com 25
Trying 10.20.30.10...
Connected to mail.domainexample.com.
Escape character is '^]'.
220 domainexample.com ESMTP Postfix (Debian/GNU)
EHLO domainexample.com
250-domainexample.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250-SMTPUTF8
250 CHUNKING
MAIL FROM: admin#domainexample.com
250 2.1.0 Ok
RCPT TO: admin#domainexample.com
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Hellooooo!!!!
.
250 2.0.0 Ok: queued as 0AE20FF6B0
QUIT
221 2.0.0 Bye
Connection closed by foreign host.
But when I connect sind the roundcube page, occur the "lost connection after CONNECT from myhost".
I'm really stuck at this point...
What I'm wrong?
Thanks for help
P.S.: I've tried deleting this message and creating it on serverfault (because I think it's better than here), but couldn't (serverfault says it might be spam, though I deleted this message here).
Try to send a complete mail message, so not just Hellooooo!!!, I think because of the missing from and to, your message is not send.
From: "Admin" <admin#domainexample.com>
To: "Admin" <admin#domainexample.com>
Subject: test message sent from manual telnet session
With the headers set, we now add one blank line with a carriage return/line feed (just press enter twice) and then we start the actual body of the message.
Hello World
.
note the . at the end, Postfix should respond with:
250 2.6.0 message received

Error ldap_sasl_bind_s failed (49) on Multi-Master

The error that appears is this:
Dec 30 18:07:24 openldap03 slapd[16460]: slap_client_connect: URI=ldap://openldap02 DN="cn=config" ldap_sasl_bind_s failed (49)
Dec 30 18:07:24 openldap03 slapd[16460]: do_syncrepl: rid=002 rc 49 retrying (1 retries left)
Dec 30 18:07:24 openldap03 slapd[16460]: slap_client_connect: URI=ldap://openldap01 DN="cn=config" ldap_sasl_bind_s failed (49)
Dec 30 18:07:24 openldap03 slapd[16460]: do_syncrepl: rid=001 rc 49 retrying (1 retries left)
...
Dec 30 18:09:54 openldap03 slapd[16460]: slap_client_connect: URI=ldap://openldap02 DN="cn=ldapadm,dc=domain,dc=local" ldap_sasl_bind_s failed (49)
Dec 30 18:09:54 openldap03 slapd[16460]: do_syncrepl: rid=005 rc 49 retrying (1 retries left)
Dec 30 18:09:54 openldap03 slapd[16460]: slap_client_connect: URI=ldap://openldap01 DN="cn=ldapadm,dc=domain,dc=local" ldap_sasl_bind_s failed (49)
Dec 30 18:09:54 openldap03 slapd[16460]: do_syncrepl: rid=004 rc 49 retrying (1 retries left)
Connection is fine:
[root#openldap03 ~]# telnet openldap01 389
Trying 172.16.11.203...
Connected to openldap01.
Escape character is '^]'.
^]
[root#openldap03 ~]# telnet openldap02 389
Trying 172.16.11.205...
Connected to openldap02.
Escape character is '^]'.
^]
I can add the configuration if they ask me what command to execute
How can I troubleshoot this error?
thanks!
The return code 49 stands for "Invalid credential". You do not have connectivity problem, but the credential you set are not the right one.

Snakemake: R script fails (almost) immediately

Once more I'm encountering an error in my snakemake workflow that doesn't make any sense to me.
This is the error I get:
[Thu Jan 25 10:47:00 2018] Building DAG of jobs...
[Thu Jan 25 10:47:01 2018] Provided cores: 24
[Thu Jan 25 10:47:01 2018] Rules claiming more threads will be scaled down.
[Thu Jan 25 10:47:01 2018] Job counts:
[Thu Jan 25 10:47:01 2018] count jobs
[Thu Jan 25 10:47:01 2018] 1 merging_seurat
[Thu Jan 25 10:47:01 2018] 1
[Thu Jan 25 10:47:01 2018] Job 0: --- Merging samples using seurat.
Error in setClass("Snakemake", slots = c(input = "list", output = "list", :
unused argument(s) (slots = c(input = "list", output = "list", params = "list", wildcards = "list", threads = "numeric", log = "list", resources = "list", config = "list", rule = "character"))
Execution halted
[Thu Jan 25 10:47:02 2018] Error in rule merging_seurat:
[Thu Jan 25 10:47:02 2018] jobid: 0
[Thu Jan 25 10:47:02 2018] output: merging_seurat/12_top10_heatmap_all_wilcox.pdf, merging_seurat/13_top10_heatmap_all_roc.pdf, merging_seurat/merging_seurat.RData
[Thu Jan 25 10:47:02 2018] RuleException:
[Thu Jan 25 10:47:02 2018] CalledProcessError in line 372 of .../snakemake_pipeline/Snakefile:
[Thu Jan 25 10:47:02 2018] Command ' set -euo pipefail; Rscript .../snakemake_pipeline/scripts/.snakemake.jv8ijpiw.merging_seurat.R ' returned non-zero exit status 1
[Thu Jan 25 10:47:02 2018] File ".../snakemake_pipeline/Snakefile", line 372, in __rule_merging_seurat
[Thu Jan 25 10:47:02 2018] File ".../tools/anaconda3/envs/Seurat/lib/python3.5/concurrent/futures/thread.py", line 55, in run
[Thu Jan 25 10:47:02 2018] Will exit after finishing currently running jobs.
[Thu Jan 25 10:47:02 2018] Exiting because a job execution failed. Look above for error message
[Thu Jan 25 10:47:02 2018] Complete log: .../snakemake_6/.snakemake/log/2018-01-25T104700.498155.snakemake.log
This is the rule in question:
rule merging_seurat:
input: expand("{sample}/molecule_count/counts_wide.tsv", sample=config["samples"]),
output: "merging_seurat/12_top10_heatmap_all_wilcox.pdf",
"merging_seurat/13_top10_heatmap_all_roc.pdf",
"merging_seurat/merging_seurat.RData"
message: "--- Merging samples using seurat."
script: "scripts/merging_seurat.R"
Here we have the top of the R script that is still executed:
sink('merging_seurat/output.txt')
print(installed.packages())
print(sessionInfo())
sink()
And these are the following lines in the R script that are not executed anymore:
library('Seurat')
library('dplyr')
library('org.Hs.eg.db')
Because I logged the packages that are available, I know that the three packages that should be loaded are also installed so it shouldn't fail because of that. In fact, commenting these lines out doesn't change anything, the script still breaks and the log message that should come right after loading the packages is not written to the log file.
Finally, this is the command that I use to run snakemake:
snakemake --use-conda \
--latency-wait 90 \
--rerun-incomplete \
--keep-going \
--timestamp \
--cluster-config SGE.json \
--cluster "qsub -cwd -N {cluster.name} -l h_vmem={cluster.h_vmem},h_stack=256M -o {cluster.stdout}{cluster.name}.o -e {cluster.stderr}{cluster.name}.e -m {cluster.mailtype} -M {cluster.mailuser}" \
-j 8 \
--directory .../snakemake_6
Does anybody have a clue what the error message could mean? unused argument of the snakemake R object is strange because I'm calling multiple parameters later on in the script.
What is even more strange is that I have another R script that works with different packages but has very similar first lines runs fine. I remember that in the beginning I had the same problem with that script (same error message) but don't remember how I solved it.
Any help is well appreciated.

FreeRADIUS Google Dual Factor Authenticator, Pam

Hi I've been following this article to setup FreeRADIUS Google Dual Factor Authenticator
http://www.supertechguy.com/help/security/freeradius-google-auth
Hours of testing I still can't get it to work. If my /etc/pam.d/radiusd looks like the following it works well with
the following command
radtest test test localhost 18120 testing123
#
# /etc/pam.d/radiusd - PAM configuration for FreeRADIUS
#
# We fall back to the system default in /etc/pam.d/common-*
#
#include common-auth
#include common-account
#include common-password
#include common-session
However if it looks like the following
#
# /etc/pam.d/radiusd - PAM configuration for FreeRADIUS
#
# We fall back to the system default in /etc/pam.d/common-*
#
##include common-auth
##include common-account
##include common-password
##include common-session
auth requisite pam_google_authenticator.so forward_pass
auth required pam_unix.so use_first_pass
my log file says the following and auth fails.
rad_recv: Access-Request packet from host 127.0.0.1 port 43185, id=111, length=56
User-Name = "test"
User-Password = "test"
NAS-IP-Address = 127.0.1.1
NAS-Port = 18120
Thu Sep 26 16:38:19 2013 : Info: # Executing section authorize from file /etc/freeradius/sites-enabled/default
Thu Sep 26 16:38:19 2013 : Info: +- entering group authorize {...}
Thu Sep 26 16:38:19 2013 : Info: ++[preprocess] returns ok
Thu Sep 26 16:38:19 2013 : Info: ++[chap] returns noop
Thu Sep 26 16:38:19 2013 : Info: ++[mschap] returns noop
Thu Sep 26 16:38:19 2013 : Info: ++[digest] returns noop
Thu Sep 26 16:38:19 2013 : Info: [suffix] No '#' in User-Name = "test", looking up realm NULL
Thu Sep 26 16:38:19 2013 : Info: [suffix] No such realm "NULL"
Thu Sep 26 16:38:19 2013 : Info: ++[suffix] returns noop
Thu Sep 26 16:38:19 2013 : Info: [eap] No EAP-Message, not doing EAP
Thu Sep 26 16:38:19 2013 : Info: ++[eap] returns noop
Thu Sep 26 16:38:19 2013 : Info: [files] users: Matched entry DEFAULT at line 74
Thu Sep 26 16:38:19 2013 : Info: ++[files] returns ok
Thu Sep 26 16:38:19 2013 : Info: ++[expiration] returns noop
Thu Sep 26 16:38:19 2013 : Info: ++[logintime] returns noop
Thu Sep 26 16:38:19 2013 : Info: [pap] WARNING! No "known good" password found for the user. Authentication may fail because of this.
Thu Sep 26 16:38:19 2013 : Info: ++[pap] returns noop
Thu Sep 26 16:38:19 2013 : Info: Found Auth-Type = PAM
Thu Sep 26 16:38:19 2013 : Info: # Executing group from file /etc/freeradius/sites-enabled/default
Thu Sep 26 16:38:19 2013 : Info: +- entering group authenticate {...}
Thu Sep 26 16:38:19 2013 : Debug: pam_pass: using pamauth string <radiusd> for pam.conf lookup
Thu Sep 26 16:38:19 2013 : Debug: pam_pass: function pam_authenticate FAILED for <test>. Reason: Cannot make/remove an entry for the specified session
Thu Sep 26 16:38:19 2013 : Info: ++[pam] returns reject
Thu Sep 26 16:38:19 2013 : Info: Failed to authenticate the user.
Thu Sep 26 16:38:19 2013 : Info: Using Post-Auth-Type Reject
Thu Sep 26 16:38:19 2013 : Info: # Executing group from file /etc/freeradius/sites-enabled/default
Thu Sep 26 16:38:19 2013 : Info: +- entering group REJECT {...}
Thu Sep 26 16:38:19 2013 : Info: [attr_filter.access_reject] expand: %{User-Name} -> test
Thu Sep 26 16:38:19 2013 : Debug: attr_filter: Matched entry DEFAULT at line 11
Thu Sep 26 16:38:19 2013 : Info: ++[attr_filter.access_reject] returns updated
Thu Sep 26 16:38:19 2013 : Info: Delaying reject of request 0 for 1 seconds
Thu Sep 26 16:38:19 2013 : Debug: Going to the next request
Thu Sep 26 16:38:19 2013 : Debug: Waking up in 0.9 seconds.
Thu Sep 26 16:38:20 2013 : Info: Sending delayed reject for request 0
Sending Access-Reject of id 111 to 127.0.0.1 port 43185
Thu Sep 26 16:38:20 2013 : Debug: Waking up in 4.9 seconds.
Thu Sep 26 16:38:25 2013 : Info: Cleaning up request 0 ID 111 with timestamp +3
Thu Sep 26 16:38:25 2013 : Info: Ready to process requests.
I'm using Ubuntu latest
Does anyone know what the issue here?
Many Thanks
After so much internet surfing and forum hunting I manage to fix this problem. If anyone else having this issue this might help them :)
Thu Sep 26 16:38:19 2013 : Debug: pam_pass: using pamauth string <radiusd> for pam.conf lookup
Thu Sep 26 16:38:19 2013 : Debug: pam_pass: function pam_authenticate FAILED for <test>. Reason: Cannot make/remove an entry for the specified session
The above line actually means a auth fail, even though it doesn't sound like it, also it could mean that .google_authenticator file in the user's home directory isn't accessible.
FreeRadius log file not help you much with this issue, but have a look through /var/log/secure on CentOS and /var/log/auth.log in Ubuntu. This will explain which is the issue.
Issue with my system was my time was out and my random generated number by Google Dual Factor Authenticator application on my iPhone wasn't valid. I had to install NTP and change my servers time to the correct time which fixed the issue!!!!
hope this help someone else :)
The how-to on Super Tech Guy's page (http://www.supertechguy.com/help/security/freeradius-google-auth) has a typo.
DEFAULT Auth-Type := PAM
should be
DEFAULT Auth-Type = PAM
I don't know why he put a colon in there, but removing it fixed my issue.
This was after I made sure the server had the correct time (and timezone), which it didn't. So thanks for that suggestion too!

Unix command for extracting lines befor and after a particular searched string pattern

How can I search for lines in a file and extract the lines above and below lines of the searched line .
My input is like
Tue Jun 26 14:59:46 2012
Warning ffffffff act_msg_ctms_remove_from_pending_queue: deleting message 44817201 from the queue.
Tue Jun 26 14:59:46 2012
Warning ffffffff Finishing processing record number 44817201
Tue Jun 26 14:59:46 2012
Warning 5000000 activity_queue_manager_finish_cb: unknown activity 120.
Tue Jun 26 14:59:46 2012
Warning ffffffff Activity State Machine priority (2) finished
Tue Jun 26 14:59:46 2012
Warning ffffffff
====================================================
Processing database file "INCOMING_MESSAGES" record number 47810234 from user "(unknown)"
Tue Jun 26 14:59:46 2012
Warning ffffffff ACTIVITY data: rec_num (47810234) size (116)
Tue Jun 26 14:59:46 2012
Warning ffffffff activity status: ACT_SENT
Tue Jun 26 14:59:46 2012
Warning ffffffff MESSAGE body "MVT
QFA6673/26.VHQOS.BNE
EA0541
"
Tue Jun 26 14:59:46 2012
Warning ffffffff Finishing processing record number 47810234
Tue Jun 26 14:59:46 2012
Warning ffffffff Activity State Machine priority (1) finished
Tue Jun 26 14:59:46 2012
Warning ffffffff
End processing record number 47810234
====================================================
And I require my output to be like
/
Tue Jun 26 14:59:46 2012
Warning ffffffff MESSAGE body "MVT
QFA6673/26.VHQOS.BNE
EA0541"
/
My search string would be MVT.
Pls help
For three lines before and after the match
grep -C 3 pattern filename
For more control on number of after and before lines to be displayed for a match, use
grep -A (num of after) -B (num of lines before) pattern filename
From man grep:
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines.
Places a line containing -- between contiguous groups of matches.
-a, --text
Process a binary file as if it were text;
this is equivalent to the --binary-files=text option.
-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines.
Places a line containing -- between contiguous groups of matches.
-C NUM, --context=NUM
Print NUM lines of output context.
Places a line containing -- between contiguous groups of matches.
Grep has options to display rows immediately before and after the match. The numbers in the command line below are the appropriate number of rows to display, after and before the match. E.g.
grep -A3 -B5 yoursearchpattern inputfilepattern
man grep is useful for details about the options.
Assuming you have GNU grep, to check you can use --version option:
> grep --version
GNU grep 2.6.3

Resources