sendEmail usage - Can't use improperly formatted email address: (for
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
sendEmail usage - Can't use improperly formatted email address: (for
I have a script to report phishing sites that calls sendEmail. I keep getting the above error and can't seem to figure out just what the problem is. What I see in the output log for sendEmail is at these pastebin links http://pastebin.com/YysSZVDh, http://pastebin.com/tdP1JFde. One as a success and one as a failure. If the sendEmail and sendphish scripts are needed, which I'm sure they will be, I'll attach them here. There are also a few additional files to run sendphish here http://pastebin.com/Vr4fhpmg If I've left something out please let me know. I've contacted the author on this before but all he basically told me was to read the docs on addressing which I've done multiple times to no avail.
## Make sure email addresses look OK.
foreach my $addr (@to, @cc, @bcc, $from, $opt{'reply-to'}) {
if ($addr) {
if (!returnAddressParts($addr)) {
printmsg("ERROR => Can't use improperly formatted email address: $addr", 0);
printmsg("HINT => Try viewing the extended help on addressing with \"--help addressing\"", 1);
quit("", 1);
}
}
}
.. shows that there should be an email address listed after the first error message but I can't see one in your error:
Code:
Can't use improperly formatted email address: (for Sep 21 19:26:55 cpollock sendEmail[17050]: HINT => Try viewing the extended help on addressing with "--help addressing"
Try modifying sendEmail like this and maybe we'll be able to see what the problem is:
Code:
## Make sure email addresses look OK.
foreach my $addr (@to, @cc, @bcc, $from, $opt{'reply-to'}) {
if ($addr) {
printmsg("[*] kbp_debug: current address: \"$addr\"", 0);
if (!returnAddressParts($addr)) {
printmsg("ERROR => Can't use improperly formatted email address: $addr", 0);
printmsg("HINT => Try viewing the extended help on addressing with \"--help addressing\"", 1);
quit("", 1);
}
}
}
.. it doesn't pass the email address validator in sendEmail (correctly), can you tell where this is coming from ?
<edit>Just had some time to look at it further, looks like you may have to add the bad address to abuseaddrdel.txt as it's managing to get through the validation in getabuseaddr()</edit>
Oct 04 19:31:32 cpollock sendEmail[6672]: DEBUG => Assigned $opt{} key/value: tls => auto
Oct 04 19:31:32 cpollock sendEmail[6672]: DEBUG => Assigned $opt{} key/value: reply-to => cpollock@embarqmail.com
Oct 04 19:31:32 cpollock sendEmail[6672]: DEBUG => Assigned $opt{} key/value: message-file => /tmp/msgbody.5170
Oct 04 19:31:32 cpollock sendEmail[6672]:[*] kbp_debug (to): current address: "info@kickme.to"
Oct 04 19:31:32 cpollock sendEmail[6672]:[*] kbp_debug (to): current address: "(for"
Oct 04 19:31:32 cpollock sendEmail[6672]: ERROR => Can't use improperly formatted email address: (for
Oct 04 19:31:32 cpollock sendEmail[6672]: HINT => Try viewing the extended help on addressing with "--help addressing"
I don't understand where the script is getting this:
kbp_debug (to): current address: "(for"
ERROR => Can't use improperly formatted email address: (for
a to: address of 'for'
While a successful post shows:
Code:
Oct 04 19:07:26 cpollock sendEmail[27934]:[*] kbp_debug (to): current address: "abuse@ntt.net"
Oct 04 19:07:26 cpollock sendEmail[27934]:[*] kbp_debug (bcc): current address: "cpollock@embarqmail.com"
Oct 04 19:07:26 cpollock sendEmail[27934]:[*] kbp_debug (to): current address: "cpollock@embarqmail.com"
Oct 04 19:07:26 cpollock sendEmail[27934]:[*] kbp_debug (to): current address: "cpollock@embarqmail.com"
Checking at 'whois.abuse.net' for kickme.to I get
Code:
[chris@localhost ~]$ telnet whois.abuse.net 43
Trying 64.57.183.95...
Connected to whois.abuse.net (64.57.183.95).
Escape character is '^]'.
kickme.to
info@kickme.to (for kickme.to)
So the script appears to be parsing the correct address for abuse, or am I just confusing myself more?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.